From 14e01c9b70c2334c7bc438dd471ce0a1adb709d6 Mon Sep 17 00:00:00 2001 From: Sidney Shiba Date: Tue, 17 Nov 2020 16:28:03 -0600 Subject: [PATCH] Azure provider integration - K8S-Control & Workers This patch set includes the manifest templates for the Workload cluster deployment for CAPZ v0.4.9. Also, added the new folder manifest/function/workers-capz and moved the manifests for v0.4.8 under it, as well as for v0.4.9 Change-Id: Ie08b6e7092f90ac8ee533c574a26eaf9b6600c5c --- .../k8scontrol-capz/v0.4.8/kustomization.yaml | 1 - .../k8scontrol-capz/v0.4.9/cluster.yaml | 33 ++++++ .../k8scontrol-capz/v0.4.9/controlplane.yaml | 101 ++++++++++++++++++ .../k8scontrol-capz/v0.4.9/kustomization.yaml | 3 + .../workers-capz/v0.4.8/kustomization.yaml | 2 + .../v0.4.8/workers.yaml | 18 ++-- .../workers-capz/v0.4.9/kustomization.yaml | 2 + .../function/workers-capz/v0.4.9/workers.yaml | 65 +++++++++++ 8 files changed, 215 insertions(+), 10 deletions(-) create mode 100644 manifests/function/k8scontrol-capz/v0.4.9/cluster.yaml create mode 100644 manifests/function/k8scontrol-capz/v0.4.9/controlplane.yaml create mode 100644 manifests/function/k8scontrol-capz/v0.4.9/kustomization.yaml create mode 100644 manifests/function/workers-capz/v0.4.8/kustomization.yaml rename manifests/function/{k8scontrol-capz => workers-capz}/v0.4.8/workers.yaml (78%) create mode 100644 manifests/function/workers-capz/v0.4.9/kustomization.yaml create mode 100644 manifests/function/workers-capz/v0.4.9/workers.yaml diff --git a/manifests/function/k8scontrol-capz/v0.4.8/kustomization.yaml b/manifests/function/k8scontrol-capz/v0.4.8/kustomization.yaml index 4d401ba8a..4e7ac45f5 100644 --- a/manifests/function/k8scontrol-capz/v0.4.8/kustomization.yaml +++ b/manifests/function/k8scontrol-capz/v0.4.8/kustomization.yaml @@ -1,4 +1,3 @@ resources: - cluster.yaml - controlplane.yaml - - workers.yaml diff --git a/manifests/function/k8scontrol-capz/v0.4.9/cluster.yaml b/manifests/function/k8scontrol-capz/v0.4.9/cluster.yaml new file mode 100644 index 000000000..567a286cc --- /dev/null +++ b/manifests/function/k8scontrol-capz/v0.4.9/cluster.yaml @@ -0,0 +1,33 @@ +apiVersion: cluster.x-k8s.io/v1alpha3 +kind: Cluster +metadata: + labels: + cni: calico + name: target-cluster + namespace: default +spec: + clusterNetwork: + pods: + cidrBlocks: + - 192.168.0.0/16 + controlPlaneRef: + apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 + kind: KubeadmControlPlane + name: target-cluster-control-plane + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 + kind: AzureCluster + name: target-cluster +--- +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 +kind: AzureCluster +metadata: + name: target-cluster + namespace: default +spec: + location: eastus + networkSpec: + vnet: + name: azure-workload-vnet + resourceGroup: azure-workload + subscriptionID: cb3e23d3-b697-4c4f-a1a7-529e308691e4 diff --git a/manifests/function/k8scontrol-capz/v0.4.9/controlplane.yaml b/manifests/function/k8scontrol-capz/v0.4.9/controlplane.yaml new file mode 100644 index 000000000..091c5e9d9 --- /dev/null +++ b/manifests/function/k8scontrol-capz/v0.4.9/controlplane.yaml @@ -0,0 +1,101 @@ +--- +apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 +kind: KubeadmControlPlane +metadata: + name: target-cluster-control-plane + namespace: default +spec: + infrastructureTemplate: + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 + kind: AzureMachineTemplate + name: target-cluster-control-plane + kubeadmConfigSpec: + clusterConfiguration: + apiServer: + extraArgs: + cloud-config: /etc/kubernetes/azure.json + cloud-provider: azure + extraVolumes: + - hostPath: /etc/kubernetes/azure.json + mountPath: /etc/kubernetes/azure.json + name: cloud-config + readOnly: true + timeoutForControlPlane: 20m + controllerManager: + extraArgs: + allocate-node-cidrs: "false" + cloud-config: /etc/kubernetes/azure.json + cloud-provider: azure + cluster-name: target-cluster + extraVolumes: + - hostPath: /etc/kubernetes/azure.json + mountPath: /etc/kubernetes/azure.json + name: cloud-config + readOnly: true + etcd: + local: + dataDir: /var/lib/etcddisk/etcd + diskSetup: + filesystems: + - device: /dev/disk/azure/scsi1/lun0 + extraOpts: + - -E + - lazy_itable_init=1,lazy_journal_init=1 + filesystem: ext4 + label: etcd_disk + - device: ephemeral0.1 + filesystem: ext4 + label: ephemeral0 + replaceFS: ntfs + partitions: + - device: /dev/disk/azure/scsi1/lun0 + layout: true + overwrite: false + tableType: gpt + files: + - contentFrom: + secret: + key: control-plane-azure.json + name: target-cluster-control-plane-azure-json + owner: root:root + path: /etc/kubernetes/azure.json + permissions: "0644" + initConfiguration: + nodeRegistration: + kubeletExtraArgs: + cloud-config: /etc/kubernetes/azure.json + cloud-provider: azure + name: '{{ ds.meta_data["local_hostname"] }}' + joinConfiguration: + nodeRegistration: + kubeletExtraArgs: + cloud-config: /etc/kubernetes/azure.json + cloud-provider: azure + name: '{{ ds.meta_data["local_hostname"] }}' + mounts: + - - LABEL=etcd_disk + - /var/lib/etcddisk + useExperimentalRetryJoin: true + replicas: 1 + version: v1.18.10 +--- +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 +kind: AzureMachineTemplate +metadata: + name: target-cluster-control-plane + namespace: default +spec: + template: + spec: + dataDisks: + - diskSizeGB: 256 + lun: 0 + nameSuffix: etcddisk + location: eastus + osDisk: + diskSizeGB: 128 + managedDisk: + storageAccountType: Premium_LRS + osType: Linux + sshPublicKey: "" + vmSize: Standard_D2s_v3 diff --git a/manifests/function/k8scontrol-capz/v0.4.9/kustomization.yaml b/manifests/function/k8scontrol-capz/v0.4.9/kustomization.yaml new file mode 100644 index 000000000..4e7ac45f5 --- /dev/null +++ b/manifests/function/k8scontrol-capz/v0.4.9/kustomization.yaml @@ -0,0 +1,3 @@ +resources: + - cluster.yaml + - controlplane.yaml diff --git a/manifests/function/workers-capz/v0.4.8/kustomization.yaml b/manifests/function/workers-capz/v0.4.8/kustomization.yaml new file mode 100644 index 000000000..0bb101fd6 --- /dev/null +++ b/manifests/function/workers-capz/v0.4.8/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - workers.yaml diff --git a/manifests/function/k8scontrol-capz/v0.4.8/workers.yaml b/manifests/function/workers-capz/v0.4.8/workers.yaml similarity index 78% rename from manifests/function/k8scontrol-capz/v0.4.8/workers.yaml rename to manifests/function/workers-capz/v0.4.8/workers.yaml index 8feaed9e5..7af91b5ad 100644 --- a/manifests/function/k8scontrol-capz/v0.4.8/workers.yaml +++ b/manifests/function/workers-capz/v0.4.8/workers.yaml @@ -1,10 +1,10 @@ apiVersion: cluster.x-k8s.io/v1alpha3 kind: MachineDeployment metadata: - name: az-workload-cluster-md-0 + name: target-cluster-md-0 namespace: default spec: - clusterName: az-workload-cluster + clusterName: target-cluster replicas: 3 selector: matchLabels: null @@ -14,18 +14,18 @@ spec: configRef: apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 kind: KubeadmConfigTemplate - name: az-workload-cluster-md-0 - clusterName: az-workload-cluster + name: target-cluster-md-0 + clusterName: target-cluster infrastructureRef: apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AzureMachineTemplate - name: az-workload-cluster-md-0 - version: v1.18.2 + name: target-cluster-md-0 + version: v1.18.6 --- apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AzureMachineTemplate metadata: - name: az-workload-cluster-md-0 + name: target-cluster-md-0 namespace: default spec: template: @@ -42,7 +42,7 @@ spec: apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 kind: KubeadmConfigTemplate metadata: - name: az-workload-cluster-md-0 + name: target-cluster-md-0 namespace: default spec: template: @@ -51,7 +51,7 @@ spec: - contentFrom: secret: key: azure.json - name: az-workload-cluster-md-0-azure-json + name: target-cluster-md-0-azure-json owner: root:root path: /etc/kubernetes/azure.json permissions: "0644" diff --git a/manifests/function/workers-capz/v0.4.9/kustomization.yaml b/manifests/function/workers-capz/v0.4.9/kustomization.yaml new file mode 100644 index 000000000..0bb101fd6 --- /dev/null +++ b/manifests/function/workers-capz/v0.4.9/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - workers.yaml diff --git a/manifests/function/workers-capz/v0.4.9/workers.yaml b/manifests/function/workers-capz/v0.4.9/workers.yaml new file mode 100644 index 000000000..d69ff6f03 --- /dev/null +++ b/manifests/function/workers-capz/v0.4.9/workers.yaml @@ -0,0 +1,65 @@ +--- +apiVersion: cluster.x-k8s.io/v1alpha3 +kind: MachineDeployment +metadata: + name: target-cluster-md-0 + namespace: default +spec: + clusterName: target-cluster + replicas: 3 + selector: + matchLabels: null + template: + spec: + bootstrap: + configRef: + apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 + kind: KubeadmConfigTemplate + name: target-cluster-md-0 + clusterName: target-cluster + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 + kind: AzureMachineTemplate + name: target-cluster-md-0 + version: v1.18.10 +--- +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 +kind: AzureMachineTemplate +metadata: + name: target-cluster-md-0 + namespace: default +spec: + template: + spec: + location: eastus + osDisk: + diskSizeGB: 128 + managedDisk: + storageAccountType: Premium_LRS + osType: Linux + sshPublicKey: "" + vmSize: Standard_D2s_v3 +--- +apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 +kind: KubeadmConfigTemplate +metadata: + name: target-cluster-md-0 + namespace: default +spec: + template: + spec: + files: + - contentFrom: + secret: + key: worker-node-azure.json + name: target-cluster-md-0-azure-json + owner: root:root + path: /etc/kubernetes/azure.json + permissions: "0644" + joinConfiguration: + nodeRegistration: + kubeletExtraArgs: + cloud-config: /etc/kubernetes/azure.json + cloud-provider: azure + name: '{{ ds.meta_data["local_hostname"] }}' + useExperimentalRetryJoin: true