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

     1  apiVersion: cluster.x-k8s.io/v1beta1
     2  kind: ClusterClass
     3  metadata:
     4    name: ${CLUSTER_CLASS_NAME}
     5    namespace: default
     6  spec:
     7    controlPlane:
     8      machineInfrastructure:
     9        ref:
    10          apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    11          kind: AzureMachineTemplate
    12          name: ${CLUSTER_NAME}-control-plane
    13      ref:
    14        apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    15        kind: KubeadmControlPlaneTemplate
    16        name: ${CLUSTER_NAME}-control-plane
    17    infrastructure:
    18      ref:
    19        apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    20        kind: AzureClusterTemplate
    21        name: ${CLUSTER_NAME}-azure-cluster
    22    patches:
    23    - definitions:
    24      - jsonPatches:
    25        - op: add
    26          path: /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/controllerManager/extraArgs/cluster-name
    27          valueFrom:
    28            variable: builtin.cluster.name
    29        - op: replace
    30          path: /spec/template/spec/kubeadmConfigSpec/files
    31          valueFrom:
    32            template: |
    33              - contentFrom:
    34                  secret:
    35                    key: control-plane-azure.json
    36                    name: "{{ .builtin.controlPlane.machineTemplate.infrastructureRef.name }}-azure-json"
    37                owner: root:root
    38                path: /etc/kubernetes/azure.json
    39                permissions: "0644"
    40        selector:
    41          apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    42          kind: KubeadmControlPlaneTemplate
    43          matchResources:
    44            controlPlane: true
    45      name: controlPlaneAzureJsonSecretName
    46    - definitions:
    47      - jsonPatches:
    48        - op: replace
    49          path: /spec/template/spec/files
    50          valueFrom:
    51            template: |
    52              - contentFrom:
    53                  secret:
    54                    key: worker-node-azure.json
    55                    name: "{{ .builtin.machineDeployment.infrastructureRef.name }}-azure-json"
    56                owner: root:root
    57                path: /etc/kubernetes/azure.json
    58                permissions: "0644"
    59        selector:
    60          apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
    61          kind: KubeadmConfigTemplate
    62          matchResources:
    63            machineDeploymentClass:
    64              names:
    65              - ${CLUSTER_NAME}-worker
    66      name: workerAzureJsonSecretName
    67    workers:
    68      machineDeployments:
    69      - class: ${CLUSTER_NAME}-worker
    70        template:
    71          bootstrap:
    72            ref:
    73              apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
    74              kind: KubeadmConfigTemplate
    75              name: ${CLUSTER_NAME}-md-0
    76          infrastructure:
    77            ref:
    78              apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    79              kind: AzureMachineTemplate
    80              name: ${CLUSTER_NAME}-md-0
    81  ---
    82  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    83  kind: AzureClusterTemplate
    84  metadata:
    85    name: ${CLUSTER_NAME}-azure-cluster
    86    namespace: default
    87  spec:
    88    template:
    89      spec:
    90        identityRef:
    91          apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    92          kind: AzureClusterIdentity
    93          name: ${CLUSTER_IDENTITY_NAME}
    94        location: ${AZURE_LOCATION}
    95        networkSpec:
    96          subnets:
    97          - name: control-plane-subnet
    98            role: control-plane
    99          - name: node-subnet
   100            natGateway:
   101              name: node-natgateway
   102            role: node
   103        subscriptionID: ${AZURE_SUBSCRIPTION_ID}
   104  ---
   105  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   106  kind: AzureMachineTemplate
   107  metadata:
   108    name: ${CLUSTER_NAME}-control-plane
   109    namespace: default
   110  spec:
   111    template:
   112      spec:
   113        dataDisks:
   114        - diskSizeGB: 256
   115          lun: 0
   116          nameSuffix: etcddisk
   117        osDisk:
   118          diskSizeGB: 128
   119          osType: Linux
   120        sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
   121        vmSize: ${AZURE_CONTROL_PLANE_MACHINE_TYPE}
   122  ---
   123  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   124  kind: AzureMachineTemplate
   125  metadata:
   126    name: ${CLUSTER_NAME}-md-0
   127    namespace: default
   128  spec:
   129    template:
   130      spec:
   131        osDisk:
   132          diskSizeGB: 128
   133          osType: Linux
   134        sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
   135        vmSize: ${AZURE_NODE_MACHINE_TYPE}
   136  ---
   137  apiVersion: controlplane.cluster.x-k8s.io/v1beta1
   138  kind: KubeadmControlPlaneTemplate
   139  metadata:
   140    name: ${CLUSTER_NAME}-control-plane
   141    namespace: default
   142  spec:
   143    template:
   144      spec:
   145        kubeadmConfigSpec:
   146          clusterConfiguration:
   147            apiServer:
   148              extraArgs:
   149                cloud-provider: external
   150              timeoutForControlPlane: 20m
   151            controllerManager:
   152              extraArgs:
   153                allocate-node-cidrs: "false"
   154                cloud-provider: external
   155                cluster-name: ${CLUSTER_NAME}
   156            etcd:
   157              local:
   158                dataDir: /var/lib/etcddisk/etcd
   159                extraArgs:
   160                  quota-backend-bytes: "8589934592"
   161          diskSetup:
   162            filesystems:
   163            - device: /dev/disk/azure/scsi1/lun0
   164              extraOpts:
   165              - -E
   166              - lazy_itable_init=1,lazy_journal_init=1
   167              filesystem: ext4
   168              label: etcd_disk
   169            - device: ephemeral0.1
   170              filesystem: ext4
   171              label: ephemeral0
   172              replaceFS: ntfs
   173            partitions:
   174            - device: /dev/disk/azure/scsi1/lun0
   175              layout: true
   176              overwrite: false
   177              tableType: gpt
   178          files:
   179          - contentFrom:
   180              secret:
   181                key: control-plane-azure.json
   182                name: replace_me
   183            owner: root:root
   184            path: /etc/kubernetes/azure.json
   185            permissions: "0644"
   186          initConfiguration:
   187            nodeRegistration:
   188              kubeletExtraArgs:
   189                cloud-provider: external
   190              name: '{{ ds.meta_data["local_hostname"] }}'
   191          joinConfiguration:
   192            nodeRegistration:
   193              kubeletExtraArgs:
   194                cloud-provider: external
   195              name: '{{ ds.meta_data["local_hostname"] }}'
   196          mounts:
   197          - - LABEL=etcd_disk
   198            - /var/lib/etcddisk
   199          postKubeadmCommands: []
   200          preKubeadmCommands: []
   201  ---
   202  apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
   203  kind: KubeadmConfigTemplate
   204  metadata:
   205    name: ${CLUSTER_NAME}-md-0
   206    namespace: default
   207  spec:
   208    template:
   209      spec:
   210        files:
   211        - contentFrom:
   212            secret:
   213              key: worker-node-azure.json
   214              name: replace_me
   215          owner: root:root
   216          path: /etc/kubernetes/azure.json
   217          permissions: "0644"
   218        joinConfiguration:
   219          nodeRegistration:
   220            kubeletExtraArgs:
   221              cloud-provider: external
   222            name: '{{ ds.meta_data["local_hostname"] }}'
   223        preKubeadmCommands: []
   224  ---
   225  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   226  kind: AzureClusterIdentity
   227  metadata:
   228    labels:
   229      clusterctl.cluster.x-k8s.io/move-hierarchy: "true"
   230    name: ${CLUSTER_IDENTITY_NAME}
   231    namespace: default
   232  spec:
   233    allowedNamespaces: {}
   234    clientID: ${AZURE_CLIENT_ID}
   235    clientSecret:
   236      name: ${AZURE_CLUSTER_IDENTITY_SECRET_NAME}
   237      namespace: ${AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE}
   238    tenantID: ${AZURE_TENANT_ID}
   239    type: ServicePrincipal