From b0eef10ca9aa4c335a630be02190a61758583d11 Mon Sep 17 00:00:00 2001 From: Sidney Shiba Date: Tue, 17 Nov 2020 17:02:31 -0600 Subject: [PATCH] Azure provider integration - Phase Run support This patch set includes the site specifig for Azure (az-test-site) that contains the manifests and kustomization files needed to deploy a Workload cluster on the Azure cloud platform. This patch set uses the Azure CAPZ v0.4.9 for the Workload cluster deployment. Change-Id: Ie71630bf55edadfcc11527c04aea41aa2161bdbd --- .../ephemeral/controlplane/cluster.json | 6 +++++ .../ephemeral/controlplane/kustomization.yaml | 24 +++++++++++++++++++ .../ephemeral/controlplane/machine_count.json | 3 +++ .../controlplane/machine_template.json | 4 ++++ .../phases/infrastructure-providers.json | 18 ++++++++++++++ .../az-test-site/phases/kustomization.yaml | 11 +++++++++ manifests/site/az-test-site/phases/plan.yaml | 19 +++++++++++++++ .../target/initinfra/kustomization.yaml | 4 +++- .../target/workers/kustomization.yaml | 18 ++++++++++++++ .../target/workers/machine_count.json | 3 +++ .../target/workers/machine_template.json | 5 ++++ 11 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 manifests/site/az-test-site/ephemeral/controlplane/cluster.json create mode 100644 manifests/site/az-test-site/ephemeral/controlplane/kustomization.yaml create mode 100644 manifests/site/az-test-site/ephemeral/controlplane/machine_count.json create mode 100644 manifests/site/az-test-site/ephemeral/controlplane/machine_template.json create mode 100644 manifests/site/az-test-site/phases/infrastructure-providers.json create mode 100644 manifests/site/az-test-site/phases/kustomization.yaml create mode 100644 manifests/site/az-test-site/phases/plan.yaml create mode 100644 manifests/site/az-test-site/target/workers/kustomization.yaml create mode 100644 manifests/site/az-test-site/target/workers/machine_count.json create mode 100644 manifests/site/az-test-site/target/workers/machine_template.json diff --git a/manifests/site/az-test-site/ephemeral/controlplane/cluster.json b/manifests/site/az-test-site/ephemeral/controlplane/cluster.json new file mode 100644 index 000000000..0b32c7d96 --- /dev/null +++ b/manifests/site/az-test-site/ephemeral/controlplane/cluster.json @@ -0,0 +1,6 @@ +[ + { "op": "replace","path": "/spec/subscriptionID","value": "cb3e23d3-b697-4c4f-a1a7-529e308691e4" }, + { "op": "replace","path": "/spec/resourceGroup","value": "azure-target" }, + { "op": "replace","path": "/spec/networkSpec/vnet/name","value": "azure-target-vnet" }, + { "op": "replace","path": "/spec/location","value": "centralus" } +] diff --git a/manifests/site/az-test-site/ephemeral/controlplane/kustomization.yaml b/manifests/site/az-test-site/ephemeral/controlplane/kustomization.yaml new file mode 100644 index 000000000..ef7f2e073 --- /dev/null +++ b/manifests/site/az-test-site/ephemeral/controlplane/kustomization.yaml @@ -0,0 +1,24 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../../../function/k8scontrol-capz/v0.4.9 + +patchesJson6902: + - target: + group: controlplane.cluster.x-k8s.io + version: v1alpha3 + kind: KubeadmControlPlane + name: "target-cluster-control-plane" + path: machine_count.json + - target: + group: infrastructure.cluster.x-k8s.io + version: v1alpha3 + kind: AzureCluster + name: "target-cluster" + path: cluster.json + - target: + group: infrastructure.cluster.x-k8s.io + version: v1alpha3 + kind: AzureMachineTemplate + name: "target-cluster-control-plane" + path: machine_template.json diff --git a/manifests/site/az-test-site/ephemeral/controlplane/machine_count.json b/manifests/site/az-test-site/ephemeral/controlplane/machine_count.json new file mode 100644 index 000000000..3c60b971d --- /dev/null +++ b/manifests/site/az-test-site/ephemeral/controlplane/machine_count.json @@ -0,0 +1,3 @@ +[ + { "op": "replace","path": "/spec/replicas","value": 1 } +] diff --git a/manifests/site/az-test-site/ephemeral/controlplane/machine_template.json b/manifests/site/az-test-site/ephemeral/controlplane/machine_template.json new file mode 100644 index 000000000..4b4ecd969 --- /dev/null +++ b/manifests/site/az-test-site/ephemeral/controlplane/machine_template.json @@ -0,0 +1,4 @@ +[ + { "op": "replace","path": "/spec/template/spec/location","value": "centralus" }, + { "op": "replace","path": "/spec/template/spec/vmSize","value": "Standard_D2s_v3" } +] diff --git a/manifests/site/az-test-site/phases/infrastructure-providers.json b/manifests/site/az-test-site/phases/infrastructure-providers.json new file mode 100644 index 000000000..473cda092 --- /dev/null +++ b/manifests/site/az-test-site/phases/infrastructure-providers.json @@ -0,0 +1,18 @@ +[{ + "op": "replace", + "path": "/init-options/infrastructure-providers", + "value": ["azure:v0.4.9"] + }, + { + "op": "replace", + "path": "/providers/0", + "value": { + "name": "azure", + "type": "InfrastructureProvider", + "variable-substitution": true, + "versions": { + "v0.4.9": "airshipctl/manifests/function/capz/v0.4.9" + } + } + } +] diff --git a/manifests/site/az-test-site/phases/kustomization.yaml b/manifests/site/az-test-site/phases/kustomization.yaml new file mode 100644 index 000000000..3890dab2c --- /dev/null +++ b/manifests/site/az-test-site/phases/kustomization.yaml @@ -0,0 +1,11 @@ +resources: + - ../../../phases +patchesStrategicMerge: + - plan.yaml +patchesJson6902: + - target: + group: airshipit.org + version: v1alpha1 + kind: Clusterctl + name: "clusterctl_init" + path: infrastructure-providers.json diff --git a/manifests/site/az-test-site/phases/plan.yaml b/manifests/site/az-test-site/phases/plan.yaml new file mode 100644 index 000000000..d10c7d1c9 --- /dev/null +++ b/manifests/site/az-test-site/phases/plan.yaml @@ -0,0 +1,19 @@ +apiVersion: airshipit.org/v1alpha1 +kind: PhasePlan +metadata: + name: phasePlan +phaseGroups: + - name: group1 + phases: + - name: clusterctl-init-ephemeral + - name: controlplane-ephemeral + - name: initinfra-target + - name: clusterctl-init-target + - name: clusterctl-move + - name: workers-target +--- +apiVersion: airshipit.org/v1alpha1 +kind: Clusterctl +metadata: + name: clusterctl_init +env-vars: true diff --git a/manifests/site/az-test-site/target/initinfra/kustomization.yaml b/manifests/site/az-test-site/target/initinfra/kustomization.yaml index c2942afaa..f3efc573e 100755 --- a/manifests/site/az-test-site/target/initinfra/kustomization.yaml +++ b/manifests/site/az-test-site/target/initinfra/kustomization.yaml @@ -1,4 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization resources: - - ../../shared/clusterctl + - ../../../../function/cni/calico-capz commonLabels: airshipit.org/stage: initinfra diff --git a/manifests/site/az-test-site/target/workers/kustomization.yaml b/manifests/site/az-test-site/target/workers/kustomization.yaml new file mode 100644 index 000000000..01ba2e87c --- /dev/null +++ b/manifests/site/az-test-site/target/workers/kustomization.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../../../function/workers-capz/v0.4.9 + +patchesJson6902: + - target: + group: cluster.x-k8s.io + version: v1alpha3 + kind: MachineDeployment + name: target-cluster-md-0 + path: machine_count.json + - target: + group: infrastructure.cluster.x-k8s.io + version: v1alpha3 + kind: AzureMachineTemplate + name: target-cluster-md-0 + path: machine_template.json diff --git a/manifests/site/az-test-site/target/workers/machine_count.json b/manifests/site/az-test-site/target/workers/machine_count.json new file mode 100644 index 000000000..b40c0da81 --- /dev/null +++ b/manifests/site/az-test-site/target/workers/machine_count.json @@ -0,0 +1,3 @@ +[ + { "op": "replace","path": "/spec/replicas","value": 3 } +] diff --git a/manifests/site/az-test-site/target/workers/machine_template.json b/manifests/site/az-test-site/target/workers/machine_template.json new file mode 100644 index 000000000..b5059316f --- /dev/null +++ b/manifests/site/az-test-site/target/workers/machine_template.json @@ -0,0 +1,5 @@ +[ + { "op": "replace","path": "/spec/template/spec/location","value": "centralus" }, + { "op": "replace","path": "/spec/template/spec/vmSize","value": "Standard_B2s" }, + { "op": "add", "path": "/spec/template/spec/dataDisks", "value": [{"diskSizeGB": 256, "lun": 0, "nameSuffix": "datadisk"}]} +]