Preventing DHCP from assigning an IP address on node reboot
Red Hat OpenShift Container Platform supports deploying an installer-provisioned cluster with static IP addresses on nodes from the baremetal network for environments without a DHCP server. If a DHCP server is present on the baremetal netowrk, to prevent a DHCP server from assigning an IP address in lieu of a static IP address, use this procedure.
Procedure
-
Before installation, create machineconfig manifests for both control plane nodes and worker nodes:
apiVersion: machineconfiguration.openshift.io/v1 kind: MachineConfig metadata: labels: machineconfiguration.openshift.io/role: <role> name: 10-static-workaround-<role> spec: config: ignition: version: 3.2.0 systemd: units: - contents: | [Unit] Description=Static IP Workaround Wants=NetworkManager-wait-online.service After=NetworkManager-wait-online.service Before=ovs-configuration.service [Service] Type=oneshot ExecStart=/bin/bash -c "for i in $(nmcli --fields NAME,UUID -t con show | grep 'Wired Connection' | awk -F : '{print $2}'); do nmcli con modify $i match.interface-name '!<interface_name>'; done" [Install] WantedBy=multi-user.target enabled: true name: static-workaround.serviceReplace
<role>with the role of the node. This should bemasterorworker. Replace<interface_name>with the name of the network interface. For example,enp2s0. -
Copy the manifests to the same directory as the generated manifests. They must be in the same directory as other manifests as detailed in Creating the OpenShift Container Platform manifests. Ensure that you create a manifest for each role.
-
Proceed with installation.