sigs.k8s.io/cluster-api-provider-azure@v1.14.3/templates/cluster-template-machinepool-windows.yaml (about) 1 apiVersion: cluster.x-k8s.io/v1beta1 2 kind: Cluster 3 metadata: 4 labels: 5 cni-windows: calico 6 csi-proxy: enabled 7 windows: enabled 8 name: ${CLUSTER_NAME} 9 namespace: default 10 spec: 11 clusterNetwork: 12 pods: 13 cidrBlocks: 14 - 192.168.0.0/16 15 controlPlaneRef: 16 apiVersion: controlplane.cluster.x-k8s.io/v1beta1 17 kind: KubeadmControlPlane 18 name: ${CLUSTER_NAME}-control-plane 19 infrastructureRef: 20 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 21 kind: AzureCluster 22 name: ${CLUSTER_NAME} 23 --- 24 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 25 kind: AzureCluster 26 metadata: 27 name: ${CLUSTER_NAME} 28 namespace: default 29 spec: 30 identityRef: 31 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 32 kind: AzureClusterIdentity 33 name: ${CLUSTER_IDENTITY_NAME} 34 location: ${AZURE_LOCATION} 35 networkSpec: 36 subnets: 37 - name: control-plane-subnet 38 role: control-plane 39 - name: node-subnet 40 role: node 41 vnet: 42 name: ${AZURE_VNET_NAME:=${CLUSTER_NAME}-vnet} 43 resourceGroup: ${AZURE_RESOURCE_GROUP:=${CLUSTER_NAME}} 44 subscriptionID: ${AZURE_SUBSCRIPTION_ID} 45 --- 46 apiVersion: controlplane.cluster.x-k8s.io/v1beta1 47 kind: KubeadmControlPlane 48 metadata: 49 name: ${CLUSTER_NAME}-control-plane 50 namespace: default 51 spec: 52 kubeadmConfigSpec: 53 clusterConfiguration: 54 apiServer: 55 extraArgs: 56 cloud-provider: external 57 timeoutForControlPlane: 20m 58 controllerManager: 59 extraArgs: 60 allocate-node-cidrs: "false" 61 cloud-provider: external 62 cluster-name: ${CLUSTER_NAME} 63 etcd: 64 local: 65 dataDir: /var/lib/etcddisk/etcd 66 extraArgs: 67 quota-backend-bytes: "8589934592" 68 diskSetup: 69 filesystems: 70 - device: /dev/disk/azure/scsi1/lun0 71 extraOpts: 72 - -E 73 - lazy_itable_init=1,lazy_journal_init=1 74 filesystem: ext4 75 label: etcd_disk 76 - device: ephemeral0.1 77 filesystem: ext4 78 label: ephemeral0 79 replaceFS: ntfs 80 partitions: 81 - device: /dev/disk/azure/scsi1/lun0 82 layout: true 83 overwrite: false 84 tableType: gpt 85 files: 86 - contentFrom: 87 secret: 88 key: control-plane-azure.json 89 name: ${CLUSTER_NAME}-control-plane-azure-json 90 owner: root:root 91 path: /etc/kubernetes/azure.json 92 permissions: "0644" 93 initConfiguration: 94 nodeRegistration: 95 kubeletExtraArgs: 96 cloud-provider: external 97 name: '{{ ds.meta_data["local_hostname"] }}' 98 joinConfiguration: 99 nodeRegistration: 100 kubeletExtraArgs: 101 cloud-provider: external 102 name: '{{ ds.meta_data["local_hostname"] }}' 103 mounts: 104 - - LABEL=etcd_disk 105 - /var/lib/etcddisk 106 postKubeadmCommands: [] 107 preKubeadmCommands: [] 108 machineTemplate: 109 infrastructureRef: 110 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 111 kind: AzureMachineTemplate 112 name: ${CLUSTER_NAME}-control-plane 113 replicas: ${CONTROL_PLANE_MACHINE_COUNT:=1} 114 version: ${KUBERNETES_VERSION} 115 --- 116 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 117 kind: AzureMachineTemplate 118 metadata: 119 name: ${CLUSTER_NAME}-control-plane 120 namespace: default 121 spec: 122 template: 123 spec: 124 dataDisks: 125 - diskSizeGB: 256 126 lun: 0 127 nameSuffix: etcddisk 128 osDisk: 129 diskSizeGB: 128 130 osType: Linux 131 sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""} 132 vmSize: ${AZURE_CONTROL_PLANE_MACHINE_TYPE} 133 --- 134 apiVersion: cluster.x-k8s.io/v1beta1 135 kind: MachinePool 136 metadata: 137 name: ${CLUSTER_NAME}-mp-0 138 namespace: default 139 spec: 140 clusterName: ${CLUSTER_NAME} 141 replicas: ${WORKER_MACHINE_COUNT:=2} 142 template: 143 spec: 144 bootstrap: 145 configRef: 146 apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 147 kind: KubeadmConfig 148 name: ${CLUSTER_NAME}-mp-0 149 clusterName: ${CLUSTER_NAME} 150 infrastructureRef: 151 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 152 kind: AzureMachinePool 153 name: ${CLUSTER_NAME}-mp-0 154 version: ${KUBERNETES_VERSION} 155 --- 156 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 157 kind: AzureMachinePool 158 metadata: 159 name: ${CLUSTER_NAME}-mp-0 160 namespace: default 161 spec: 162 location: ${AZURE_LOCATION} 163 strategy: 164 rollingUpdate: 165 deletePolicy: Oldest 166 maxSurge: 25% 167 maxUnavailable: 1 168 type: RollingUpdate 169 template: 170 osDisk: 171 diskSizeGB: 30 172 managedDisk: 173 storageAccountType: Premium_LRS 174 osType: Linux 175 sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""} 176 vmSize: ${AZURE_NODE_MACHINE_TYPE} 177 --- 178 apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 179 kind: KubeadmConfig 180 metadata: 181 name: ${CLUSTER_NAME}-mp-0 182 namespace: default 183 spec: 184 files: 185 - contentFrom: 186 secret: 187 key: worker-node-azure.json 188 name: ${CLUSTER_NAME}-mp-0-azure-json 189 owner: root:root 190 path: /etc/kubernetes/azure.json 191 permissions: "0644" 192 joinConfiguration: 193 nodeRegistration: 194 kubeletExtraArgs: 195 cloud-provider: external 196 name: '{{ ds.meta_data["local_hostname"] }}' 197 --- 198 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 199 kind: AzureClusterIdentity 200 metadata: 201 labels: 202 clusterctl.cluster.x-k8s.io/move-hierarchy: "true" 203 name: ${CLUSTER_IDENTITY_NAME} 204 namespace: default 205 spec: 206 allowedNamespaces: {} 207 clientID: ${AZURE_CLIENT_ID} 208 clientSecret: 209 name: ${AZURE_CLUSTER_IDENTITY_SECRET_NAME} 210 namespace: ${AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE} 211 tenantID: ${AZURE_TENANT_ID} 212 type: ServicePrincipal 213 --- 214 apiVersion: cluster.x-k8s.io/v1beta1 215 kind: MachinePool 216 metadata: 217 name: ${CLUSTER_NAME}-mp-win 218 namespace: default 219 spec: 220 clusterName: ${CLUSTER_NAME} 221 replicas: ${WORKER_MACHINE_COUNT:=2} 222 template: 223 spec: 224 bootstrap: 225 configRef: 226 apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 227 kind: KubeadmConfig 228 name: ${CLUSTER_NAME}-mp-win 229 clusterName: ${CLUSTER_NAME} 230 infrastructureRef: 231 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 232 kind: AzureMachinePool 233 name: ${CLUSTER_NAME}-mp-win 234 version: ${KUBERNETES_VERSION} 235 --- 236 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 237 kind: AzureMachinePool 238 metadata: 239 annotations: 240 runtime: containerd 241 windowsServerVersion: ${WINDOWS_SERVER_VERSION:=""} 242 name: ${CLUSTER_NAME}-mp-win 243 namespace: default 244 spec: 245 location: ${AZURE_LOCATION} 246 template: 247 osDisk: 248 diskSizeGB: 128 249 managedDisk: 250 storageAccountType: Premium_LRS 251 osType: Windows 252 sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""} 253 vmSize: ${AZURE_NODE_MACHINE_TYPE} 254 --- 255 apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 256 kind: KubeadmConfig 257 metadata: 258 name: ${CLUSTER_NAME}-mp-win 259 namespace: default 260 spec: 261 files: 262 - contentFrom: 263 secret: 264 key: worker-node-azure.json 265 name: ${CLUSTER_NAME}-mp-win-azure-json 266 owner: root:root 267 path: c:/k/azure.json 268 permissions: "0644" 269 - content: Add-MpPreference -ExclusionProcess C:/opt/cni/bin/calico.exe 270 path: C:/defender-exclude-calico.ps1 271 permissions: "0744" 272 joinConfiguration: 273 nodeRegistration: 274 criSocket: npipe:////./pipe/containerd-containerd 275 kubeletExtraArgs: 276 cloud-provider: external 277 pod-infra-container-image: mcr.microsoft.com/oss/kubernetes/pause:3.9 278 name: '{{ ds.meta_data["local_hostname"] }}' 279 postKubeadmCommands: 280 - nssm set kubelet start SERVICE_AUTO_START 281 - powershell C:/defender-exclude-calico.ps1 282 preKubeadmCommands: 283 - powershell c:/create-external-network.ps1 284 users: 285 - groups: Administrators 286 name: capi 287 sshAuthorizedKeys: 288 - ${AZURE_SSH_PUBLIC_KEY:=""}