diff --git a/automation/vars/hci-adoption.yaml b/automation/vars/hci-adoption.yaml index 37709ca35..bea825899 100644 --- a/automation/vars/hci-adoption.yaml +++ b/automation/vars/hci-adoption.yaml @@ -2,7 +2,7 @@ vas: hci-adoption: stages: - - path: examples/va/hci/control-plane/nncp + - path: examples/va/hci/control-plane/networking/nncp wait_conditions: - >- oc -n openstack wait nncp @@ -14,12 +14,12 @@ vas: src_file: values.yaml build_output: nncp.yaml - - path: examples/va/hci/control-plane + - path: examples/va/hci/control-plane/networking wait_conditions: - >- - oc -n openstack wait nncp - -l osp/nncm-config-type=standard - --for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured + oc -n metallb-system wait pod + -l app=metallb -l component=speaker + --for condition=Ready --timeout=5m values: - name: network-values diff --git a/automation/vars/hci.yaml b/automation/vars/hci.yaml index 7449b72b3..d3e87e9aa 100644 --- a/automation/vars/hci.yaml +++ b/automation/vars/hci.yaml @@ -2,7 +2,7 @@ vas: hci: stages: - - path: examples/va/hci/control-plane/nncp + - path: examples/va/hci/control-plane/networking/nncp wait_conditions: - >- oc -n openstack wait nncp @@ -14,6 +14,18 @@ vas: src_file: values.yaml build_output: nncp.yaml + - path: examples/va/hci/control-plane/networking + wait_conditions: + - >- + oc -n metallb-system wait pod + -l app=metallb -l component=speaker + --for condition=Ready + --timeout=5m + values: + - name: network-values + src_file: nncp/values.yaml + build_output: network.yaml + - path: examples/va/hci/control-plane wait_conditions: - >- @@ -23,7 +35,7 @@ vas: - name: service-values src_file: service-values.yaml - name: network-values - src_file: nncp/values.yaml + src_file: networking/nncp/values.yaml build_output: ../control-plane.yaml - path: examples/va/hci/edpm-pre-ceph/nodeset diff --git a/examples/va/hci/control-plane.md b/examples/va/hci/control-plane.md index bc1110e2b..6afac8f89 100644 --- a/examples/va/hci/control-plane.md +++ b/examples/va/hci/control-plane.md @@ -14,16 +14,16 @@ Change to the hci directory ``` cd architecture/examples/va/hci ``` -Edit the [control-plane/nncp/values.yaml](control-plane/nncp/values.yaml) file to suit your environment. +Edit the [control-plane/networking/nncp/values.yaml](control-plane/networking/nncp/values.yaml) file to suit your environment. ``` -vi control-plane/nncp/values.yaml +vi control-plane/networking/nncp/values.yaml ``` ## Apply node network configuration Generate the node network configuration ``` -kustomize build control-plane/nncp > nncp.yaml +kustomize build control-plane/networking/nncp > nncp.yaml ``` Apply the NNCP CRs ``` @@ -34,13 +34,24 @@ Wait for NNCPs to be available oc wait nncp -l osp/nncm-config-type=standard --for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured --timeout=300s ``` -## Apply networking and control-plane configuration +## Apply remaining networking configuration -Generate the control-plane and networking CRs. +Generate the reminaing networking configuration +``` +kustomize build control-plane/networking > networking.yaml +``` +Apply the networking CRs +``` +oc apply -f networking.yaml +``` + +## Apply control-plane configuration + +Generate the control-plane CR. ``` kustomize build control-plane > control-plane.yaml ``` -Apply the CRs +Apply the CR ``` oc apply -f control-plane.yaml ``` diff --git a/examples/va/hci/control-plane/kustomization.yaml b/examples/va/hci/control-plane/kustomization.yaml index 7ffc945be..e692cc608 100644 --- a/examples/va/hci/control-plane/kustomization.yaml +++ b/examples/va/hci/control-plane/kustomization.yaml @@ -9,5 +9,5 @@ components: ## https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md resources: - - nncp/values.yaml + - networking/nncp/values.yaml - service-values.yaml diff --git a/examples/va/hci/control-plane/networking/kustomization.yaml b/examples/va/hci/control-plane/networking/kustomization.yaml new file mode 100644 index 000000000..38891e4b2 --- /dev/null +++ b/examples/va/hci/control-plane/networking/kustomization.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +components: + - ../../../../../va/hci/networking + +resources: + - nncp/values.yaml diff --git a/examples/va/hci/control-plane/nncp/.gitignore b/examples/va/hci/control-plane/networking/nncp/.gitignore similarity index 100% rename from examples/va/hci/control-plane/nncp/.gitignore rename to examples/va/hci/control-plane/networking/nncp/.gitignore diff --git a/examples/va/hci/control-plane/nncp/kustomization.yaml b/examples/va/hci/control-plane/networking/nncp/kustomization.yaml similarity index 93% rename from examples/va/hci/control-plane/nncp/kustomization.yaml rename to examples/va/hci/control-plane/networking/nncp/kustomization.yaml index c92bc55fa..5bded973f 100644 --- a/examples/va/hci/control-plane/nncp/kustomization.yaml +++ b/examples/va/hci/control-plane/networking/nncp/kustomization.yaml @@ -18,7 +18,7 @@ transformers: create: true components: - - ../../../../../lib/nncp + - ../../../../../../lib/nncp resources: - values.yaml diff --git a/examples/va/hci/control-plane/nncp/values.yaml b/examples/va/hci/control-plane/networking/nncp/values.yaml similarity index 100% rename from examples/va/hci/control-plane/nncp/values.yaml rename to examples/va/hci/control-plane/networking/nncp/values.yaml diff --git a/examples/va/hci/kustomization.yaml b/examples/va/hci/kustomization.yaml index fff80a14d..3aa31b270 100644 --- a/examples/va/hci/kustomization.yaml +++ b/examples/va/hci/kustomization.yaml @@ -10,7 +10,7 @@ components: ## https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md resources: - - control-plane/nncp/values.yaml + - control-plane/networking/nncp/values.yaml - edpm-pre-ceph/nodeset/values.yaml - service-values.yaml - values.yaml diff --git a/va/hci/kustomization.yaml b/va/hci/kustomization.yaml index a9f72e689..503398553 100644 --- a/va/hci/kustomization.yaml +++ b/va/hci/kustomization.yaml @@ -18,56 +18,4 @@ transformers: create: true components: - - ../../lib/networking/metallb - - ../../lib/networking/netconfig - - ../../lib/networking/nad - ../../lib/control-plane - -# Add storagemgmt network template, as it is needed for CephHCI -patches: - - target: - version: v1beta1 - kind: NetConfig - name: netconfig - patch: |- - - op: add - path: /spec/networks/- - value: - dnsDomain: _replaced_ - name: storagemgmt - subnets: - - _replaced_ - mtu: 1500 - -# Add storagemgmt network replacements -replacements: - # NetConfig dnsDomain specific to this VA - - source: - kind: ConfigMap - name: network-values - fieldPath: data.storagemgmt.dnsDomain - targets: - - select: - kind: NetConfig - fieldPaths: - - spec.networks.[name=storagemgmt].dnsDomain - # NetConfig MTU specific to this VA - - source: - kind: ConfigMap - name: network-values - fieldPath: data.storagemgmt.mtu - targets: - - select: - kind: NetConfig - fieldPaths: - - spec.networks.[name=storagemgmt].mtu - # NetConfig subnets specific to this VA - - source: - kind: ConfigMap - name: network-values - fieldPath: data.storagemgmt.subnets - targets: - - select: - kind: NetConfig - fieldPaths: - - spec.networks.[name=storagemgmt].subnets diff --git a/va/hci/networking/kustomization.yaml b/va/hci/networking/kustomization.yaml new file mode 100644 index 000000000..b1c0d152a --- /dev/null +++ b/va/hci/networking/kustomization.yaml @@ -0,0 +1,72 @@ +--- +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +transformers: + # Set namespace to OpenStack on all namespaced objects without a namespace + - |- + apiVersion: builtin + kind: NamespaceTransformer + metadata: + name: _ignored_ + namespace: openstack + setRoleBindingSubjects: none + unsetOnly: true + fieldSpecs: + - path: metadata/name + kind: Namespace + create: true + +components: + - ../../../lib/networking/metallb + - ../../../lib/networking/netconfig + - ../../../lib/networking/nad + +# Add storagemgmt network template, as it is needed for CephHCI +patches: + - target: + version: v1beta1 + kind: NetConfig + name: netconfig + patch: |- + - op: add + path: /spec/networks/- + value: + dnsDomain: _replaced_ + name: storagemgmt + subnets: + - _replaced_ + mtu: 1500 + +# Add storagemgmt network replacements +replacements: + # NetConfig dnsDomain specific to this VA + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storagemgmt.dnsDomain + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=storagemgmt].dnsDomain + # NetConfig MTU specific to this VA + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storagemgmt.mtu + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=storagemgmt].mtu + # NetConfig subnets specific to this VA + - source: + kind: ConfigMap + name: network-values + fieldPath: data.storagemgmt.subnets + targets: + - select: + kind: NetConfig + fieldPaths: + - spec.networks.[name=storagemgmt].subnets diff --git a/zuul.d/validations.yaml b/zuul.d/validations.yaml index e1ef368d0..86b8e9e8d 100644 --- a/zuul.d/validations.yaml +++ b/zuul.d/validations.yaml @@ -58,7 +58,8 @@ files: - examples/va/hci - examples/va/hci/control-plane - - examples/va/hci/control-plane/nncp + - examples/va/hci/control-plane/networking + - examples/va/hci/control-plane/networking/nncp - examples/va/hci/deployment - examples/va/hci/edpm-pre-ceph/deployment - examples/va/hci/edpm-pre-ceph/nodeset @@ -70,8 +71,8 @@ cifmw_architecture_scenario: hci - job: files: - - examples/va/hci/control-plane - - examples/va/hci/control-plane/nncp + - examples/va/hci/control-plane/networking + - examples/va/hci/control-plane/networking/nncp - lib name: rhoso-architecture-validate-hci-adoption parent: rhoso-architecture-base-job