diff --git a/.gitignore b/.gitignore index ce4a07247..d09436ff4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ examples/dt/uni*/data-plane.yaml examples/dt/uni*/networker/edpm-networker.yaml .idea/ .aider* +.tool-versions* diff --git a/automation/vars/nova04delta.yaml b/automation/vars/nova04delta.yaml index 7bc759509..634c6a943 100644 --- a/automation/vars/nova04delta.yaml +++ b/automation/vars/nova04delta.yaml @@ -33,8 +33,8 @@ vas: wait_conditions: - >- oc -n openstack wait osctlplane controlplane - --for condition=Ready - --timeout=60m + --for condition=OpenStackControlPlaneDNSReadyCondition + --timeout=20m values: - name: network-values src_file: networking/nncp/values.yaml @@ -42,13 +42,25 @@ vas: src_file: service-values.yaml build_output: control-plane.yaml - - name: edpm-nodeset - path: examples/dt/nova/nova04delta/edpm/nodeset + - name: baremetalhosts-configuration + path: examples/dt/nova/nova04delta/edpm/baremetalhosts wait_conditions: - >- oc -n openstack wait baremetalhosts.metal3.io edpm-compute-0 --for=jsonpath='{.status.provisioning.state}'=available --timeout=10m + - >- + oc -n openstack wait osctlplane controlplane + --for condition=Ready + --timeout=40m + values: + - name: baremetalhost-values + src_file: values.yaml + build_output: baremetalhosts.yaml + + - name: edpm-nodeset + path: examples/dt/nova/nova04delta/edpm/nodeset + wait_conditions: - >- oc -n openstack wait osdpns openstack-edpm --for condition=SetupReady diff --git a/dt/nova/nova04delta/edpm/nodeset/baremetalhost_template.yaml b/dt/nova/nova04delta/edpm/baremetalhosts/baremetalhost_template.yaml similarity index 100% rename from dt/nova/nova04delta/edpm/nodeset/baremetalhost_template.yaml rename to dt/nova/nova04delta/edpm/baremetalhosts/baremetalhost_template.yaml diff --git a/dt/nova/nova04delta/edpm/nodeset/baremetalhost.yaml b/dt/nova/nova04delta/edpm/baremetalhosts/baremetalhosts.yaml similarity index 100% rename from dt/nova/nova04delta/edpm/nodeset/baremetalhost.yaml rename to dt/nova/nova04delta/edpm/baremetalhosts/baremetalhosts.yaml diff --git a/dt/nova/nova04delta/edpm/baremetalhosts/bmc-secret.env b/dt/nova/nova04delta/edpm/baremetalhosts/bmc-secret.env new file mode 100644 index 000000000..8a157614e --- /dev/null +++ b/dt/nova/nova04delta/edpm/baremetalhosts/bmc-secret.env @@ -0,0 +1,2 @@ +username=admin +password=password \ No newline at end of file diff --git a/dt/nova/nova04delta/edpm/baremetalhosts/kustomization.yaml b/dt/nova/nova04delta/edpm/baremetalhosts/kustomization.yaml new file mode 100644 index 000000000..d53c119ce --- /dev/null +++ b/dt/nova/nova04delta/edpm/baremetalhosts/kustomization.yaml @@ -0,0 +1,126 @@ +--- +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 + +secretGenerator: + - name: bmc-secret + behavior: create + envs: + - bmc-secret.env + options: + disableNameSuffixHash: true + +resources: + - baremetalhosts.yaml + - provisioning.yaml + +patches: + - target: + kind: BareMetalHost + path: baremetalhost_template.yaml + - target: + kind: BareMetalHost + name: edpm-compute-0 + patch: | + - op: replace + path: /spec/preprovisioningNetworkDataName + value: edpm-compute-0-preprovision-network-data + +replacements: + # Labels + - source: + kind: ConfigMap + name: baremetalhost-values + fieldPath: data.edpm-compute-0.labels + targets: + - select: + kind: BareMetalHost + name: edpm-compute-0 + fieldPaths: + - metadata.labels + options: + create: true + + # Enable/Disable Metal3 Inspection + - source: + kind: ConfigMap + name: baremetalhost-values + fieldPath: data.metal3_inspection + targets: + - select: + kind: BareMetalHost + fieldPaths: + - metadata.annotations.inspect\.metal3\.io + options: + create: true + + # BMC Configuration + - source: + kind: ConfigMap + name: baremetalhost-values + fieldPath: data.edpm-compute-0.bmc + targets: + - select: + kind: BareMetalHost + name: edpm-compute-0 + fieldPaths: + - spec.bmc + options: + create: true + + # bootMACAddress + - source: + kind: ConfigMap + name: baremetalhost-values + fieldPath: data.edpm-compute-0.bootMACAddress + targets: + - select: + kind: BareMetalHost + name: edpm-compute-0 + fieldPaths: + - spec.bootMACAddress + options: + create: true + + # rootDeviceHints + - source: + kind: ConfigMap + name: baremetalhost-values + fieldPath: data.edpm-compute-0.rootDeviceHints + targets: + - select: + kind: BareMetalHost + name: edpm-compute-0 + fieldPaths: + - spec.rootDeviceHints + options: + create: true + + # preprovisioningNetworkData + - source: + kind: ConfigMap + name: baremetalhost-values + fieldPath: data.edpm-compute-0.preprovisioningNetworkData + targets: + - select: + kind: Secret + name: edpm-compute-0-preprovision-network-data + fieldPaths: + - stringData + options: + create: true diff --git a/dt/nova/nova04delta/edpm/nodeset/provisioning.yaml b/dt/nova/nova04delta/edpm/baremetalhosts/provisioning.yaml similarity index 100% rename from dt/nova/nova04delta/edpm/nodeset/provisioning.yaml rename to dt/nova/nova04delta/edpm/baremetalhosts/provisioning.yaml diff --git a/dt/nova/nova04delta/edpm/nodeset/kustomization.yaml b/dt/nova/nova04delta/edpm/nodeset/kustomization.yaml index de3d2b2e0..0f89ab39e 100644 --- a/dt/nova/nova04delta/edpm/nodeset/kustomization.yaml +++ b/dt/nova/nova04delta/edpm/nodeset/kustomization.yaml @@ -31,13 +31,6 @@ components: resources: - network-data-secrets.yaml - nova_gpu.yaml - - baremetalhost.yaml - - provisioning.yaml - -patches: - - target: - kind: BareMetalHost - path: baremetalhost_template.yaml replacements: # Nova compute CPU pinning customization @@ -90,102 +83,6 @@ replacements: - spec.baremetalSetTemplate options: create: true - # BareMetalHost - - source: - kind: ConfigMap - name: edpm-nodeset-values - fieldPath: data.baremetalhosts.edpm-compute-0.labels - targets: - - select: - kind: BareMetalHost - name: edpm-compute-0 - fieldPaths: - - metadata.labels - options: - create: true - - source: - kind: ConfigMap - name: edpm-nodeset-values - fieldPath: data.metal3_inspection - targets: - - select: - kind: BareMetalHost - fieldPaths: - - metadata.annotations.inspect\.metal3\.io - options: - create: true - - source: - kind: ConfigMap - name: edpm-nodeset-values - fieldPath: data.baremetalhosts.edpm-compute-0.bmc - targets: - - select: - kind: BareMetalHost - name: edpm-compute-0 - fieldPaths: - - spec.bmc - options: - create: true - - source: - kind: ConfigMap - name: edpm-nodeset-values - fieldPath: data.baremetalhosts.edpm-compute-0.online - targets: - - select: - kind: BareMetalHost - name: edpm-compute-0 - fieldPaths: - - spec.online - options: - create: true - - source: - kind: ConfigMap - name: edpm-nodeset-values - fieldPath: data.baremetalhosts.edpm-compute-0.preprovisioningNetworkDataName - targets: - - select: - kind: BareMetalHost - name: edpm-compute-0 - fieldPaths: - - spec.preprovisioningNetworkDataName - options: - create: true - - source: - kind: ConfigMap - name: edpm-nodeset-values - fieldPath: data.baremetalhosts.edpm-compute-0.bootMACAddress - targets: - - select: - kind: BareMetalHost - name: edpm-compute-0 - fieldPaths: - - spec.bootMACAddress - options: - create: true - - source: - kind: ConfigMap - name: edpm-nodeset-values - fieldPath: data.baremetalhosts.edpm-compute-0.rootDeviceHints - targets: - - select: - kind: BareMetalHost - name: edpm-compute-0 - fieldPaths: - - spec.rootDeviceHints - options: - create: true - - source: - kind: ConfigMap - name: edpm-nodeset-values - fieldPath: data.baremetalhosts.edpm-compute-0.preprovisioningNetworkData - targets: - - select: - kind: Secret - name: edpm-compute-0-preprovision-network-data - fieldPaths: - - stringData - options: - create: true # BMO root password for provisioned host - source: kind: ConfigMap diff --git a/examples/dt/nova/nova04delta/edpm/baremetalhosts/kustomization.yaml b/examples/dt/nova/nova04delta/edpm/baremetalhosts/kustomization.yaml new file mode 100644 index 000000000..380c249c4 --- /dev/null +++ b/examples/dt/nova/nova04delta/edpm/baremetalhosts/kustomization.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +components: + - ../../../../../../dt/nova/nova04delta/edpm/baremetalhosts + +resources: + - values.yaml diff --git a/examples/dt/nova/nova04delta/edpm/baremetalhosts/values.yaml b/examples/dt/nova/nova04delta/edpm/baremetalhosts/values.yaml new file mode 100644 index 000000000..a15aba771 --- /dev/null +++ b/examples/dt/nova/nova04delta/edpm/baremetalhosts/values.yaml @@ -0,0 +1,25 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: baremetalhost-values + annotations: + config.kubernetes.io/local-config: "true" +data: + metal3_inspection: disabled + edpm-compute-0: + name: edpm-compute-0 + labels: + app: openstack + nodeset: edpm + nodeName: edpm-compute-0 + bmc: + address: CHANGEME + credentialsName: bmc-secret + disableCertificateVerification: true + bootMACAddress: CHANGEME + rootDeviceHints: + deviceName: /dev/vda + preprovisioningNetworkData: + nmstate: | + CHANGEME diff --git a/examples/dt/nova/nova04delta/edpm/nodeset/values.yaml b/examples/dt/nova/nova04delta/edpm/nodeset/values.yaml index 8ffa3800a..d3ae49e75 100644 --- a/examples/dt/nova/nova04delta/edpm/nodeset/values.yaml +++ b/examples/dt/nova/nova04delta/edpm/nodeset/values.yaml @@ -12,27 +12,6 @@ data: root_password: cmVkaGF0Cg== # Mapped in dt/nova/nova04delta/edpm/nodeset/kustomization.yaml to OpenStackDataPlaneNodeSet.spec.preProvisioned preProvisioned: false - # Mapped in dt/nova/nova04delta/edpm/nodeset/kustomization.yaml to BareMetalHost.metadata.annotations.inspect.metal3.io - # Uncomment to allow HW inspection of the node, for example after a blank RAID device was manually created in BIOS. - metal3_inspection: "disabled" - # Mapped in dt/nova/nova04delta/edpm/nodeset/kustomization.yaml to BareMetalHost resource properties - baremetalhosts: - edpm-compute-0: - online: true - labels: - nodeName: edpm-compute-0 - bmc: - address: CHANGEME - # NOTE: in CI systems, we use credentials_file from cifmw_baremetal_hosts. - # credentialsName: bmc-secret - disableCertificateVerification: true - bootMACAddress: CHANGEME - rootDeviceHints: - deviceName: /dev/vda - preprovisioningNetworkDataName: edpm-compute-0-preprovision-network-data - preprovisioningNetworkData: - nmstate: | - CHANGEME # Mapped in dt/nova/nova04delta/edpm/nodeset/kustomization.yaml to edpm-compute-0-network-data Secret # Only provide it if it should not be auto-generated by EDPM operator baremetalHostsNetworkData: @@ -46,6 +25,7 @@ data: bmhNamespace: openstack # NOTE: provisioningInterface should not be provided when using virtual-media bmhLabelSelector: + # must match to all or a subset of the labels provided in the baremetalhosts/values.yaml app: openstack # CHANGEME passwordSecret: name: baremetalset-password-secret diff --git a/zuul.d/validations.yaml b/zuul.d/validations.yaml index c1985939f..132ec8458 100644 --- a/zuul.d/validations.yaml +++ b/zuul.d/validations.yaml @@ -214,6 +214,7 @@ - examples/dt/nova/nova04delta/control-plane - examples/dt/nova/nova04delta/control-plane/networking - examples/dt/nova/nova04delta/control-plane/networking/nncp + - examples/dt/nova/nova04delta/edpm/baremetalhosts - examples/dt/nova/nova04delta/edpm/deployment - examples/dt/nova/nova04delta/edpm/nodeset - lib