Skip to content

Commit 9e5a697

Browse files
authored
Merge pull request #41038 from johnwilkins/TELCODOCS-212
TELCODOCS-212: D/S Docs: SDN-2217/MPNETWORK-2/KNIDEPLOY-4589, IPI provisioning with static IP addressing for nodes and Virtual IPs
2 parents a02bed0 + 1154dc9 commit 9e5a697

5 files changed

+116
-33
lines changed

installing/installing_bare_metal_ipi/ipi-install-installation-workflow.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ include::modules/ipi-install-modifying-install-config-for-no-provisioning-networ
2727

2828
include::modules/ipi-install-modifying-install-config-for-dual-stack-network.adoc[leveloffset=+2]
2929

30+
include::modules/ipi-install-configuring-host-network-interfaces-in-the-install-config.yaml-file.adoc[leveloffset=+2]
31+
3032
include::modules/ipi-install-configuring-managed-secure-boot-in-the-install-config-file.adoc[leveloffset=+2]
3133

3234
include::modules/ipi-install-additional-install-config-parameters.adoc[leveloffset=+2]
@@ -51,7 +53,6 @@ ifeval::[{product-version} > 4.8]
5153
include::modules/ipi-install-configuring-bios-for-worker-node.adoc[leveloffset=+2]
5254
endif::[]
5355

54-
5556
include::modules/ipi-install-creating-a-disconnected-registry.adoc[leveloffset=+1]
5657

5758
include::modules/ipi-install-deploying-routers-on-worker-nodes.adoc[leveloffset=+1]

modules/ipi-install-additional-install-config-parameters.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,9 @@ The `hosts` parameter is a list of separate bare metal assets used to build the
206206
|
207207
| The MAC address of the NIC that the host uses for the `provisioning` network. Ironic retrieves the IP address using the `bootMACAddress` configuration setting. Then, it binds to the host.
208208

209+
210+
| `networkConfig`
211+
|
212+
| Set this optional parameter to configure the network interface of a host. See "(Optional) Configuring host network interfaces in the `install-config.yaml` file" for additional details.
213+
209214
|===
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// This is included in the following assemblies:
2+
//
3+
// installing_bare_metal_ipi/ipi-install-installation-workflow.adoc
4+
5+
[id="configuring-host-network-interfaces-in-the-install-config.yaml-file_{context}"]
6+
= (Optional) Configuring host network interfaces in the `install-config.yaml` file
7+
8+
During installation, you can set the `networkConfig` configuration setting in the `install-config.yaml` file to configure host network interfaces using NMState. To use the `networkConfig` configuration setting, you must provide an NMState YAML configuration. See link:https://nmstate.io/examples.html#interfaces-ethernet[NMState] for additional examples of the NMState syntax.
9+
10+
.Example
11+
[source,yaml]
12+
----
13+
hosts:
14+
- name: openshift-master-0
15+
role: master
16+
bmc:
17+
address: redfish+http://<out-of-band-ip>/redfish/v1/Systems/
18+
username: <user>
19+
password: <password>
20+
disableCertificateVerification: null
21+
bootMACAddress: <NIC1_mac_address>
22+
bootMode: UEFI
23+
rootDeviceHints:
24+
deviceName: "/dev/sda"
25+
networkConfig: <1>
26+
interfaces:
27+
- name: <NIC1_name>
28+
type: ethernet
29+
state: up
30+
ipv4:
31+
address:
32+
- ip: "<IP_address>"
33+
prefix-length: 24
34+
enabled: true
35+
dns-resolver:
36+
config:
37+
server:
38+
- <DNS_IP_address>
39+
routes:
40+
config:
41+
- destination: 0.0.0.0/0
42+
next-hop-address: <IP_address>
43+
next-hop-interface: <NIC1_name>
44+
----
45+
<1> Add NMState YAML syntax to configure host interfaces.
46+
47+
[TIP]
48+
====
49+
Consider saving the `networkConfig` YAML syntax to a file and testing it using the NMState command line interface before including it in the `install-config.yaml` file, because the installer will not check the NMState YAML syntax. Execute `nmstatectl gc <yaml-config>` to test the syntax. Errors in the YAML syntax might result in a failure to apply the network configuration. Additionally, maintaining the validated YAML syntax is useful when applying changes using Kubernetes NMState after deployment or when expanding the cluster.
50+
====
51+
52+
The most common use case for this functionality is to specify a static IP address on the `baremetal` network, but you can also configure other networks such as a storage network. This functionality will also support other NMState features such as VLAN, VXLAN, bridges, bonds, routes, MTU, and DNS resolver settings.
53+
54+
[IMPORTANT]
55+
====
56+
Once deployed, you cannot modify the `networkConfig` configuration setting of `install-config.yaml` file to make changes to the host network interface. Use the Kubernetes NMState Operator to make changes to the host network interface after deployment.
57+
====

modules/ipi-install-network-requirements.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ For the `baremetal` network, a network administrator must reserve a number of IP
104104
[IMPORTANT]
105105
.Reserving IP addresses so they become static IP addresses
106106
====
107-
Some administrators prefer to use static IP addresses so that each node's IP address remains constant in the absence of a DHCP server. To use static IP addresses in the {product-title} cluster, reserve the IP addresses with an infinite lease. During deployment, the installer will reconfigure the NICs from DHCP assigned addresses to static IP addresses. NICs with DHCP leases that are not infinite will remain configured to use DHCP.
107+
Some administrators prefer to use static IP addresses so that each node's IP address remains constant in the absence of a DHCP server. To configure static IP addresses with NMState, see "(Optional) Configuring host network interfaces in the `install-config.yaml` file" in the "Setting up the environment for an OpenShift installation" section.
108108
====
109109

110110
[IMPORTANT]

modules/ipi-install-preparing-the-bare-metal-node.adoc

Lines changed: 51 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,53 @@
11
// This is included in the following assemblies:
22
//
3-
// ipi-install-expanding-the-cluster.adoc
3+
// installing/installing_bare_metal_ipi/ipi-install-expanding-the-cluster.adoc
44

55
:_content-type: PROCEDURE
66
[id='preparing-the-bare-metal-node_{context}']
7-
87
= Preparing the bare metal node
98

109
Expanding the cluster requires a DHCP server. Each node must have a DHCP reservation.
1110

12-
ifeval::[{product-version}>4.6]
1311
[IMPORTANT]
1412
.Reserving IP addresses so they become static IP addresses
1513
====
16-
Some administrators prefer to use static IP addresses so that each node's IP address remains constant in the absence of a DHCP server. To use static IP addresses in the {product-title} cluster, *reserve the IP addresses in the DHCP server with an infinite lease*. After the installer provisions the node successfully, the dispatcher script will check the node's network configuration. If the dispatcher script finds that the network configuration contains a DHCP infinite lease, it will recreate the connection as a static IP connection using the IP address from the DHCP infinite lease. NICs without DHCP infinite leases will remain unmodified.
14+
Some administrators prefer to use static IP addresses so that each node's IP address remains constant in the absence of a DHCP server. To configure static IP addresses with NMState, see "(Optional) Configuring host network interfaces in the `install-config.yaml` file" in the "Setting up the environment for an OpenShift installation" section for additional details.
1715
====
18-
endif::[]
16+
1917

2018
Preparing the bare metal node requires executing the following procedure from the provisioner node.
2119

2220
.Procedure
2321

2422
. Get the `oc` binary, if needed. It should already exist on the provisioner node.
2523
+
26-
[source,bash]
24+
[source,terminal]
2725
----
2826
[kni@provisioner ~]$ curl -s https://mirror.openshift.com/pub/openshift-v4/clients/ocp/$VERSION/openshift-client-linux-$VERSION.tar.gz | tar zxvf - oc
2927
----
3028
+
31-
[source,bash]
29+
[source,terminal]
3230
----
3331
[kni@provisioner ~]$ sudo cp oc /usr/local/bin
3432
----
3533

36-
. Power off the bare metal node via the baseboard management controller and ensure it is off.
34+
. Power off the bare metal node through the baseboard management controller and ensure it is off.
3735

38-
. Retrieve the user name and password of the bare metal node's baseboard management controller. Then, create `base64` strings from the user name and password. In the following example, the user name is `root` and the password is `calvin`.
36+
. Retrieve the user name and password of the bare metal node's baseboard management controller. Then, create `base64` strings from the user name and password. In the following example, the user name is `root` and the password is `password`.
3937
+
40-
[source,bash]
38+
[source,terminal]
4139
----
4240
[kni@provisioner ~]$ echo -ne "root" | base64
4341
----
4442
+
45-
[source,bash]
43+
[source,terminal]
4644
----
47-
[kni@provisioner ~]$ echo -ne "calvin" | base64
45+
[kni@provisioner ~]$ echo -ne "password" | base64
4846
----
4947

5048
. Create a configuration file for the bare metal node.
5149
+
52-
[source,bash]
50+
[source,terminal]
5351
----
5452
[kni@provisioner ~]$ vim bmh.yaml
5553
----
@@ -60,42 +58,63 @@ Preparing the bare metal node requires executing the following procedure from th
6058
apiVersion: v1
6159
kind: Secret
6260
metadata:
63-
name: openshift-worker-<num>-bmc-secret
61+
name: openshift-worker-<num>-bmc-secret <1>
6462
type: Opaque
6563
data:
66-
username: <base64-of-uid>
67-
password: <base64-of-pwd>
64+
username: <base64-of-uid> <2>
65+
password: <base64-of-pwd> <3>
6866
---
6967
apiVersion: metal3.io/v1alpha1
7068
kind: BareMetalHost
7169
metadata:
72-
name: openshift-worker-<num>
70+
name: openshift-worker-<num> <1>
7371
spec:
7472
online: true
75-
bootMACAddress: <NIC1-mac-address>
73+
bootMACAddress: <NIC1-mac-address> <4>
7674
bmc:
77-
address: <protocol>://<bmc-ip>
78-
credentialsName: openshift-worker-<num>-bmc-secret
79-
----
80-
+
81-
Replace `<num>` for the worker number of the bare metal node in the two `name` fields and the `credentialsName` field. Replace `<base64-of-uid>` with the `base64` string of the user name. Replace `<base64-of-pwd>` with the `base64` string of the password. Replace `<NIC1-mac-address>` with the MAC address of the bare metal node's first NIC.
82-
+
83-
See the BMC addressing section for additional BMC configuration options. Replace `<protocol>` with the BMC protocol, such as IPMI, RedFish, or others.
84-
Replace `<bmc-ip>` with the IP address of the bare metal node's baseboard management controller.
75+
address: <protocol>://<bmc-ip> <5>
76+
credentialsName: openshift-worker-<num>-bmc-secret <1>
77+
networkConfig: <6>
78+
interfaces:
79+
- name: <NIC1_name>
80+
type: ethernet
81+
state: up
82+
ipv4:
83+
address:
84+
- ip: "<IP_address>"
85+
prefix-length: 24
86+
enabled: true
87+
dns-resolver:
88+
config:
89+
server:
90+
- <DNS_IP_address>
91+
routes:
92+
config:
93+
- destination: 0.0.0.0/0
94+
next-hop-address: <IP_address>
95+
next-hop-interface: <NIC1_name>
96+
----
97+
<1> Replace `<num>` for the worker number of the bare metal node in the two `name` fields and the `credentialsName` field.
98+
<2> Replace `<base64-of-uid>` with the `base64` string of the user name.
99+
<3> Replace `<base64-of-pwd>` with the `base64` string of the password.
100+
<4> 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. Replace `<protocol>` with the BMC protocol, such as IPMI, RedFish, or others.
101+
<5> Replace `<bmc-ip>` with the IP address of the bare metal node's baseboard management controller.
102+
<6> Optional. You can set the `networkConfig` configuration option to configure host network interfaces. See "(Optional) Configuring host network interfaces in the `install-config.yaml` file" in the "Setting up the environment for an OpenShift installation" section for configuration details.
85103
+
86104
[NOTE]
87105
====
88-
If the MAC address of an existing bare metal node matches the MAC address of a bare metal host that you are attempting to provision, then the Ironic installation will fail. If the host enrollment, inspection, cleaning, or other Ironic steps fail, the Bare Metal Operator retries the installation continuously. See xref:modules/ipi-install-diagnosing-duplicate-mac-address.adoc#ipi-install-diagnosing-duplicate-mac-address_{context}[Diagnosing a host duplicate MAC address] for more information.
106+
If the MAC address of an existing bare metal node matches the MAC address of a bare metal host that you are attempting to provision, then the Ironic installation will fail. If the host enrollment, inspection, cleaning, or other Ironic steps fail, the Bare Metal Operator retries the installation continuously. See "Diagnosing a host duplicate MAC address" for more information.
89107
====
90108

91109
. Create the bare metal node.
92110
+
93-
[source,bash]
111+
[source,terminal]
94112
----
95113
[kni@provisioner ~]$ oc -n openshift-machine-api create -f bmh.yaml
96114
----
97115
+
98-
[source,bash]
116+
.Example output
117+
[source,terminal]
99118
----
100119
secret/openshift-worker-<num>-bmc-secret created
101120
baremetalhost.metal3.io/openshift-worker-<num> created
@@ -105,14 +124,15 @@ Where `<num>` will be the worker number.
105124

106125
. Power up and inspect the bare metal node.
107126
+
108-
[source,bash]
127+
[source,terminal]
109128
----
110129
[kni@provisioner ~]$ oc -n openshift-machine-api get bmh openshift-worker-<num>
111130
----
112131
+
113132
Where `<num>` is the worker node number.
114133
+
115-
[source,bash]
134+
.Example output
135+
[source,terminal]
116136
----
117137
NAME STATUS PROVISIONING STATUS CONSUMER BMC HARDWARE PROFILE ONLINE ERROR
118138
openshift-worker-<num> OK ready ipmi://<out-of-band-ip> unknown true

0 commit comments

Comments
 (0)