Skip to content

Commit 6e61cd8

Browse files
committed
HCIDOCS-188.1: Explains host networking when scaling a UPI cluster with the BMO..
1 parent fcbdf08 commit 6e61cd8

4 files changed

+168
-35
lines changed

installing/installing_bare_metal/upi/scaling-a-user-provisioned-cluster-with-the-bare-metal-operator.adoc

+14-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,25 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
After deploying a user-provisioned infrastructure cluster, you can use the Bare Metal Operator (BMO) and other metal3 components to scale bare-metal hosts in the cluster. This approach helps you to scale a user-provisioned cluster in a more automated way.
9+
After deploying a user-provisioned infrastructure cluster, you can use the Bare Metal Operator (BMO) and other metal^3^ components to scale bare-metal hosts in the cluster. This approach helps you to scale a user-provisioned cluster in a more automated way.
1010

1111
include::modules/about-scaling-a-user-provisioned-installation-with-the-bare-metal-operator.adoc[leveloffset=+1]
1212
include::modules/upi-prerequisites-for-scaling-a-upi-cluster.adoc[leveloffset=+2]
1313
include::modules/upi-limitations-for-scaling-a-upi-cluster.adoc[leveloffset=+2]
1414
include::modules/configuring-a-provisioning-resource-to-scale-user-provisioned-clusters.adoc[leveloffset=+1]
1515
include::modules/upi-provisioning-new-hosts-in-a-upi-cluster.adoc[leveloffset=+1]
16-
include::modules/upi-managing-existing-hosts-in-a-upi-cluster.adoc[leveloffset=+1]
17-
include::modules/upi-removing-hosts-from-a-upi-cluster.adoc[leveloffset=+1]
1816

17+
[role="_additional-resources"]
18+
.Additional resources
19+
20+
* xref:../../../installing/installing_bare_metal/ipi/ipi-install-expanding-the-cluster.adoc#preparing-the-bare-metal-node_ipi-install-expanding[Preparing the bare-metal node]
21+
22+
* xref:../../../installing/installing_bare_metal/ipi/ipi-install-installation-workflow.adoc#root-device-hints_ipi-install-installation-workflow[Root device hints]
23+
24+
* xref:../../../installing/installing_bare_metal/ipi/ipi-install-expanding-the-cluster.adoc#ipi-install-diagnosing-duplicate-mac-address_ipi-install-expanding[Diagnosing a duplicate MAC address when provisioning a new host in the cluster]
25+
26+
// Managing existing hosts in a user-provisioned cluster by using the BMO
27+
include::modules/upi-managing-existing-hosts-in-a-upi-cluster.adoc[leveloffset=+1]
1928

29+
// Removing hosts from a user-provisioned cluster by using the BMO
30+
include::modules/upi-removing-hosts-from-a-upi-cluster.adoc[leveloffset=+1]

modules/about-scaling-a-user-provisioned-installation-with-the-bare-metal-operator.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
[id="about-scaling-a-user-provisioned-cluster-with-the-bare-metal-operator_{context}"]
88
= About scaling a user-provisioned cluster with the Bare Metal Operator
99

10-
You can scale user-provisioned infrastructure clusters by using the Bare Metal Operator (BMO) and other metal3 components. User-provisioned infrastructure installations do not feature the Machine API Operator. The Machine API Operator typically manages the lifecycle of bare-metal hosts in a cluster. However, it is possible to use the BMO and other metal3 components to scale nodes in user-provisioned clusters without requiring the Machine API Operator.
10+
You can scale user-provisioned infrastructure clusters by using the Bare Metal Operator (BMO) and other metal^3^ components. User-provisioned infrastructure installations do not feature the Machine API Operator. The Machine API Operator typically manages the lifecycle of bare-metal nodes in a cluster. However, it is possible to use the BMO and other metal^3^ components to scale nodes in user-provisioned clusters without requiring the Machine API Operator.

modules/upi-provisioning-new-hosts-in-a-upi-cluster.adoc

+137-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Module included in the following assemblies:
22
//
3-
// * installing/installing_bare_metal/scaling-a-user-provisioned-cluster-with-the-bare-metal-operator.adoc
3+
// * installing/installing_bare_metal/upi/scaling-a-user-provisioned-cluster-with-the-bare-metal-operator.adoc
44
:_mod-docs-content-type: PROCEDURE
55
[id="upi-provisioning-new-hosts-in-a-upi-cluster_{context}"]
66
= Provisioning new hosts in a user-provisioned cluster by using the BMO
@@ -9,7 +9,7 @@ You can use the Bare Metal Operator (BMO) to provision bare-metal hosts in a use
99

1010
[NOTE]
1111
====
12-
To provision bare-metal hosts to the cluster by using the BMO, you must set the `spec.externallyProvisioned` specification in the `BareMetalHost` custom resource to `false`.
12+
Provisioning bare-metal hosts to the cluster by using the BMO sets the `spec.externallyProvisioned` specification in the `BareMetalHost` custom resource to `false` by default. Do not set the `spec.externallyProvisioned` specification to `true`, because this setting results in unexpected behavior.
1313
====
1414

1515
.Prerequisites
@@ -20,45 +20,153 @@ To provision bare-metal hosts to the cluster by using the BMO, you must set the
2020
2121
.Procedure
2222

23-
. Create the `Secret` CR and the `BareMetalHost` CR.
23+
. Create a configuration file for the bare-metal node. Depending if you use either a static configuration or a DHCP server, choose one of the following example `bmh.yaml` files and configure it to your needs by replacing values in the YAML to match your environment:
2424

25-
.. Save the following YAML in the `bmh.yaml` file:
25+
* To deploy with a static configuration, create the following `bmh.yaml` file:
2626
+
2727
[source,yaml]
2828
----
2929
---
3030
apiVersion: v1
3131
kind: Secret
3232
metadata:
33-
name: worker1-bmc
33+
name: openshift-worker-<num>-network-config-secret <1>
34+
namespace: openshift-machine-api
35+
type: Opaque
36+
stringData:
37+
nmstate: | <2>
38+
interfaces: <3>
39+
- name: <nic1_name> <4>
40+
type: ethernet
41+
state: up
42+
ipv4:
43+
address:
44+
- ip: <ip_address> <5>
45+
prefix-length: 24
46+
enabled: true
47+
dns-resolver:
48+
config:
49+
server:
50+
- <dns_ip_address> <6>
51+
routes:
52+
config:
53+
- destination: 0.0.0.0/0
54+
next-hop-address: <next_hop_ip_address> <7>
55+
next-hop-interface: <next_hop_nic1_name> <8>
56+
---
57+
apiVersion: v1
58+
kind: Secret
59+
metadata:
60+
name: openshift-worker-<num>-bmc-secret
3461
namespace: openshift-machine-api
3562
type: Opaque
3663
data:
37-
username: <base64_of_uid>
64+
username: <base64_of_uid> <9>
3865
password: <base64_of_pwd>
3966
---
4067
apiVersion: metal3.io/v1alpha1
4168
kind: BareMetalHost
4269
metadata:
43-
name: worker1
70+
name: openshift-worker-<num>
4471
namespace: openshift-machine-api
4572
spec:
73+
online: true
74+
bootMACAddress: <nic1_mac_address> <10>
4675
bmc:
47-
address: <protocol>://<bmc_url> <1>
48-
credentialsName: "worker1-bmc"
49-
bootMACAddress: <nic1_mac_address>
50-
externallyProvisioned: false <2>
76+
address: <protocol>://<bmc_url> <11>
77+
credentialsName: openshift-worker-<num>-bmc-secret
78+
disableCertificateVerification: false
5179
customDeploy:
5280
method: install_coreos
53-
online: true
5481
userData:
5582
name: worker-user-data-managed
5683
namespace: openshift-machine-api
84+
rootDeviceHints:
85+
deviceName: <root_device_hint> <12>
86+
preprovisioningNetworkDataName: openshift-worker-<num>-network-config-secret
87+
----
88+
<1> Replace all instances of `<num>` with a unique compute node number for the bare-metal nodes in the `name`, `credentialsName`, and `preprovisioningNetworkDataName` fields.
89+
<2> Add the NMState YAML syntax to configure the host interfaces. To configure the network interface for a newly created node, specify the name of the secret that has the network configuration. Follow the `nmstate` syntax to define the network configuration for your node. See "Preparing the bare-metal node" for details on configuring NMState syntax.
90+
<3> Optional: If you have configured the network interface with `nmstate`, and you want to disable an interface, set `state: up` with the IP addresses set to `enabled: false`.
91+
<4> Replace `<nic1_name>` with the name of the bare-metal node's first network interface controller (NIC).
92+
<5> Replace `<ip_address>` with the IP address of the bare-metal node's NIC.
93+
<6> Replace `<dns_ip_address>` with the IP address of the bare-metal node's DNS resolver.
94+
<7> Replace `<next_hop_ip_address>` with the IP address of the bare-metal node's external gateway.
95+
<8> Replace `<next_hop_nic1_name>` with the name of the bare-metal node's external gateway.
96+
<9> Replace `<base64_of_uid>` and `<base64_of_pwd>` with the base64 string of the user name and password.
97+
<10> Replace `<nic1_mac_address>` with the MAC address of the bare-metal node's first NIC. See the "BMC addressing" section for additional BMC configuration options.
98+
<11> Replace `<protocol>` with the BMC protocol, such as IPMI, Redfish, or others. Replace `<bmc_url>` with the URL of the bare-metal node's baseboard management controller.
99+
<12> Optional: Replace `<root_device_hint>` with a device path when specifying a root device hint. See "Root device hints" for additional details.
100+
101+
* When configuring the network interface with a static configuration by using `nmstate`, set `state: up` with the IP addresses set to `enabled: false`:
102+
+
103+
[source,yaml]
104+
----
105+
---
106+
apiVersion: v1
107+
kind: Secret
108+
metadata:
109+
name: openshift-worker-<num>-network-config-secret
110+
namespace: openshift-machine-api
111+
# ...
112+
interfaces:
113+
- name: <nic_name>
114+
type: ethernet
115+
state: up
116+
ipv4:
117+
enabled: false
118+
ipv6:
119+
enabled: false
120+
# ...
57121
----
58-
<1> You can only use bare-metal host drivers that support virtual media networking booting, for example `redfish-virtualmedia` and `idrac-virtualmedia`.
59-
<2> You must set the `spec.externallyProvisioned` specification in the `BareMetalHost` custom resource to `false`. The default value is `false`.
60122

61-
. Create the bare-metal host object by running the following command:
123+
* To deploy with a DHCP configuration, create the following `bmh.yaml` file:
124+
+
125+
[source,yaml]
126+
----
127+
---
128+
apiVersion: v1
129+
kind: Secret
130+
metadata:
131+
name: openshift-worker-<num>-bmc-secret <1>
132+
namespace: openshift-machine-api
133+
type: Opaque
134+
data:
135+
username: <base64_of_uid> <2>
136+
password: <base64_of_pwd>
137+
---
138+
apiVersion: metal3.io/v1alpha1
139+
kind: BareMetalHost
140+
metadata:
141+
name: openshift-worker-<num>
142+
namespace: openshift-machine-api
143+
spec:
144+
online: true
145+
bootMACAddress: <nic1_mac_address> <3>
146+
bmc:
147+
address: <protocol>://<bmc_url> <4>
148+
credentialsName: openshift-worker-<num>-bmc
149+
disableCertificateVerification: false
150+
customDeploy:
151+
method: install_coreos
152+
userData:
153+
name: worker-user-data-managed
154+
namespace: openshift-machine-api
155+
rootDeviceHints:
156+
deviceName: <root_device_hint> <5>
157+
----
158+
<1> Replace `<num>` with a unique compute node number for the bare-metal nodes in the `name` and `credentialsName` fields.
159+
<2> Replace `<base64_of_uid>` and `<base64_of_pwd>` with the base64 string of the user name and password.
160+
<3> Replace `<nic1_mac_address>` with the MAC address of the bare-metal node's first NIC. See the "BMC addressing" section for additional BMC configuration options.
161+
<4> Replace `<protocol>` with the BMC protocol, such as IPMI, Redfish, or others. Replace `<bmc_url>` with the URL of the bare-metal node's baseboard management controller.
162+
<5> Optional: Replace `<root_device_hint>` with a device path when specifying a root device hint. See "Root device hints" for additional details.
163+
+
164+
[IMPORTANT]
165+
====
166+
If the MAC address of an existing bare-metal node matches the MAC address of the bare-metal host that you are attempting to provision, then the installation will fail. If the host enrollment, inspection, cleaning, or other steps fail, the Bare Metal Operator retries the installation continuously. See "Diagnosing a duplicate MAC address when provisioning a new host in the cluster" for additional details.
167+
====
168+
169+
. Create the bare-metal node by running the following command:
62170
+
63171
[source,terminal]
64172
----
@@ -68,27 +176,31 @@ $ oc create -f bmh.yaml
68176
.Example output
69177
[source,terminal]
70178
----
71-
secret/worker1-bmc created
72-
baremetalhost.metal3.io/worker1 created
179+
secret/openshift-worker-<num>-network-config-secret created
180+
secret/openshift-worker-<num>-bmc-secret created
181+
baremetalhost.metal3.io/openshift-worker-<num> created
73182
----
74183

75-
. Approve all certificate signing requests (CSRs).
76-
77-
.. Verify that the provisioning state of the host is `provisioned` by running the following command:
184+
. Inspect the bare-metal node by running the following command:
78185
+
79186
[source,terminal]
80187
----
81-
$ oc get bmh -A
188+
$ oc -n openshift-machine-api get bmh openshift-worker-<num>
82189
----
83190
+
191+
where:
192+
+
193+
<num>:: Specifies the compute node number.
194+
+
84195
.Example output
85196
[source,terminal]
86197
----
87-
NAMESPACE NAME STATE CONSUMER ONLINE ERROR AGE
88-
openshift-machine-api controller1 externally provisioned true 5m25s
89-
openshift-machine-api worker1 provisioned true 4m45s
198+
NAME STATE CONSUMER ONLINE ERROR
199+
openshift-worker-<num> provisioned true
90200
----
91201

202+
. Approve all certificate signing requests (CSRs).
203+
92204
.. Get the list of pending CSRs by running the following command:
93205
+
94206
[source,terminal]
@@ -132,5 +244,4 @@ $ oc get nodes
132244
NAME STATUS ROLES AGE VERSION
133245
app1 Ready worker 47s v1.24.0+dc5a2fd
134246
controller1 Ready master,worker 2d22h v1.24.0+dc5a2fd
135-
----
136-
247+
----

modules/upi-removing-hosts-from-a-upi-cluster.adoc

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Module included in the following assemblies:
22
//
3-
// * installing/installing_bare_metal/scaling-a-user-provisioned-cluster-with-the-bare-metal-operator.adoc
3+
// * installing/installing_bare_metal/upi/scaling-a-user-provisioned-cluster-with-the-bare-metal-operator.adoc
44
:_mod-docs-content-type: PROCEDURE
55
[id="upi-removing-hosts-from-a-upi-cluster_{context}"]
66
= Removing hosts from a user-provisioned cluster by using the BMO
@@ -15,7 +15,7 @@ You can use the Bare Metal Operator (BMO) to remove bare-metal hosts from a user
1515
1616
.Procedure
1717

18-
. Cordon and drain the host by running the following command:
18+
. Cordon and drain the node by running the following command:
1919
+
2020
[source,terminal]
2121
----
@@ -74,6 +74,18 @@ openshift-machine-api controller1 externally provisioned true
7474
openshift-machine-api worker1 deprovisioning true 57m
7575
----
7676

77+
. Delete the host by running the following command when the `BareMetalHost` state changes to `available`:
78+
+
79+
[source,terminal]
80+
----
81+
$ oc delete bmh -n openshift-machine-api <bmh_name>
82+
----
83+
+
84+
[NOTE]
85+
====
86+
You can run this step without having to edit the `BareMetalHost` CR. It might take some time for the `BareMetalHost` state to change from `deprovisioning` to `available`.
87+
====
88+
7789
. Delete the node by running the following command:
7890
+
7991
[source,terminal]
@@ -83,7 +95,7 @@ $ oc delete node <node_name>
8395

8496
.Verification
8597

86-
* Verify the node is deleted by running the following command:
98+
* Verify that you deleted the node by running the following command:
8799
+
88100
[source,terminal]
89101
----
@@ -95,5 +107,4 @@ $ oc get nodes
95107
----
96108
NAME STATUS ROLES AGE VERSION
97109
controller1 Ready master,worker 2d23h v1.24.0+dc5a2fd
98-
----
99-
110+
----

0 commit comments

Comments
 (0)