Skip to content

Commit 20c2756

Browse files
authored
Merge pull request #43915 from ktothill/BZ-2062756
BZ-2062756 IPI Install Procedure Replacing the Control Plane Node
2 parents 13adda3 + 97942d8 commit 20c2756

File tree

2 files changed

+175
-0
lines changed

2 files changed

+175
-0
lines changed

installing/installing_bare_metal_ipi/ipi-install-expanding-the-cluster.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ include::modules/ipi-install-preparing-the-bare-metal-node.adoc[leveloffset=+1]
2020

2121
* xref:../../installing/installing_bare_metal_ipi/ipi-install-installation-workflow.adoc#configuring-host-network-interfaces-in-the-install-config-yaml-file_ipi-install-installation-workflow[(Optional) Configuring host network interfaces in the install-config.yaml file]
2222
23+
include::modules/ipi-install-replacing-a-bare-metal-control-plane-node.adoc[leveloffset=+1]
24+
25+
[role="_additional-resources"]
26+
.Additional resources
27+
28+
* xref:../../post_installation_configuration/bare-metal-configuration.adoc[Bare metal configuration]
29+
30+
* xref:../../backup_and_restore/control_plane_backup_and_restore/replacing-unhealthy-etcd-member.adoc#restore-replace-stopped-etcd-member_replacing-unhealthy-etcd-member[Replacing an unhealthy etcd member]
31+
2332
include::modules/ipi-install-preparing-to-deploy-with-virtual-media-on-the-baremetal-network.adoc[leveloffset=+1]
2433

2534
include::modules/ipi-install-diagnosing-duplicate-mac-address.adoc[leveloffset=+1]
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
// This is included in the following assemblies:
2+
//
3+
// installing/installing_bare_metal_ipi/ipi-install-expanding-the-cluster.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="replacing-a-bare-metal-control-plane-node_{context}"]
7+
= Replacing a bare-metal control plane node
8+
9+
Use the following procedure to replace an installer-provisioned {product-title} control plane node.
10+
11+
[IMPORTANT]
12+
====
13+
If you reuse the `BareMetalHost` object definition from an existing control plane host, do not leave the `externallyProvisioned` field set to `true`.
14+
15+
Existing control plane `BareMetalHost` objects may have the `externallyProvisioned` flag set to `true` if they were provisioned by the {product-title} installation program.
16+
====
17+
18+
.Procedure
19+
20+
. Remove the old `baremetalhost`, `machine` and `node` objects:
21+
+
22+
[source,terminal]
23+
----
24+
$ oc delete node kni1-vmaster-0
25+
$ oc delete bmh -n openshift-machine-api vmaster-0
26+
$ oc delete machine -n openshift-machine-api kni1-master-0
27+
----
28+
+
29+
. Create the new `baremetalhost` object and the secret to store the BMC credentials:
30+
+
31+
[source,terminal]
32+
----
33+
$ cat <<EOF | oc apply -f -
34+
apiVersion: v1
35+
kind: Secret
36+
metadata:
37+
name: kni1-master-0-bmc-secret
38+
namespace: openshift-machine-api
39+
data:
40+
password: <username>
41+
username: <password>
42+
type: Opaque
43+
---
44+
apiVersion: metal3.io/v1alpha1
45+
kind: BareMetalHost
46+
metadata:
47+
name: kni1-master-0
48+
namespace: openshift-machine-api
49+
spec:
50+
automatedCleaningMode: disabled
51+
bmc:
52+
address: redfish-virtualmedia+http://192.168.124.113:8000/redfish/v1/Systems/f87eaf82-b32d-4291-ace6-b28677964e78
53+
credentialsName: kni1-master-0-bmc-secret
54+
bootMACAddress: aa:aa:aa:aa:ab:03
55+
bootMode: UEFI
56+
externallyProvisioned: false
57+
hardwareProfile: unknown
58+
online: true
59+
EOF
60+
----
61+
+
62+
After the inspection is complete, the `baremetalhost` object is created and available to be provisioned.
63+
64+
. View available `baremetalhost` objects:
65+
+
66+
[source,terminal]
67+
----
68+
$ oc get bmh -n openshift-machine-api
69+
----
70+
+
71+
.Example output
72+
[source,terminal]
73+
----
74+
NAME STATE CONSUMER ONLINE ERROR AGE
75+
kni1-master-0 available ocp-hkw9p-master-0 true 1h10m
76+
kni1-master-1 externally provisioned ocp-hkw9p-master-1 true 4h53m
77+
kni1-master-2 externally provisioned ocp-hkw9p-master-2 true 4h53m
78+
kni1-worker-0 provisioned ocp-hkw9p-worker-0-ktmmx true 4h53m
79+
kni1-worker-1 provisioned ocp-hkw9p-worker-0-l2zmb true 4h53m
80+
----
81+
+
82+
There are no `MachineSet` objects for control plane nodes, so you must create a `Machine` object instead. You can copy the `providerSpec` from another control plane `Machine` object.
83+
84+
. Create a `Machine` object:
85+
+
86+
[source,terminal]
87+
----
88+
$ cat <<EOF | oc apply -f -
89+
apiVersion: machine.openshift.io/v1beta1
90+
kind: Machine
91+
metadata:
92+
annotations:
93+
metal3.io/BareMetalHost: openshift-machine-api/kni1-master-0
94+
labels:
95+
machine.openshift.io/cluster-api-cluster: kni1
96+
machine.openshift.io/cluster-api-machine-role: master
97+
machine.openshift.io/cluster-api-machine-type: master
98+
name: kni1-master-0
99+
namespace: openshift-machine-api
100+
spec:
101+
metadata: {}
102+
providerSpec:
103+
value:
104+
apiVersion: baremetal.cluster.k8s.io/v1alpha1
105+
customDeploy:
106+
method: install_coreos
107+
hostSelector: {}
108+
image:
109+
checksum: ""
110+
url: ""
111+
kind: BareMetalMachineProviderSpec
112+
metadata:
113+
creationTimestamp: null
114+
userData:
115+
name: master-user-data-managed
116+
EOF
117+
----
118+
+
119+
. To define and create the `BareMetalHost`, `Secret`, and `Machine` objects in a single step, create a YAML file (`example.yaml`) with their definitions and run the following command:
120+
+
121+
[source,terminal]
122+
----
123+
$ oc create -f example.yaml
124+
----
125+
+
126+
The provisioning process uses the baremetal-operator to install RHCOS and prepare the host to be added to the cluster.
127+
+
128+
. To view the `BareMetalHost` objects, run the following command:
129+
+
130+
[source,terminal]
131+
----
132+
$ oc get bmh -A
133+
----
134+
+
135+
.Example output
136+
[source,terminal]
137+
----
138+
NAME STATE CONSUMER ONLINE ERROR AGE
139+
kni1-master-0 provisioned ocp-hkw9p-master-0 true 2h53m
140+
kni1-master-1 externally provisioned ocp-hkw9p-master-1 true 5h53m
141+
kni1-master-2 externally provisioned ocp-hkw9p-master-2 true 5h53m
142+
kni1-worker-0 provisioned ocp-hkw9p-worker-0-ktmmx true 5h53m
143+
kni1-worker-1 provisioned ocp-hkw9p-worker-0-l2zmb true 5h53m
144+
----
145+
+
146+
. After the RHCOS installation, verify that the `BareMetalHost` is added to the cluster:
147+
+
148+
[source,terminal]
149+
----
150+
$ oc get nodes
151+
----
152+
+
153+
.Example output
154+
[source,terminal]
155+
----
156+
NAME STATUS ROLES AGE VERSION
157+
kni1-master-0 available master 4m2s v1.18.2
158+
kni1-master-1 available master 141m v1.18.2
159+
kni1-master-2 available master 141m v1.18.2
160+
kni1-worker-0 available worker 87m v1.18.2
161+
----
162+
+
163+
[NOTE]
164+
====
165+
After replacement of the new control plane node, the etcd pod running in the new node is in `crashloopback` status. See "Replacing an unhealthy etcd member" for more information.
166+
====

0 commit comments

Comments
 (0)