6.6.5. Creating the new control plane node
Begin creating the new control plane node by creating a BareMetalHost object and node.
Procedure
Edit the
bmh_affected.yamlfile that you previously saved:Remove the following metadata items from the file:
-
creationTimestamp -
generation -
resourceVersion -
uid
-
-
Remove the
statussection of the file.
The resulting file should resemble the following example:
Example
bmh_affected.yamlfileapiVersion: metal3.io/v1alpha1 kind: BareMetalHost metadata: labels: installer.openshift.io/role: control-plane name: openshift-control-plane-2 namespace: openshift-machine-api spec: automatedCleaningMode: disabled bmc: address: credentialsName: disableCertificateVerification: true bootMACAddress: ab:cd:ef:ab:cd:ef bootMode: UEFI externallyProvisioned: true online: true rootDeviceHints: deviceName: /dev/disk/by-path/pci-0000:04:00.0-nvme-1 userData: name: master-user-data-managed namespace: openshift-machine-apiCreate the
BareMetalHostobject using thebmh_affected.yamlfile by running the following command:$ oc create -f bmh_affected.yamlThe following warning is expected upon creation of the
BareMetalHostobject:Warning: metadata.finalizers: "baremetalhost.metal3.io": prefer a domain-qualified finalizer name to avoid accidental conflicts with other finalizer writersExtract the control plane ignition secret by running the following command:
$ oc extract secret/master-user-data-managed \ -n openshift-machine-api \ --keys=userData \ --to=- \ | sed '/^userData/d' > new_controlplane.ignThis command also removes the starting
userDataline of the ignition secret.Create an Nmstate YAML file titled
new_controlplane_nmstate.yamlfor the new node’s network configuration, using the following example for reference:Example Nmstate YAML file
interfaces: - name: eno1 type: ethernet state: up mac-address: "ab:cd:ef:01:02:03" ipv4: enabled: true address: - ip: 192.168.20.11 prefix-length: 24 dhcp: false ipv6: enabled: false dns-resolver: config: search: - iso.sterling.home server: - 192.168.20.8 routes: config: - destination: 0.0.0.0/0 metric: 100 next-hop-address: 192.168.20.1 next-hop-interface: eno1 table-id: 254참고If you installed your cluster using the Agent-based Installer, you can use the failed node’s
networkConfigsection in theagent-config.yamlfile from the original cluster deployment as a starting point for the new control plane node’s Nmstate file. For example, the following command extracts thenetworkConfigsection for the first control plane node:$ cat agent-config-iso.yaml | yq .hosts[0].networkConfig > new_controlplane_nmstate.yamlCreate the customized Red Hat Enterprise Linux CoreOS (RHCOS) live ISO by running the following command:
$ coreos-installer iso customize rhcos-live.86_64.iso \ --dest-ignition new_controlplane.ign \ --network-nmstate new_controlplane_nmstate.yaml \ --dest-device /dev/disk/by-path/<device_path> \ -fReplace
<device_path>with the path to the target device on which the ISO will be generated.- Boot the new control plane node with the customized RHCOS live ISO.
- Approve the Certificate Signing Requests (CSR) to join the new node to the cluster.