From 6830bf3ed3f14a29800c9587c287b3c3769d5969 Mon Sep 17 00:00:00 2001 From: Matt McEuen Date: Fri, 18 Jun 2021 10:41:05 -0500 Subject: [PATCH] Add SIP scheduling labels to catalogues & SIP CR Adds labels used by ViNO & SIP to schedule subcluster VMs appropriately, for rack and undercloud server name. This also trues up the label definitions in the SIP CRs to match, and configures the Metal3Cluster resource to synchronize the labels from BMHs to Nodes. This change updates the airshipctl pin to incorporate related functionality: https://review.opendev.org/c/airship/airshipctl/+/797130 Change-Id: I6cf2bc653589d142736990cdfadf82641a6ca4d1 --- .../k8scontrol-vm-infra/kustomization.yaml | 8 ++++++++ .../k8scontrol-vm-infra/labelsync-setup.yaml | 5 +++++ .../target/catalogues/hosts.yaml | 19 +++++++++++++++++++ .../target/catalogues/hosts.yaml | 17 +++++++++++++++-- .../lma/provide-infra/sipcluster.yaml | 8 ++++---- .../wordpress/provide-infra/sipcluster.yaml | 8 ++++---- 6 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 manifests/function/k8scontrol-vm-infra/labelsync-setup.yaml diff --git a/manifests/function/k8scontrol-vm-infra/kustomization.yaml b/manifests/function/k8scontrol-vm-infra/kustomization.yaml index e9eef066e..453f707f0 100644 --- a/manifests/function/k8scontrol-vm-infra/kustomization.yaml +++ b/manifests/function/k8scontrol-vm-infra/kustomization.yaml @@ -11,3 +11,11 @@ patchesJson6902: kind: KubeadmControlPlane name: cluster-controlplane path: iptables-setup.yaml + +patchesJson6902: +- target: + group: infrastructure.cluster.x-k8s.io + version: v1alpha4 + kind: Metal3Cluster + name: target-cluster + path: labelsync-setup.yaml diff --git a/manifests/function/k8scontrol-vm-infra/labelsync-setup.yaml b/manifests/function/k8scontrol-vm-infra/labelsync-setup.yaml new file mode 100644 index 000000000..d7f7c791e --- /dev/null +++ b/manifests/function/k8scontrol-vm-infra/labelsync-setup.yaml @@ -0,0 +1,5 @@ +# This configures Metal3Cluster resources for label syncing +- op: add + path: "/metadata/annotations" + value: + metal3.io/metal3-label-sync-prefixes: "airshipit.org" diff --git a/manifests/site/reference-multi-tenant/target/catalogues/hosts.yaml b/manifests/site/reference-multi-tenant/target/catalogues/hosts.yaml index d9bae9e78..17eb597ba 100644 --- a/manifests/site/reference-multi-tenant/target/catalogues/hosts.yaml +++ b/manifests/site/reference-multi-tenant/target/catalogues/hosts.yaml @@ -25,6 +25,9 @@ hosts: storage-ipv4: 172.62.0.11 calico-ipv4: 172.64.0.11 hardwareProfile: default # defined in the hostgenerator-m3 function + labels: + airshipit.org/rack: r01 + airshipit.org/server: stl3r01s01 stl3r01s02: bootMode: legacy macAddress: E4:43:4B:EE:B0:43 @@ -38,6 +41,9 @@ hosts: storage-ipv4: 172.62.0.12 calico-ipv4: 172.64.0.12 hardwareProfile: default + labels: + airshipit.org/rack: r01 + airshipit.org/server: stl3r01s02 stl3r01s03: bootMode: legacy #macAddress: E4:43:4B:EE:D7:B8 @@ -52,6 +58,9 @@ hosts: storage-ipv4: 172.62.0.13 calico-ipv4: 172.64.0.13 hardwareProfile: default # defined in the hardwareprofile-example function + labels: + airshipit.org/rack: r01 + airshipit.org/server: stl3r01s03 stl3r01s04: bootMode: legacy #macAddress: E4:43:4B:EE:D7:B8 @@ -66,6 +75,9 @@ hosts: storage-ipv4: 172.62.0.14 calico-ipv4: 172.64.0.14 hardwareProfile: default # defined in the hardwareprofile-example function + labels: + airshipit.org/rack: r01 + airshipit.org/server: stl3r01s04 stl3r01s05: bootMode: legacy #macAddress: E4:43:4B:EE:D7:B8 @@ -80,6 +92,9 @@ hosts: storage-ipv4: 172.62.0.15 calico-ipv4: 172.64.0.15 hardwareProfile: default # defined in the hardwareprofile-example function + labels: + airshipit.org/rack: r01 + airshipit.org/server: stl3r01s05 stl3r01s06: bootMode: legacy #macAddress: E4:43:4B:EE:D7:B8 @@ -94,3 +109,7 @@ hosts: storage-ipv4: 172.62.0.16 calico-ipv4: 172.64.0.16 hardwareProfile: default # defined in the hardwareprofile-example function + labels: + airshipit.org/rack: r01 + airshipit.org/server: stl3r01s06 + diff --git a/manifests/site/virtual-network-cloud/target/catalogues/hosts.yaml b/manifests/site/virtual-network-cloud/target/catalogues/hosts.yaml index 9e2b2d98d..3c98d83a3 100644 --- a/manifests/site/virtual-network-cloud/target/catalogues/hosts.yaml +++ b/manifests/site/virtual-network-cloud/target/catalogues/hosts.yaml @@ -23,6 +23,9 @@ hosts: oam: 52:54:00:9b:27:4c pxe: 52:54:00:b6:ed:31 hardwareProfile: default # defined in the hostgenerator-m3 function + labels: + airshipit.org/rack: r01 + airshipit.org/server: node01 node02: bootMode: UEFI macAddress: 52:54:00:b6:ed:02 @@ -37,6 +40,9 @@ hosts: oam: 52:54:00:9b:27:02 pxe: 52:54:00:b6:ed:02 hardwareProfile: default + labels: + airshipit.org/rack: r01 + airshipit.org/server: node02 node03: bootMode: UEFI macAddress: 52:54:00:b6:ed:23 @@ -50,7 +56,10 @@ hosts: macAddresses: oam: 52:54:00:9b:27:07 pxe: 52:54:00:b6:ed:23 - hardwareProfile: default # defined in the hardwareprofile-example function + hardwareProfile: default + labels: + airshipit.org/rack: r01 + airshipit.org/server: node03 node04: bootMode: UEFI macAddress: 52:54:00:36:5e:e3 @@ -63,4 +72,8 @@ hosts: macAddresses: oam: 52:54:00:dc:ab:04 pxe: 52:54:00:51:0b:e4 - hardwareProfile: default # defined in the hardwareprofile-example function + hardwareProfile: default + labels: + airshipit.org/rack: r01 + airshipit.org/server: node04 + diff --git a/manifests/type/multi-tenant/sub-clusters/lma/provide-infra/sipcluster.yaml b/manifests/type/multi-tenant/sub-clusters/lma/provide-infra/sipcluster.yaml index 76d166522..32f667e70 100644 --- a/manifests/type/multi-tenant/sub-clusters/lma/provide-infra/sipcluster.yaml +++ b/manifests/type/multi-tenant/sub-clusters/lma/provide-infra/sipcluster.yaml @@ -9,16 +9,16 @@ spec: ControlPlane: labelSelector: matchLabels: - vino.airshipit.org/flavor: control-plane - topologyKey: vino.airshipit.org/rack + airshipit.org/flavor: control-plane + topologyKey: airshipit.org/rack count: active: 1 standby: 1 Worker: labelSelector: matchLabels: - vino.airshipit.org/flavor: worker - topologyKey: vino.airshipit.org/host + airshipit.org/flavor: worker + topologyKey: airshipit.org/server count: active: 2 standby: 1 # Slew for upgrades diff --git a/manifests/type/multi-tenant/sub-clusters/wordpress/provide-infra/sipcluster.yaml b/manifests/type/multi-tenant/sub-clusters/wordpress/provide-infra/sipcluster.yaml index b7d06a18f..d321fd92f 100644 --- a/manifests/type/multi-tenant/sub-clusters/wordpress/provide-infra/sipcluster.yaml +++ b/manifests/type/multi-tenant/sub-clusters/wordpress/provide-infra/sipcluster.yaml @@ -9,16 +9,16 @@ spec: ControlPlane: labelSelector: matchLabels: - vino.airshipit.org/flavor: control-plane - topologyKey: vino.airshipit.org/rack + airshipit.org/flavor: control-plane + topologyKey: airshipit.org/rack count: active: 1 standby: 1 Worker: labelSelector: matchLabels: - vino.airshipit.org/flavor: worker - topologyKey: vino.airshipit.org/host + airshipit.org/flavor: worker + topologyKey: airshipit.org/server count: active: 2 standby: 1 # Slew for upgrades