sigs.k8s.io/cluster-api-provider-azure@v1.17.0/templates/test/ci/cluster-template-prow-flatcar.yaml (about)

     1  apiVersion: cluster.x-k8s.io/v1beta1
     2  kind: Cluster
     3  metadata:
     4    labels:
     5      cloud-provider: azure-flatcar
     6      cni: calico
     7    name: ${CLUSTER_NAME}
     8    namespace: default
     9  spec:
    10    clusterNetwork:
    11      pods:
    12        cidrBlocks:
    13        - 192.168.0.0/16
    14    controlPlaneRef:
    15      apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    16      kind: KubeadmControlPlane
    17      name: ${CLUSTER_NAME}-control-plane
    18    infrastructureRef:
    19      apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    20      kind: AzureCluster
    21      name: ${CLUSTER_NAME}
    22  ---
    23  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    24  kind: AzureCluster
    25  metadata:
    26    name: ${CLUSTER_NAME}
    27    namespace: default
    28  spec:
    29    additionalTags:
    30      buildProvenance: ${BUILD_PROVENANCE}
    31      creationTimestamp: ${TIMESTAMP}
    32      jobName: ${JOB_NAME}
    33    identityRef:
    34      apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    35      kind: AzureClusterIdentity
    36      name: ${CLUSTER_IDENTITY_NAME}
    37    location: ${AZURE_LOCATION}
    38    networkSpec:
    39      subnets:
    40      - name: control-plane-subnet
    41        role: control-plane
    42      - name: node-subnet
    43        role: node
    44      vnet:
    45        name: ${AZURE_VNET_NAME:=${CLUSTER_NAME}-vnet}
    46    resourceGroup: ${AZURE_RESOURCE_GROUP:=${CLUSTER_NAME}}
    47    subscriptionID: ${AZURE_SUBSCRIPTION_ID}
    48  ---
    49  apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    50  kind: KubeadmControlPlane
    51  metadata:
    52    name: ${CLUSTER_NAME}-control-plane
    53    namespace: default
    54  spec:
    55    kubeadmConfigSpec:
    56      clusterConfiguration:
    57        apiServer:
    58          extraArgs:
    59            cloud-provider: external
    60          timeoutForControlPlane: 20m
    61        controllerManager:
    62          extraArgs:
    63            allocate-node-cidrs: "false"
    64            cloud-provider: external
    65            cluster-name: ${CLUSTER_NAME}
    66            v: "4"
    67        etcd:
    68          local:
    69            dataDir: /var/lib/etcddisk/etcd
    70            extraArgs:
    71              quota-backend-bytes: "8589934592"
    72      diskSetup:
    73        filesystems:
    74        - device: /dev/disk/azure/scsi1/lun0
    75          extraOpts:
    76          - -E
    77          - lazy_itable_init=1,lazy_journal_init=1
    78          filesystem: ext4
    79          label: etcd_disk
    80          overwrite: false
    81        partitions: []
    82      files:
    83      - contentFrom:
    84          secret:
    85            key: control-plane-azure.json
    86            name: ${CLUSTER_NAME}-control-plane-azure-json
    87        owner: root:root
    88        path: /etc/kubernetes/azure.json
    89        permissions: "0644"
    90      format: ignition
    91      ignition:
    92        containerLinuxConfig:
    93          additionalConfig: |
    94            systemd:
    95              units:
    96              - name: kubeadm.service
    97                dropins:
    98                - name: 10-flatcar.conf
    99                  contents: |
   100                    [Unit]
   101                    After=oem-cloudinit.service
   102                    # kubeadm must run after containerd - see https://github.com/kubernetes-sigs/image-builder/issues/939.
   103                    After=containerd.service
   104            # Workaround for https://github.com/kubernetes-sigs/cluster-api/issues/7679.
   105            storage:
   106              disks:
   107              - device: /dev/disk/azure/scsi1/lun0
   108                partitions:
   109                - number: 1
   110      initConfiguration:
   111        nodeRegistration:
   112          kubeletExtraArgs:
   113            cloud-provider: external
   114          name: '@@HOSTNAME@@'
   115      joinConfiguration:
   116        nodeRegistration:
   117          kubeletExtraArgs:
   118            cloud-provider: external
   119          name: '@@HOSTNAME@@'
   120      mounts:
   121      - - etcd_disk
   122        - /var/lib/etcddisk
   123      postKubeadmCommands: []
   124      preKubeadmCommands:
   125      - sed -i "s/@@HOSTNAME@@/$(curl -s -H Metadata:true --noproxy '*' 'http://169.254.169.254/metadata/instance?api-version=2020-09-01'
   126        | jq -r .compute.name)/g" /etc/kubeadm.yml
   127    machineTemplate:
   128      infrastructureRef:
   129        apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   130        kind: AzureMachineTemplate
   131        name: ${CLUSTER_NAME}-control-plane
   132    replicas: ${CONTROL_PLANE_MACHINE_COUNT:=1}
   133    version: ${KUBERNETES_VERSION}
   134  ---
   135  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   136  kind: AzureMachineTemplate
   137  metadata:
   138    name: ${CLUSTER_NAME}-control-plane
   139    namespace: default
   140  spec:
   141    template:
   142      spec:
   143        dataDisks:
   144        - diskSizeGB: 256
   145          lun: 0
   146          nameSuffix: etcddisk
   147        identity: UserAssigned
   148        image:
   149          computeGallery:
   150            gallery: flatcar4capi-742ef0cb-dcaa-4ecb-9cb0-bfd2e43dccc0
   151            name: flatcar-stable-amd64-capi-${KUBERNETES_VERSION}
   152            version: ${FLATCAR_VERSION}
   153        osDisk:
   154          diskSizeGB: 128
   155          osType: Linux
   156        sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
   157        userAssignedIdentities:
   158        - providerID: /subscriptions/${AZURE_SUBSCRIPTION_ID}/resourceGroups/${CI_RG:=capz-ci}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/${USER_IDENTITY:=cloud-provider-user-identity}
   159        vmSize: ${AZURE_CONTROL_PLANE_MACHINE_TYPE}
   160  ---
   161  apiVersion: cluster.x-k8s.io/v1beta1
   162  kind: MachineDeployment
   163  metadata:
   164    name: ${CLUSTER_NAME}-md-0
   165    namespace: default
   166  spec:
   167    clusterName: ${CLUSTER_NAME}
   168    replicas: ${WORKER_MACHINE_COUNT:=2}
   169    selector:
   170      matchLabels: null
   171    template:
   172      spec:
   173        bootstrap:
   174          configRef:
   175            apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
   176            kind: KubeadmConfigTemplate
   177            name: ${CLUSTER_NAME}-md-0
   178        clusterName: ${CLUSTER_NAME}
   179        infrastructureRef:
   180          apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   181          kind: AzureMachineTemplate
   182          name: ${CLUSTER_NAME}-md-0
   183        version: ${KUBERNETES_VERSION}
   184  ---
   185  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   186  kind: AzureMachineTemplate
   187  metadata:
   188    name: ${CLUSTER_NAME}-md-0
   189    namespace: default
   190  spec:
   191    template:
   192      spec:
   193        image:
   194          computeGallery:
   195            gallery: flatcar4capi-742ef0cb-dcaa-4ecb-9cb0-bfd2e43dccc0
   196            name: flatcar-stable-amd64-capi-${KUBERNETES_VERSION}
   197            version: ${FLATCAR_VERSION}
   198        osDisk:
   199          diskSizeGB: 128
   200          osType: Linux
   201        sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
   202        vmSize: ${AZURE_NODE_MACHINE_TYPE}
   203  ---
   204  apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
   205  kind: KubeadmConfigTemplate
   206  metadata:
   207    name: ${CLUSTER_NAME}-md-0
   208    namespace: default
   209  spec:
   210    template:
   211      spec:
   212        files:
   213        - contentFrom:
   214            secret:
   215              key: worker-node-azure.json
   216              name: ${CLUSTER_NAME}-md-0-azure-json
   217          owner: root:root
   218          path: /etc/kubernetes/azure.json
   219          permissions: "0644"
   220        format: ignition
   221        ignition:
   222          containerLinuxConfig:
   223            additionalConfig: |
   224              systemd:
   225                units:
   226                - name: kubeadm.service
   227                  dropins:
   228                  - name: 10-flatcar.conf
   229                    contents: |
   230                      [Unit]
   231                      After=oem-cloudinit.service
   232                      # kubeadm must run after containerd - see https://github.com/kubernetes-sigs/image-builder/issues/939.
   233                      After=containerd.service
   234        joinConfiguration:
   235          nodeRegistration:
   236            kubeletExtraArgs:
   237              cloud-provider: external
   238            name: '@@HOSTNAME@@'
   239        postKubeadmCommands: []
   240        preKubeadmCommands:
   241        - sed -i "s/@@HOSTNAME@@/$(curl -s -H Metadata:true --noproxy '*' 'http://169.254.169.254/metadata/instance?api-version=2020-09-01'
   242          | jq -r .compute.name)/g" /etc/kubeadm.yml
   243  ---
   244  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   245  kind: AzureClusterIdentity
   246  metadata:
   247    labels:
   248      clusterctl.cluster.x-k8s.io/move-hierarchy: "true"
   249    name: ${CLUSTER_IDENTITY_NAME}
   250    namespace: default
   251  spec:
   252    allowedNamespaces: {}
   253    clientID: ${AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY}
   254    tenantID: ${AZURE_TENANT_ID}
   255    type: ${CLUSTER_IDENTITY_TYPE:=WorkloadIdentity}
   256  ---
   257  apiVersion: addons.cluster.x-k8s.io/v1alpha1
   258  kind: HelmChartProxy
   259  metadata:
   260    name: calico
   261    namespace: default
   262  spec:
   263    chartName: tigera-operator
   264    clusterSelector:
   265      matchLabels:
   266        cni: calico
   267    namespace: tigera-operator
   268    releaseName: projectcalico
   269    repoURL: https://docs.tigera.io/calico/charts
   270    valuesTemplate: |-
   271      installation:
   272        cni:
   273          type: Calico
   274        calicoNetwork:
   275          bgp: Disabled
   276          mtu: 1350
   277          ipPools:
   278          ipPools:{{range $i, $cidr := .Cluster.spec.clusterNetwork.pods.cidrBlocks }}
   279          - cidr: {{ $cidr }}
   280            encapsulation: VXLAN{{end}}
   281        registry: mcr.microsoft.com/oss
   282      # Image and registry configuration for the tigera/operator pod.
   283      tigeraOperator:
   284        image: tigera/operator
   285        registry: mcr.microsoft.com/oss
   286      calicoctl:
   287        image: mcr.microsoft.com/oss/calico/ctl
   288    version: ${CALICO_VERSION}
   289  ---
   290  apiVersion: addons.cluster.x-k8s.io/v1alpha1
   291  kind: HelmChartProxy
   292  metadata:
   293    name: azuredisk-csi-driver-chart
   294    namespace: default
   295  spec:
   296    chartName: azuredisk-csi-driver
   297    clusterSelector:
   298      matchLabels:
   299        azuredisk-csi: "true"
   300    namespace: kube-system
   301    releaseName: azuredisk-csi-driver-oot
   302    repoURL: https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/charts
   303    valuesTemplate: |-
   304      controller:
   305        replicas: 1
   306        runOnControlPlane: true
   307      windows:
   308        useHostProcessContainers: {{ hasKey .Cluster.metadata.labels "cni-windows" }}
   309  ---
   310  apiVersion: addons.cluster.x-k8s.io/v1alpha1
   311  kind: HelmChartProxy
   312  metadata:
   313    name: cloud-provider-azure-chart-flatcar
   314    namespace: default
   315  spec:
   316    chartName: cloud-provider-azure
   317    clusterSelector:
   318      matchLabels:
   319        cloud-provider: azure-flatcar
   320    releaseName: cloud-provider-azure-oot
   321    repoURL: https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo
   322    valuesTemplate: |
   323      infra:
   324        clusterName: {{ .Cluster.metadata.name }}
   325      cloudControllerManager:
   326        clusterCIDR: {{ .Cluster.spec.clusterNetwork.pods.cidrBlocks | join "," }}
   327        logVerbosity: 4
   328        caCertDir: /usr/share/ca-certificates