sigs.k8s.io/cluster-api-provider-azure@v1.17.0/templates/cluster-template-azure-bastion.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    bastionSpec:
    27      azureBastion: {}
    28    identityRef:
    29      apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    30      kind: AzureClusterIdentity
    31      name: ${CLUSTER_IDENTITY_NAME}
    32    location: ${AZURE_LOCATION}
    33    networkSpec:
    34      subnets:
    35      - name: control-plane-subnet
    36        role: control-plane
    37      - name: node-subnet
    38        role: node
    39      vnet:
    40        name: ${AZURE_VNET_NAME:=${CLUSTER_NAME}-vnet}
    41    resourceGroup: ${AZURE_RESOURCE_GROUP:=${CLUSTER_NAME}}
    42    subscriptionID: ${AZURE_SUBSCRIPTION_ID}
    43  ---
    44  apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    45  kind: KubeadmControlPlane
    46  metadata:
    47    name: ${CLUSTER_NAME}-control-plane
    48    namespace: default
    49  spec:
    50    kubeadmConfigSpec:
    51      clusterConfiguration:
    52        apiServer:
    53          extraArgs:
    54            cloud-provider: external
    55          timeoutForControlPlane: 20m
    56        controllerManager:
    57          extraArgs:
    58            allocate-node-cidrs: "false"
    59            cloud-provider: external
    60            cluster-name: ${CLUSTER_NAME}
    61        etcd:
    62          local:
    63            dataDir: /var/lib/etcddisk/etcd
    64            extraArgs:
    65              quota-backend-bytes: "8589934592"
    66      diskSetup:
    67        filesystems:
    68        - device: /dev/disk/azure/scsi1/lun0
    69          extraOpts:
    70          - -E
    71          - lazy_itable_init=1,lazy_journal_init=1
    72          filesystem: ext4
    73          label: etcd_disk
    74        - device: ephemeral0.1
    75          filesystem: ext4
    76          label: ephemeral0
    77          replaceFS: ntfs
    78        partitions:
    79        - device: /dev/disk/azure/scsi1/lun0
    80          layout: true
    81          overwrite: false
    82          tableType: gpt
    83      files:
    84      - contentFrom:
    85          secret:
    86            key: control-plane-azure.json
    87            name: ${CLUSTER_NAME}-control-plane-azure-json
    88        owner: root:root
    89        path: /etc/kubernetes/azure.json
    90        permissions: "0644"
    91      initConfiguration:
    92        nodeRegistration:
    93          kubeletExtraArgs:
    94            cloud-provider: external
    95          name: '{{ ds.meta_data["local_hostname"] }}'
    96      joinConfiguration:
    97        nodeRegistration:
    98          kubeletExtraArgs:
    99            cloud-provider: external
   100          name: '{{ ds.meta_data["local_hostname"] }}'
   101      mounts:
   102      - - LABEL=etcd_disk
   103        - /var/lib/etcddisk
   104      postKubeadmCommands: []
   105      preKubeadmCommands: []
   106    machineTemplate:
   107      infrastructureRef:
   108        apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   109        kind: AzureMachineTemplate
   110        name: ${CLUSTER_NAME}-control-plane
   111    replicas: ${CONTROL_PLANE_MACHINE_COUNT:=1}
   112    version: ${KUBERNETES_VERSION}
   113  ---
   114  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   115  kind: AzureMachineTemplate
   116  metadata:
   117    name: ${CLUSTER_NAME}-control-plane
   118    namespace: default
   119  spec:
   120    template:
   121      spec:
   122        dataDisks:
   123        - diskSizeGB: 256
   124          lun: 0
   125          nameSuffix: etcddisk
   126        identity: UserAssigned
   127        osDisk:
   128          diskSizeGB: 128
   129          osType: Linux
   130        sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
   131        userAssignedIdentities:
   132        - providerID: /subscriptions/${AZURE_SUBSCRIPTION_ID}/resourceGroups/${CI_RG:=capz-ci}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/${USER_IDENTITY:=cloud-provider-user-identity}
   133        vmSize: ${AZURE_CONTROL_PLANE_MACHINE_TYPE}
   134  ---
   135  apiVersion: cluster.x-k8s.io/v1beta1
   136  kind: MachineDeployment
   137  metadata:
   138    name: ${CLUSTER_NAME}-md-0
   139    namespace: default
   140  spec:
   141    clusterName: ${CLUSTER_NAME}
   142    replicas: ${WORKER_MACHINE_COUNT:=2}
   143    selector:
   144      matchLabels: null
   145    template:
   146      spec:
   147        bootstrap:
   148          configRef:
   149            apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
   150            kind: KubeadmConfigTemplate
   151            name: ${CLUSTER_NAME}-md-0
   152        clusterName: ${CLUSTER_NAME}
   153        infrastructureRef:
   154          apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   155          kind: AzureMachineTemplate
   156          name: ${CLUSTER_NAME}-md-0
   157        version: ${KUBERNETES_VERSION}
   158  ---
   159  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   160  kind: AzureMachineTemplate
   161  metadata:
   162    name: ${CLUSTER_NAME}-md-0
   163    namespace: default
   164  spec:
   165    template:
   166      spec:
   167        osDisk:
   168          diskSizeGB: 128
   169          osType: Linux
   170        sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
   171        vmSize: ${AZURE_NODE_MACHINE_TYPE}
   172  ---
   173  apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
   174  kind: KubeadmConfigTemplate
   175  metadata:
   176    name: ${CLUSTER_NAME}-md-0
   177    namespace: default
   178  spec:
   179    template:
   180      spec:
   181        files:
   182        - contentFrom:
   183            secret:
   184              key: worker-node-azure.json
   185              name: ${CLUSTER_NAME}-md-0-azure-json
   186          owner: root:root
   187          path: /etc/kubernetes/azure.json
   188          permissions: "0644"
   189        joinConfiguration:
   190          nodeRegistration:
   191            kubeletExtraArgs:
   192              cloud-provider: external
   193            name: '{{ ds.meta_data["local_hostname"] }}'
   194        preKubeadmCommands: []
   195  ---
   196  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   197  kind: AzureClusterIdentity
   198  metadata:
   199    labels:
   200      clusterctl.cluster.x-k8s.io/move-hierarchy: "true"
   201    name: ${CLUSTER_IDENTITY_NAME}
   202    namespace: default
   203  spec:
   204    allowedNamespaces: {}
   205    clientID: ${AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY}
   206    tenantID: ${AZURE_TENANT_ID}
   207    type: ${CLUSTER_IDENTITY_TYPE:=WorkloadIdentity}