sigs.k8s.io/cluster-api-provider-azure@v1.14.3/templates/cluster-template-flatcar.yaml (about)

     1  apiVersion: cluster.x-k8s.io/v1beta1
     2  kind: Cluster
     3  metadata:
     4    name: ${CLUSTER_NAME}
     5    namespace: default
     6  spec:
     7    clusterNetwork:
     8      pods:
     9        cidrBlocks:
    10        - 192.168.0.0/16
    11    controlPlaneRef:
    12      apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    13      kind: KubeadmControlPlane
    14      name: ${CLUSTER_NAME}-control-plane
    15    infrastructureRef:
    16      apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    17      kind: AzureCluster
    18      name: ${CLUSTER_NAME}
    19  ---
    20  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    21  kind: AzureCluster
    22  metadata:
    23    name: ${CLUSTER_NAME}
    24    namespace: default
    25  spec:
    26    identityRef:
    27      apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    28      kind: AzureClusterIdentity
    29      name: ${CLUSTER_IDENTITY_NAME}
    30    location: ${AZURE_LOCATION}
    31    networkSpec:
    32      subnets:
    33      - name: control-plane-subnet
    34        role: control-plane
    35      - name: node-subnet
    36        role: node
    37      vnet:
    38        name: ${AZURE_VNET_NAME:=${CLUSTER_NAME}-vnet}
    39    resourceGroup: ${AZURE_RESOURCE_GROUP:=${CLUSTER_NAME}}
    40    subscriptionID: ${AZURE_SUBSCRIPTION_ID}
    41  ---
    42  apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    43  kind: KubeadmControlPlane
    44  metadata:
    45    name: ${CLUSTER_NAME}-control-plane
    46    namespace: default
    47  spec:
    48    kubeadmConfigSpec:
    49      clusterConfiguration:
    50        apiServer:
    51          extraArgs:
    52            cloud-provider: external
    53          timeoutForControlPlane: 20m
    54        controllerManager:
    55          extraArgs:
    56            allocate-node-cidrs: "false"
    57            cloud-provider: external
    58            cluster-name: ${CLUSTER_NAME}
    59        etcd:
    60          local:
    61            dataDir: /var/lib/etcddisk/etcd
    62            extraArgs:
    63              quota-backend-bytes: "8589934592"
    64      diskSetup:
    65        filesystems:
    66        - device: /dev/disk/azure/scsi1/lun0
    67          extraOpts:
    68          - -E
    69          - lazy_itable_init=1,lazy_journal_init=1
    70          filesystem: ext4
    71          label: etcd_disk
    72          overwrite: false
    73        partitions: []
    74      files:
    75      - contentFrom:
    76          secret:
    77            key: control-plane-azure.json
    78            name: ${CLUSTER_NAME}-control-plane-azure-json
    79        owner: root:root
    80        path: /etc/kubernetes/azure.json
    81        permissions: "0644"
    82      format: ignition
    83      ignition:
    84        containerLinuxConfig:
    85          additionalConfig: |
    86            systemd:
    87              units:
    88              - name: kubeadm.service
    89                dropins:
    90                - name: 10-flatcar.conf
    91                  contents: |
    92                    [Unit]
    93                    After=oem-cloudinit.service
    94                    # kubeadm must run after containerd - see https://github.com/kubernetes-sigs/image-builder/issues/939.
    95                    After=containerd.service
    96            # Workaround for https://github.com/kubernetes-sigs/cluster-api/issues/7679.
    97            storage:
    98              disks:
    99              - device: /dev/disk/azure/scsi1/lun0
   100                partitions:
   101                - number: 1
   102      initConfiguration:
   103        nodeRegistration:
   104          kubeletExtraArgs:
   105            cloud-provider: external
   106          name: '@@HOSTNAME@@'
   107      joinConfiguration:
   108        nodeRegistration:
   109          kubeletExtraArgs:
   110            cloud-provider: external
   111          name: '@@HOSTNAME@@'
   112      mounts:
   113      - - etcd_disk
   114        - /var/lib/etcddisk
   115      postKubeadmCommands: []
   116      preKubeadmCommands:
   117      - sed -i "s/@@HOSTNAME@@/$(curl -s -H Metadata:true --noproxy '*' 'http://169.254.169.254/metadata/instance?api-version=2020-09-01'
   118        | jq -r .compute.name)/g" /etc/kubeadm.yml
   119    machineTemplate:
   120      infrastructureRef:
   121        apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   122        kind: AzureMachineTemplate
   123        name: ${CLUSTER_NAME}-control-plane
   124    replicas: ${CONTROL_PLANE_MACHINE_COUNT:=1}
   125    version: ${KUBERNETES_VERSION}
   126  ---
   127  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   128  kind: AzureMachineTemplate
   129  metadata:
   130    name: ${CLUSTER_NAME}-control-plane
   131    namespace: default
   132  spec:
   133    template:
   134      spec:
   135        dataDisks:
   136        - diskSizeGB: 256
   137          lun: 0
   138          nameSuffix: etcddisk
   139        image:
   140          computeGallery:
   141            gallery: flatcar4capi-742ef0cb-dcaa-4ecb-9cb0-bfd2e43dccc0
   142            name: flatcar-stable-amd64-capi-${KUBERNETES_VERSION}
   143            version: ${FLATCAR_VERSION}
   144        osDisk:
   145          diskSizeGB: 128
   146          osType: Linux
   147        sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
   148        vmSize: ${AZURE_CONTROL_PLANE_MACHINE_TYPE}
   149  ---
   150  apiVersion: cluster.x-k8s.io/v1beta1
   151  kind: MachineDeployment
   152  metadata:
   153    name: ${CLUSTER_NAME}-md-0
   154    namespace: default
   155  spec:
   156    clusterName: ${CLUSTER_NAME}
   157    replicas: ${WORKER_MACHINE_COUNT:=2}
   158    selector:
   159      matchLabels: null
   160    template:
   161      spec:
   162        bootstrap:
   163          configRef:
   164            apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
   165            kind: KubeadmConfigTemplate
   166            name: ${CLUSTER_NAME}-md-0
   167        clusterName: ${CLUSTER_NAME}
   168        infrastructureRef:
   169          apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   170          kind: AzureMachineTemplate
   171          name: ${CLUSTER_NAME}-md-0
   172        version: ${KUBERNETES_VERSION}
   173  ---
   174  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   175  kind: AzureMachineTemplate
   176  metadata:
   177    name: ${CLUSTER_NAME}-md-0
   178    namespace: default
   179  spec:
   180    template:
   181      spec:
   182        image:
   183          computeGallery:
   184            gallery: flatcar4capi-742ef0cb-dcaa-4ecb-9cb0-bfd2e43dccc0
   185            name: flatcar-stable-amd64-capi-${KUBERNETES_VERSION}
   186            version: ${FLATCAR_VERSION}
   187        osDisk:
   188          diskSizeGB: 128
   189          osType: Linux
   190        sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
   191        vmSize: ${AZURE_NODE_MACHINE_TYPE}
   192  ---
   193  apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
   194  kind: KubeadmConfigTemplate
   195  metadata:
   196    name: ${CLUSTER_NAME}-md-0
   197    namespace: default
   198  spec:
   199    template:
   200      spec:
   201        files:
   202        - contentFrom:
   203            secret:
   204              key: worker-node-azure.json
   205              name: ${CLUSTER_NAME}-md-0-azure-json
   206          owner: root:root
   207          path: /etc/kubernetes/azure.json
   208          permissions: "0644"
   209        format: ignition
   210        ignition:
   211          containerLinuxConfig:
   212            additionalConfig: |
   213              systemd:
   214                units:
   215                - name: kubeadm.service
   216                  dropins:
   217                  - name: 10-flatcar.conf
   218                    contents: |
   219                      [Unit]
   220                      After=oem-cloudinit.service
   221                      # kubeadm must run after containerd - see https://github.com/kubernetes-sigs/image-builder/issues/939.
   222                      After=containerd.service
   223        joinConfiguration:
   224          nodeRegistration:
   225            kubeletExtraArgs:
   226              cloud-provider: external
   227            name: '@@HOSTNAME@@'
   228        postKubeadmCommands: []
   229        preKubeadmCommands:
   230        - sed -i "s/@@HOSTNAME@@/$(curl -s -H Metadata:true --noproxy '*' 'http://169.254.169.254/metadata/instance?api-version=2020-09-01'
   231          | jq -r .compute.name)/g" /etc/kubeadm.yml
   232  ---
   233  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   234  kind: AzureClusterIdentity
   235  metadata:
   236    labels:
   237      clusterctl.cluster.x-k8s.io/move-hierarchy: "true"
   238    name: ${CLUSTER_IDENTITY_NAME}
   239    namespace: default
   240  spec:
   241    allowedNamespaces: {}
   242    clientID: ${AZURE_CLIENT_ID}
   243    clientSecret:
   244      name: ${AZURE_CLUSTER_IDENTITY_SECRET_NAME}
   245      namespace: ${AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE}
   246    tenantID: ${AZURE_TENANT_ID}
   247    type: ServicePrincipal