From 25a9b1525fa1bb51254279fa284ba7a7f0d08e34 Mon Sep 17 00:00:00 2001 From: "siraj.yasin" Date: Fri, 5 Feb 2021 20:41:47 +0000 Subject: [PATCH] Aligning inventory changes with airshipctl * Updated all inventory in metadata.yaml * Updated the changes for baremetal manager executor Change-Id: I9a1ebb1da8bbd4cb7b40000a7d50f31625d42b6d --- .../hostgenerator/host-generation.yaml | 14 ++++++++ .../hostgenerator/kustomization.yaml | 10 ++++++ .../hostgenerator/patchesstrategicmerge.yaml | 35 +++++++++++++++++++ .../host-inventory/kustomization.yaml | 5 +++ manifests/site/test-site/metadata.yaml | 3 ++ .../site/test-site/phases/kustomization.yaml | 3 ++ .../site/test-site/phases/phase-patch.yaml | 10 ++++++ .../test-site/target/catalogues/hosts.yaml | 15 +++++++- 8 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 manifests/site/test-site/host-inventory/hostgenerator/host-generation.yaml create mode 100644 manifests/site/test-site/host-inventory/hostgenerator/kustomization.yaml create mode 100644 manifests/site/test-site/host-inventory/hostgenerator/patchesstrategicmerge.yaml create mode 100644 manifests/site/test-site/host-inventory/kustomization.yaml create mode 100644 manifests/site/test-site/phases/phase-patch.yaml diff --git a/manifests/site/test-site/host-inventory/hostgenerator/host-generation.yaml b/manifests/site/test-site/host-inventory/hostgenerator/host-generation.yaml new file mode 100644 index 000000000..c2b762af4 --- /dev/null +++ b/manifests/site/test-site/host-inventory/hostgenerator/host-generation.yaml @@ -0,0 +1,14 @@ +# Site-level, phase-specific lists of hosts to generate +# This is used by the hostgenerator-m3 function to narrow down the site-level +# host-catalogue to just the hosts needed for a particular phase. +apiVersion: airshipit.org/v1alpha1 +kind: VariableCatalogue +metadata: + name: host-generation-catalogue +hosts: + m3: + # Note: this list should be kept up to date with + # the full list of hosts in the cluster + - node01 + - node02 + - node03 diff --git a/manifests/site/test-site/host-inventory/hostgenerator/kustomization.yaml b/manifests/site/test-site/host-inventory/hostgenerator/kustomization.yaml new file mode 100644 index 000000000..5cfebbcba --- /dev/null +++ b/manifests/site/test-site/host-inventory/hostgenerator/kustomization.yaml @@ -0,0 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../../../../../airshipctl/manifests/function/hostgenerator-m3/ + - ../../target/catalogues + - host-generation.yaml + +transformers: + - ../../../../../../airshipctl/manifests/function/hostgenerator-m3/replacements + - patchesstrategicmerge.yaml diff --git a/manifests/site/test-site/host-inventory/hostgenerator/patchesstrategicmerge.yaml b/manifests/site/test-site/host-inventory/hostgenerator/patchesstrategicmerge.yaml new file mode 100644 index 000000000..561cbc571 --- /dev/null +++ b/manifests/site/test-site/host-inventory/hostgenerator/patchesstrategicmerge.yaml @@ -0,0 +1,35 @@ +apiVersion: builtin +kind: PatchStrategicMergeTransformer +metadata: + name: smp +patches: |- + --- + apiVersion: airshipit.org/v1alpha1 + kind: VariableCatalogue + metadata: + name: host-catalogue + $patch: delete + --- + apiVersion: airshipit.org/v1alpha1 + kind: VariableCatalogue + metadata: + name: host-generation-catalogue + $patch: delete + --- + apiVersion: airshipit.org/v1alpha1 + kind: VariableCatalogue + metadata: + name: networking + $patch: delete + --- + apiVersion: airshipit.org/v1alpha1 + kind: VariableCatalogue + metadata: + name: env-vars-catalogue + $patch: delete + --- + apiVersion: airshipit.org/v1alpha1 + kind: VariableCatalogue + metadata: + name: versions-airshipctl + $patch: delete diff --git a/manifests/site/test-site/host-inventory/kustomization.yaml b/manifests/site/test-site/host-inventory/kustomization.yaml new file mode 100644 index 000000000..0c3b6f854 --- /dev/null +++ b/manifests/site/test-site/host-inventory/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +generators: + - hostgenerator diff --git a/manifests/site/test-site/metadata.yaml b/manifests/site/test-site/metadata.yaml index bc8863087..0e4026946 100644 --- a/manifests/site/test-site/metadata.yaml +++ b/manifests/site/test-site/metadata.yaml @@ -1,3 +1,6 @@ phase: docEntryPointPrefix: manifests/site/test-site path: manifests/site/test-site/phases + +inventory: + path: manifests/site/test-site/host-inventory diff --git a/manifests/site/test-site/phases/kustomization.yaml b/manifests/site/test-site/phases/kustomization.yaml index 00840503a..324f3bb94 100644 --- a/manifests/site/test-site/phases/kustomization.yaml +++ b/manifests/site/test-site/phases/kustomization.yaml @@ -1,3 +1,6 @@ resources: - ../kubeconfig - ../../../type/airship-core/phases +## TODO Consider making a catalogue combined with variable substitution instead +patchesStrategicMerge: + - phase-patch.yaml diff --git a/manifests/site/test-site/phases/phase-patch.yaml b/manifests/site/test-site/phases/phase-patch.yaml new file mode 100644 index 000000000..af80de36a --- /dev/null +++ b/manifests/site/test-site/phases/phase-patch.yaml @@ -0,0 +1,10 @@ +apiVersion: airshipit.org/v1alpha1 +kind: BaremetalManager +metadata: + name: RemoteDirectEphemeral +spec: + hostSelector: + name: node02 + operationOptions: + remoteDirect: + isoURL: http://localhost:8099/ephemeral.iso diff --git a/manifests/site/test-site/target/catalogues/hosts.yaml b/manifests/site/test-site/target/catalogues/hosts.yaml index fa7052389..dcbea59c4 100644 --- a/manifests/site/test-site/target/catalogues/hosts.yaml +++ b/manifests/site/test-site/target/catalogues/hosts.yaml @@ -26,7 +26,7 @@ hosts: node02: bootMode: UEFI macAddress: 52:54:00:b6:ed:02 - bmcAddress: redfish+http://10.23.25.2:8000/redfish/v1/Systems/air-target-2 + bmcAddress: redfish+https://10.23.25.1:8443/redfish/v1/Systems/air-ephemeral bmcUsername: username bmcPassword: password disableCertificateVerification: false @@ -51,3 +51,16 @@ hosts: oam: 52:54:00:9b:27:07 pxe: 52:54:00:b6:ed:23 hardwareProfile: default # defined in the hardwareprofile-example function + node04: + bootMode: UEFI + macAddress: 52:54:00:36:5e:e3 + bmcAddress: redfish+http://10.23.25.2:8000/redfish/v1/Systems/air-target-2 + bmcUsername: username + bmcPassword: password + ipAddresses: + oam-ipv4: 10.23.25.104 + pxe-ipv4: 10.23.24.104 + macAddresses: + oam: 52:54:00:dc:ab:04 + pxe: 52:54:00:51:0b:e4 + hardwareProfile: default # defined in the hardwareprofile-example function