diff --git a/.gitignore b/.gitignore index 838a90719..7e9ab13a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ # Unit test / coverage reports .tox/ build/ + +manifests/site/virtual-network-cloud/ephemeral/controlplane/before.yaml diff --git a/manifests/site/virtual-network-cloud/ephemeral/bootstrap/baremetalhost.yaml b/manifests/site/virtual-network-cloud/ephemeral/bootstrap/baremetalhost.yaml new file mode 100644 index 000000000..7d8282cc8 --- /dev/null +++ b/manifests/site/virtual-network-cloud/ephemeral/bootstrap/baremetalhost.yaml @@ -0,0 +1,20 @@ +# This patches the node02 BMH to be suitable for ephemeral purposes +apiVersion: metal3.io/v1alpha1 +kind: BareMetalHost +metadata: + annotations: + labels: + airshipit.org/ephemeral-node: "true" + airshipit.org/deploy-k8s: "false" + name: node02 +spec: + online: true + bmc: + address: redfish+https://localhost:8443/redfish/v1/Systems/air-ephemeral +status: + provisioning: +# we need this status to make sure, that the host is not going to be +# reprovisioned by the ephemeral baremetal operator. +# when we have more flexible labeling system in place, we will not +# deliver this document to ephemeral cluster + state: externally provisioned diff --git a/manifests/site/virtual-network-cloud/ephemeral/bootstrap/hostgenerator/host-generation.yaml b/manifests/site/virtual-network-cloud/ephemeral/bootstrap/hostgenerator/host-generation.yaml new file mode 100644 index 000000000..665c8ae77 --- /dev/null +++ b/manifests/site/virtual-network-cloud/ephemeral/bootstrap/hostgenerator/host-generation.yaml @@ -0,0 +1,10 @@ +# 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: + - node02 diff --git a/manifests/site/virtual-network-cloud/ephemeral/bootstrap/hostgenerator/kustomization.yaml b/manifests/site/virtual-network-cloud/ephemeral/bootstrap/hostgenerator/kustomization.yaml new file mode 100644 index 000000000..5acc9b591 --- /dev/null +++ b/manifests/site/virtual-network-cloud/ephemeral/bootstrap/hostgenerator/kustomization.yaml @@ -0,0 +1,9 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../../../../../../airshipctl/manifests/function/hostgenerator-m3 + - ../../../shared/catalogues/ + - host-generation.yaml + +transformers: + - ../../../../../../../airshipctl/manifests/function/hostgenerator-m3/replacements diff --git a/manifests/site/virtual-network-cloud/ephemeral/bootstrap/kustomization.yaml b/manifests/site/virtual-network-cloud/ephemeral/bootstrap/kustomization.yaml new file mode 100644 index 000000000..7ecccf013 --- /dev/null +++ b/manifests/site/virtual-network-cloud/ephemeral/bootstrap/kustomization.yaml @@ -0,0 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../../../type/network-cloud/ephemeral/bootstrap + +generators: + - hostgenerator + +patchesStrategicMerge: + - baremetalhost.yaml diff --git a/manifests/site/virtual-network-cloud/ephemeral/controlplane/control-machine-template-patch.yaml b/manifests/site/virtual-network-cloud/ephemeral/controlplane/control-machine-template-patch.yaml new file mode 100644 index 000000000..ee37cf2c5 --- /dev/null +++ b/manifests/site/virtual-network-cloud/ephemeral/controlplane/control-machine-template-patch.yaml @@ -0,0 +1,11 @@ +--- +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 +kind: Metal3MachineTemplate +metadata: + name: cluster-controlplane +spec: + template: + spec: + image: + url: http://10.23.24.1:8099/target-image.qcow2 + checksum: http://10.23.24.1:8099/target-image.qcow2.md5sum diff --git a/manifests/site/virtual-network-cloud/ephemeral/controlplane/hostgenerator/host-generation.yaml b/manifests/site/virtual-network-cloud/ephemeral/controlplane/hostgenerator/host-generation.yaml new file mode 100644 index 000000000..021bd1a0d --- /dev/null +++ b/manifests/site/virtual-network-cloud/ephemeral/controlplane/hostgenerator/host-generation.yaml @@ -0,0 +1,10 @@ +# 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: + - node01 diff --git a/manifests/site/virtual-network-cloud/ephemeral/controlplane/hostgenerator/kustomization.yaml b/manifests/site/virtual-network-cloud/ephemeral/controlplane/hostgenerator/kustomization.yaml new file mode 100644 index 000000000..5acc9b591 --- /dev/null +++ b/manifests/site/virtual-network-cloud/ephemeral/controlplane/hostgenerator/kustomization.yaml @@ -0,0 +1,9 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../../../../../../airshipctl/manifests/function/hostgenerator-m3 + - ../../../shared/catalogues/ + - host-generation.yaml + +transformers: + - ../../../../../../../airshipctl/manifests/function/hostgenerator-m3/replacements diff --git a/manifests/site/virtual-network-cloud/ephemeral/controlplane/kustomization.yaml b/manifests/site/virtual-network-cloud/ephemeral/controlplane/kustomization.yaml new file mode 100644 index 000000000..07281c7c9 --- /dev/null +++ b/manifests/site/virtual-network-cloud/ephemeral/controlplane/kustomization.yaml @@ -0,0 +1,9 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../../../type/network-cloud/ephemeral/controlplane + # TODO (dukov) It's recocommended to upload BareMetalHost objects separately + # otherwise nodes will hang in 'registering' state for quite a long time + - nodes +patchesStrategicMerge: + - control-machine-template-patch.yaml diff --git a/manifests/site/virtual-network-cloud/ephemeral/controlplane/nodes/kustomization.yaml b/manifests/site/virtual-network-cloud/ephemeral/controlplane/nodes/kustomization.yaml new file mode 100644 index 000000000..cb965874e --- /dev/null +++ b/manifests/site/virtual-network-cloud/ephemeral/controlplane/nodes/kustomization.yaml @@ -0,0 +1,12 @@ +# Note: this weird extra layer between the .. and ../hostgenerator +# is purely to apply the label below to the generated hosts. +# When can come up with a better way to declare (e.g. via catalogue) +# that the host is a controlplane host, we should get rid of this. +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +generators: + - ../hostgenerator + +commonLabels: + airshipit.org/k8s-role: controlplane-host diff --git a/manifests/site/virtual-network-cloud/ephemeral/initinfra/kustomization.yaml b/manifests/site/virtual-network-cloud/ephemeral/initinfra/kustomization.yaml new file mode 100644 index 000000000..9e3a3e4b4 --- /dev/null +++ b/manifests/site/virtual-network-cloud/ephemeral/initinfra/kustomization.yaml @@ -0,0 +1,4 @@ +resources: + - ../../../../type/network-cloud/ephemeral/initinfra +patchesStrategicMerge: + - patch_bmo_config.yaml diff --git a/manifests/site/virtual-network-cloud/ephemeral/initinfra/patch_bmo_config.yaml b/manifests/site/virtual-network-cloud/ephemeral/initinfra/patch_bmo_config.yaml new file mode 100644 index 000000000..807852aa8 --- /dev/null +++ b/manifests/site/virtual-network-cloud/ephemeral/initinfra/patch_bmo_config.yaml @@ -0,0 +1,9 @@ +--- +kind: ConfigMap +apiVersion: v1 +metadata: + labels: + name: ironic-vars +data: + PROVISIONING_IP: "10.23.24.101" + DHCP_RANGE: "10.23.24.200,10.23.24.250" diff --git a/manifests/site/virtual-network-cloud/shared/catalogues/hosts.yaml b/manifests/site/virtual-network-cloud/shared/catalogues/hosts.yaml new file mode 100644 index 000000000..bda3fa31b --- /dev/null +++ b/manifests/site/virtual-network-cloud/shared/catalogues/hosts.yaml @@ -0,0 +1,33 @@ +# Site-level host catalogue. This info feeds the Templater +# kustomize plugin config in the hostgenerator-m3 function. +apiVersion: airshipit.org/v1alpha1 +kind: VariableCatalogue +metadata: + name: host-catalogue +hosts: + m3: + node01: + macAddress: 52:54:00:b6:ed:31 + bmcAddress: redfish+http://10.23.25.1:8000/redfish/v1/Systems/air-target-1 + bmcUsername: root + bmcPassword: r00tme + ipAddresses: + oam-ipv4: 10.23.25.102 + pxe-ipv4: 10.23.24.102 + macAddresses: + oam: 52:54:00:9b:27:4c + pxe: 52:54:00:b6:ed:31 + bootMode: legacy + hardwareProfile: default # defined in the hostgenerator-m3 function + node02: + macAddress: 52:54:00:b6:ed:02 + bmcAddress: redfish+http://10.23.25.2:8000/redfish/v1/Systems/air-target-2 + bmcUsername: username + bmcPassword: password + ipAddresses: + oam-ipv4: 10.23.25.101 + pxe-ipv4: 10.23.24.101 + macAddresses: + oam: 52:54:00:9b:27:02 + pxe: 52:54:00:b6:ed:02 + hardwareProfile: default # defined in the hostgenerator-m3 function diff --git a/manifests/site/virtual-network-cloud/shared/catalogues/kustomization.yaml b/manifests/site/virtual-network-cloud/shared/catalogues/kustomization.yaml new file mode 100644 index 000000000..d2820b364 --- /dev/null +++ b/manifests/site/virtual-network-cloud/shared/catalogues/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../../../type/network-cloud/shared/catalogues + - hosts.yaml diff --git a/manifests/type/network-cloud/shared/catalogues/kustomization.yaml b/manifests/type/network-cloud/shared/catalogues/kustomization.yaml index 53d220e1c..3e4b9f107 100644 --- a/manifests/type/network-cloud/shared/catalogues/kustomization.yaml +++ b/manifests/type/network-cloud/shared/catalogues/kustomization.yaml @@ -1,7 +1,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - ../../../../airship-core/shared/catalogues + - ../../../airship-core/shared/catalogues -patchesStrategicMerge: - - common-networking.yaml +# NOTE(drewwalters96): Uncomment to patch common-networking catalogue. +# patchesStrategicMerge: +# - common-networking.yaml