sigs.k8s.io/cluster-api-provider-azure@v1.17.0/templates/cluster-template-ephemeral.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        - device: ephemeral0.1
    73          filesystem: ext4
    74          label: ephemeral0
    75          replaceFS: ntfs
    76        partitions:
    77        - device: /dev/disk/azure/scsi1/lun0
    78          layout: true
    79          overwrite: false
    80          tableType: gpt
    81      files:
    82      - contentFrom:
    83          secret:
    84            key: control-plane-azure.json
    85            name: ${CLUSTER_NAME}-control-plane-azure-json
    86        owner: root:root
    87        path: /etc/kubernetes/azure.json
    88        permissions: "0644"
    89      initConfiguration:
    90        nodeRegistration:
    91          kubeletExtraArgs:
    92            cloud-provider: external
    93          name: '{{ ds.meta_data["local_hostname"] }}'
    94      joinConfiguration:
    95        nodeRegistration:
    96          kubeletExtraArgs:
    97            cloud-provider: external
    98          name: '{{ ds.meta_data["local_hostname"] }}'
    99      mounts:
   100      - - LABEL=etcd_disk
   101        - /var/lib/etcddisk
   102      postKubeadmCommands: []
   103      preKubeadmCommands: []
   104    machineTemplate:
   105      infrastructureRef:
   106        apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   107        kind: AzureMachineTemplate
   108        name: ${CLUSTER_NAME}-control-plane
   109    replicas: ${CONTROL_PLANE_MACHINE_COUNT:=1}
   110    version: ${KUBERNETES_VERSION}
   111  ---
   112  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   113  kind: AzureMachineTemplate
   114  metadata:
   115    name: ${CLUSTER_NAME}-control-plane
   116    namespace: default
   117  spec:
   118    template:
   119      spec:
   120        dataDisks:
   121        - diskSizeGB: 256
   122          lun: 0
   123          nameSuffix: etcddisk
   124        identity: UserAssigned
   125        osDisk:
   126          cachingType: ReadOnly
   127          diffDiskSettings:
   128            option: Local
   129          diskSizeGB: 50
   130          osType: Linux
   131        sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
   132        userAssignedIdentities:
   133        - providerID: /subscriptions/${AZURE_SUBSCRIPTION_ID}/resourceGroups/${CI_RG:=capz-ci}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/${USER_IDENTITY:=cloud-provider-user-identity}
   134        vmSize: ${AZURE_CONTROL_PLANE_MACHINE_TYPE}
   135  ---
   136  apiVersion: cluster.x-k8s.io/v1beta1
   137  kind: MachineDeployment
   138  metadata:
   139    name: ${CLUSTER_NAME}-md-0
   140    namespace: default
   141  spec:
   142    clusterName: ${CLUSTER_NAME}
   143    replicas: ${WORKER_MACHINE_COUNT:=2}
   144    selector:
   145      matchLabels: null
   146    template:
   147      spec:
   148        bootstrap:
   149          configRef:
   150            apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
   151            kind: KubeadmConfigTemplate
   152            name: ${CLUSTER_NAME}-md-0
   153        clusterName: ${CLUSTER_NAME}
   154        infrastructureRef:
   155          apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   156          kind: AzureMachineTemplate
   157          name: ${CLUSTER_NAME}-md-0
   158        version: ${KUBERNETES_VERSION}
   159  ---
   160  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   161  kind: AzureMachineTemplate
   162  metadata:
   163    name: ${CLUSTER_NAME}-md-0
   164    namespace: default
   165  spec:
   166    template:
   167      spec:
   168        osDisk:
   169          cachingType: ReadOnly
   170          diffDiskSettings:
   171            option: Local
   172          diskSizeGB: 50
   173          osType: Linux
   174        sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
   175        vmSize: ${AZURE_NODE_MACHINE_TYPE}
   176  ---
   177  apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
   178  kind: KubeadmConfigTemplate
   179  metadata:
   180    name: ${CLUSTER_NAME}-md-0
   181    namespace: default
   182  spec:
   183    template:
   184      spec:
   185        files:
   186        - contentFrom:
   187            secret:
   188              key: worker-node-azure.json
   189              name: ${CLUSTER_NAME}-md-0-azure-json
   190          owner: root:root
   191          path: /etc/kubernetes/azure.json
   192          permissions: "0644"
   193        joinConfiguration:
   194          nodeRegistration:
   195            kubeletExtraArgs:
   196              cloud-provider: external
   197            name: '{{ ds.meta_data["local_hostname"] }}'
   198        preKubeadmCommands: []
   199  ---
   200  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   201  kind: AzureClusterIdentity
   202  metadata:
   203    labels:
   204      clusterctl.cluster.x-k8s.io/move-hierarchy: "true"
   205    name: ${CLUSTER_IDENTITY_NAME}
   206    namespace: default
   207  spec:
   208    allowedNamespaces: {}
   209    clientID: ${AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY}
   210    tenantID: ${AZURE_TENANT_ID}
   211    type: ${CLUSTER_IDENTITY_TYPE:=WorkloadIdentity}