Setting up the environment for an OpenShift installation

Installing Fedora on the provisioner node

With the configuration of the prerequisites complete, the next step is to install Fedora 35 on the provisioner node. The installer uses the provisioner node as the orchestrator while installing the OKD cluster. For the purposes of this document, installing Fedora on the provisioner node is out of scope. However, options include but are not limited to using a RHEL Satellite server, PXE, or installation media.

Preparing the provisioner node for OKD installation

Perform the following steps to prepare the environment.

Procedure

  1. Log in to the provisioner node via ssh.

  2. Create a non-root user (kni) and provide that user with sudo privileges:

    1. # useradd kni
    1. # passwd kni
    1. # echo "kni ALL=(root) NOPASSWD:ALL" | tee -a /etc/sudoers.d/kni
    1. # chmod 0440 /etc/sudoers.d/kni
  3. Create an ssh key for the new user:

    1. # su - kni -c "ssh-keygen -t ed25519 -f /home/kni/.ssh/id_rsa -N ''"
  4. Log in as the new user on the provisioner node:

    1. # su - kni
  5. Install the following packages:

    1. $ sudo dnf install -y libvirt qemu-kvm mkisofs python3-devel jq ipmitool
  6. Modify the user to add the libvirt group to the newly created user:

    1. $ sudo usermod --append --groups libvirt <user>
  7. Restart firewalld and enable the http service:

    1. $ sudo systemctl start firewalld
    1. $ sudo firewall-cmd --zone=public --add-service=http --permanent
    1. $ sudo firewall-cmd --reload
  8. Start and enable the libvirtd service:

    1. $ sudo systemctl enable libvirtd --now
  9. Create the default storage pool and start it:

    1. $ sudo virsh pool-define-as --name default --type dir --target /var/lib/libvirt/images
    1. $ sudo virsh pool-start default
    1. $ sudo virsh pool-autostart default
  10. Create a pull-secret.txt file:

    1. $ vim pull-secret.txt

    In a web browser, navigate to Install OpenShift on Bare Metal with installer-provisioned infrastructure. Click Copy pull secret. Paste the contents into the pull-secret.txt file and save the contents in the kni user’s home directory.

Configuring networking

Before installation, you must configure the networking on the provisioner node. Installer-provisioned clusters deploy with a baremetal bridge and network, and an optional provisioning bridge and network.

Configure networking

You can also configure networking from the web console.

Procedure

  1. Export the baremetal network NIC name:

    1. $ export PUB_CONN=<baremetal_nic_name>
  2. Configure the baremetal network:

    1. $ sudo nohup bash -c "
    2. nmcli con down \"$PUB_CONN\"
    3. nmcli con delete \"$PUB_CONN\"
    4. # RHEL 8.1 appends the word \"System\" in front of the connection, delete in case it exists
    5. nmcli con down \"System $PUB_CONN\"
    6. nmcli con delete \"System $PUB_CONN\"
    7. nmcli connection add ifname baremetal type bridge con-name baremetal
    8. nmcli con add type bridge-slave ifname \"$PUB_CONN\" master baremetal
    9. pkill dhclient;dhclient baremetal
    10. "

    The ssh connection might disconnect after executing these steps.

  3. Optional: If you are deploying with a provisioning network, export the provisioning network NIC name:

    1. $ export PROV_CONN=<prov_nic_name>
  4. Optional: If you are deploying with a provisioning network, configure the provisioning network:

    1. $ sudo nohup bash -c "
    2. nmcli con down \"$PROV_CONN\"
    3. nmcli con delete \"$PROV_CONN\"
    4. nmcli connection add ifname provisioning type bridge con-name provisioning
    5. nmcli con add type bridge-slave ifname \"$PROV_CONN\" master provisioning
    6. nmcli connection modify provisioning ipv6.addresses fd00:1101::1/64 ipv6.method manual
    7. nmcli con down provisioning
    8. nmcli con up provisioning
    9. "

    The ssh connection might disconnect after executing these steps.

    The IPv6 address can be any address as long as it is not routable via the baremetal network.

    Ensure that UEFI is enabled and UEFI PXE settings are set to the IPv6 protocol when using IPv6 addressing.

  5. Optional: If you are deploying with a provisioning network, configure the IPv4 address on the provisioning network connection:

    1. $ nmcli connection modify provisioning ipv4.addresses 172.22.0.254/24 ipv4.method manual
  6. ssh back into the provisioner node (if required):

    1. # ssh kni@provisioner.<cluster-name>.<domain>
  7. Verify the connection bridges have been properly created:

    1. $ sudo nmcli con show
    1. NAME UUID TYPE DEVICE
    2. baremetal 4d5133a5-8351-4bb9-bfd4-3af264801530 bridge baremetal
    3. provisioning 43942805-017f-4d7d-a2c2-7cb3324482ed bridge provisioning
    4. virbr0 d9bca40f-eee1-410b-8879-a2d4bb0465e7 bridge virbr0
    5. bridge-slave-eno1 76a8ed50-c7e5-4999-b4f6-6d9014dd0812 ethernet eno1
    6. bridge-slave-eno2 f31c3353-54b7-48de-893a-02d2b34c4736 ethernet eno2

Retrieving the OKD installer

Use the stable-4.x version of the installation program and your selected architecture to deploy the generally available stable version of OKD:

  1. $ export VERSION=stable-4.12
  1. $ export RELEASE_ARCH=<architecture>
  1. $ export RELEASE_IMAGE=$(curl -s https://mirror.openshift.com/pub/openshift-v4/$RELEASE_ARCH/clients/ocp/$VERSION/release.txt | grep 'Pull From: quay.io' | awk -F ' ' '{print $3}')

Extracting the OKD installer

After retrieving the installer, the next step is to extract it.

Procedure

  1. Set the environment variables:

    1. $ export cmd=openshift-baremetal-install
    1. $ export pullsecret_file=~/pull-secret.txt
    1. $ export extract_dir=$(pwd)
  2. Get the oc binary:

    1. $ curl -s https://mirror.openshift.com/pub/openshift-v4/clients/ocp/$VERSION/openshift-client-linux.tar.gz | tar zxvf - oc
  3. Extract the installer:

    1. $ sudo cp oc /usr/local/bin
    1. $ oc adm release extract --registry-config "${pullsecret_file}" --command=$cmd --to "${extract_dir}" ${RELEASE_IMAGE}
    1. $ sudo cp openshift-baremetal-install /usr/local/bin

Optional: Creating an FCOS images cache

To employ image caching, you must download the Fedora CoreOS (FCOS) image used by the bootstrap VM to provision the cluster nodes. Image caching is optional, but it is especially useful when running the installation program on a network with limited bandwidth.

The installation program no longer needs the clusterOSImage FCOS image because the correct image is in the release payload.

If you are running the installation program on a network with limited bandwidth and the FCOS images download takes more than 15 to 20 minutes, the installation program will timeout. Caching images on a web server will help in such scenarios.

If you enable TLS for the HTTPD server, you must confirm the root certificate is signed by an authority trusted by the client and verify the trusted certificate chain between your OKD hub and spoke clusters and the HTTPD server. Using a server configured with an untrusted certificate prevents the images from being downloaded to the image creation service. Using untrusted HTTPS servers is not supported.

Install a container that contains the images.

Procedure

  1. Install podman:

    1. $ sudo dnf install -y podman
  2. Open firewall port 8080 to be used for FCOS image caching:

    1. $ sudo firewall-cmd --add-port=8080/tcp --zone=public --permanent
    1. $ sudo firewall-cmd --reload
  3. Create a directory to store the bootstraposimage:

    1. $ mkdir /home/kni/rhcos_image_cache
  4. Set the appropriate SELinux context for the newly created directory:

    1. $ sudo semanage fcontext -a -t httpd_sys_content_t "/home/kni/rhcos_image_cache(/.*)?"
    1. $ sudo restorecon -Rv /home/kni/rhcos_image_cache/
  5. Get the URI for the FCOS image that the installation program will deploy on the bootstrap VM:

    1. $ export RHCOS_QEMU_URI=$(/usr/local/bin/openshift-baremetal-install coreos print-stream-json | jq -r --arg ARCH "$(arch)" '.architectures[$ARCH].artifacts.qemu.formats["qcow2.gz"].disk.location')
  6. Get the name of the image that the installation program will deploy on the bootstrap VM:

    1. $ export RHCOS_QEMU_NAME=${RHCOS_QEMU_URI##*/}
  7. Get the SHA hash for the FCOS image that will be deployed on the bootstrap VM:

    1. $ export RHCOS_QEMU_UNCOMPRESSED_SHA256=$(/usr/local/bin/openshift-baremetal-install coreos print-stream-json | jq -r --arg ARCH "$(arch)" '.architectures[$ARCH].artifacts.qemu.formats["qcow2.gz"].disk["uncompressed-sha256"]')
  8. Download the image and place it in the /home/kni/rhcos_image_cache directory:

    1. $ curl -L ${RHCOS_QEMU_URI} -o /home/kni/rhcos_image_cache/${RHCOS_QEMU_NAME}
  9. Confirm SELinux type is of httpd_sys_content_t for the new file:

    1. $ ls -Z /home/kni/rhcos_image_cache
  10. Create the pod:

    1. $ podman run -d --name rhcos_image_cache \ (1)
    2. -v /home/kni/rhcos_image_cache:/var/www/html \
    3. -p 8080:8080/tcp \
    4. quay.io/centos7/httpd-24-centos7:latest
    1Creates a caching webserver with the name rhcos_image_cache. This pod serves the bootstrapOSImage image in the install-config.yaml file for deployment.
  11. Generate the bootstrapOSImage configuration:

    1. $ export BAREMETAL_IP=$(ip addr show dev baremetal | awk '/inet /{print $2}' | cut -d"/" -f1)
    1. $ export BOOTSTRAP_OS_IMAGE="http://${BAREMETAL_IP}:8080/${RHCOS_QEMU_NAME}?sha256=${RHCOS_QEMU_UNCOMPRESSED_SHA256}"
    1. $ echo " bootstrapOSImage=${BOOTSTRAP_OS_IMAGE}"
  12. Add the required configuration to the install-config.yaml file under platform.baremetal:

    1. platform:
    2. baremetal:
    3. bootstrapOSImage: <bootstrap_os_image> (1)
    1Replace <bootstrap_os_image> with the value of $BOOTSTRAP_OS_IMAGE.

    See the “Configuring the install-config.yaml file” section for additional details.

Configuring the install-config.yaml file

Configuring the install-config.yaml file

The install-config.yaml file requires some additional details. Most of the information teaches the installation program and the resulting cluster enough about the available hardware that it is able to fully manage it.

The installation program no longer needs the clusterOSImage FCOS image because the correct image is in the release payload.

  1. Configure install-config.yaml. Change the appropriate variables to match the environment, including pullSecret and sshKey:

    1. apiVersion: v1
    2. baseDomain: <domain>
    3. metadata:
    4. name: <cluster_name>
    5. networking:
    6. machineNetwork:
    7. - cidr: <public_cidr>
    8. networkType: OVNKubernetes
    9. compute:
    10. - name: worker
    11. replicas: 2 (1)
    12. controlPlane:
    13. name: master
    14. replicas: 3
    15. platform:
    16. baremetal: {}
    17. platform:
    18. baremetal:
    19. apiVIPs:
    20. - <api_ip>
    21. ingressVIPs:
    22. - <wildcard_ip>
    23. provisioningNetworkCIDR: <CIDR>
    24. bootstrapExternalStaticIP: <bootstrap_static_ip_address> (2)
    25. bootstrapExternalStaticGateway: <bootstrap_static_gateway> (3)
    26. hosts:
    27. - name: openshift-master-0
    28. role: master
    29. bmc:
    30. address: ipmi://<out_of_band_ip> (4)
    31. username: <user>
    32. password: <password>
    33. bootMACAddress: <NIC1_mac_address>
    34. rootDeviceHints:
    35. deviceName: "/dev/disk/by-id/<disk_id>" (5)
    36. - name: <openshift_master_1>
    37. role: master
    38. bmc:
    39. address: ipmi://<out_of_band_ip> (4)
    40. username: <user>
    41. password: <password>
    42. bootMACAddress: <NIC1_mac_address>
    43. rootDeviceHints:
    44. deviceName: "/dev/disk/by-id/<disk_id>" (5)
    45. - name: <openshift_master_2>
    46. role: master
    47. bmc:
    48. address: ipmi://<out_of_band_ip> (4)
    49. username: <user>
    50. password: <password>
    51. bootMACAddress: <NIC1_mac_address>
    52. rootDeviceHints:
    53. deviceName: "/dev/disk/by-id/<disk_id>" (5)
    54. - name: <openshift_worker_0>
    55. role: worker
    56. bmc:
    57. address: ipmi://<out_of_band_ip> (4)
    58. username: <user>
    59. password: <password>
    60. bootMACAddress: <NIC1_mac_address>
    61. - name: <openshift_worker_1>
    62. role: worker
    63. bmc:
    64. address: ipmi://<out_of_band_ip>
    65. username: <user>
    66. password: <password>
    67. bootMACAddress: <NIC1_mac_address>
    68. rootDeviceHints:
    69. deviceName: "/dev/disk/by-id/<disk_id>" (5)
    70. pullSecret: '<pull_secret>'
    71. sshKey: '<ssh_pub_key>'
    1Scale the worker machines based on the number of worker nodes that are part of the OKD cluster. Valid options for the replicas value are 0 and integers greater than or equal to 2. Set the number of replicas to 0 to deploy a three-node cluster, which contains only three control plane machines. A three-node cluster is a smaller, more resource-efficient cluster that can be used for testing, development, and production. You cannot install the cluster with only one worker.
    2When deploying a cluster with static IP addresses, you must set the bootstrapExternalStaticIP configuration setting to specify the static IP address of the bootstrap VM when there is no DHCP server on the baremetal network.
    3When deploying a cluster with static IP addresses, you must set the bootstrapExternalStaticGateway configuration setting to specify the gateway IP address for the bootstrap VM when there is no DHCP server on the baremetal network.
    4See the BMC addressing sections for more options.
    5Set the path to the installation disk drive, for example, /dev/disk/by-id/wwn-0x64cd98f04fde100024684cf3034da5c2.

Before OKD 4.12, the cluster installation program only accepted an IPv4 address or and IPv6 address for the apiVIP and ingressVIP configuration settings. In OKD 4.12 and later, these configuration settings are deprecated. Instead, use a list format in the apiVIPs and ingressVIPs configuration settings to specify IPv4 addresses, IPv6 addresses or both IP address formats.

  1. Create a directory to store the cluster configuration:

    1. $ mkdir ~/clusterconfigs
  2. Copy the install-config.yaml file to the new directory:

    1. $ cp install-config.yaml ~/clusterconfigs
  3. Ensure all bare metal nodes are powered off prior to installing the OKD cluster:

    1. $ ipmitool -I lanplus -U <user> -P <password> -H <management-server-ip> power off
  4. Remove old bootstrap resources if any are left over from a previous deployment attempt:

    1. for i in $(sudo virsh list | tail -n +3 | grep bootstrap | awk {'print $2'});
    2. do
    3. sudo virsh destroy $i;
    4. sudo virsh undefine $i;
    5. sudo virsh vol-delete $i --pool $i;
    6. sudo virsh vol-delete $i.ign --pool $i;
    7. sudo virsh pool-destroy $i;
    8. sudo virsh pool-undefine $i;
    9. done

Additional install-config parameters

See the following tables for the required parameters, the hosts parameter, and the bmc parameter for the install-config.yaml file.

Table 1. Required parameters
ParametersDefaultDescription

baseDomain

The domain name for the cluster. For example, example.com.

bootMode

UEFI

The boot mode for a node. Options are legacy, UEFI, and UEFISecureBoot. If bootMode is not set, Ironic sets it while inspecting the node.

bootstrapExternalStaticIP

The static IP address for the bootstrap VM. You must set this value when deploying a cluster with static IP addresses when there is no DHCP server on the baremetal network.

bootstrapExternalStaticGateway

The static IP address of the gateway for the bootstrap VM. You must set this value when deploying a cluster with static IP addresses when there is no DHCP server on the baremetal network.

sshKey

The sshKey configuration setting contains the key in the ~/.ssh/id_rsa.pub file required to access the control plane nodes and worker nodes. Typically, this key is from the provisioner node.

pullSecret

The pullSecret configuration setting contains a copy of the pull secret downloaded from the Install OpenShift on Bare Metal page when preparing the provisioner node.

  1. metadata:
  2. name:

The name to be given to the OKD cluster. For example, openshift.

  1. networking:
  2. machineNetwork:
  3. - cidr:

The public CIDR (Classless Inter-Domain Routing) of the external network. For example, 10.0.0.0/24.

  1. compute:
  2. - name: worker

The OKD cluster requires a name be provided for worker (or compute) nodes even if there are zero nodes.

  1. compute:
  2. replicas: 2

Replicas sets the number of worker (or compute) nodes in the OKD cluster.

  1. controlPlane:
  2. name: master

The OKD cluster requires a name for control plane (master) nodes.

  1. controlPlane:
  2. replicas: 3

Replicas sets the number of control plane (master) nodes included as part of the OKD cluster.

provisioningNetworkInterface

The name of the network interface on nodes connected to the provisioning network. For OKD 4.9 and later releases, use the bootMACAddress configuration setting to enable Ironic to identify the IP address of the NIC instead of using the provisioningNetworkInterface configuration setting to identify the name of the NIC.

defaultMachinePlatform

The default configuration used for machine pools without a platform configuration.

apiVIPs

(Optional) The virtual IP address for Kubernetes API communication.

This setting must either be provided in the install-config.yaml file as a reserved IP from the MachineNetwork or pre-configured in the DNS so that the default name resolves correctly. Use the virtual IP address and not the FQDN when adding a value to the apiVIPs configuration setting in the install-config.yaml file. The primary IP address must be from the IPv4 network when using dual stack networking. If not set, the installation program uses api.<cluster_name>.<base_domain> to derive the IP address from the DNS.

Before OKD 4.12, the cluster installation program only accepted an IPv4 address or an IPv6 address for the apiVIP configuration setting. From OKD 4.12 or later, the apiVIP configuration setting is deprecated. Instead, use a list format for the apiVIPs configuration setting to specify an IPv4 address, an IPv6 address or both IP address formats.

disableCertificateVerification

False

redfish and redfish-virtualmedia need this parameter to manage BMC addresses. The value should be True when using a self-signed certificate for BMC addresses.

ingressVIPs

(Optional) The virtual IP address for ingress traffic.

This setting must either be provided in the install-config.yaml file as a reserved IP from the MachineNetwork or pre-configured in the DNS so that the default name resolves correctly. Use the virtual IP address and not the FQDN when adding a value to the ingressVIPs configuration setting in the install-config.yaml file. The primary IP address must be from the IPv4 network when using dual stack networking. If not set, the installation program uses test.apps.<cluster_name>.<base_domain> to derive the IP address from the DNS.

Before OKD 4.12, the cluster installation program only accepted an IPv4 address or an IPv6 address for the ingressVIP configuration setting. In OKD 4.12 and later, the ingressVIP configuration setting is deprecated. Instead, use a list format for the ingressVIPs configuration setting to specify an IPv4 addresses, an IPv6 addresses or both IP address formats.

Table 2. Optional Parameters
ParametersDefaultDescription

provisioningDHCPRange

172.22.0.10,172.22.0.100

Defines the IP range for nodes on the provisioning network.

provisioningNetworkCIDR

172.22.0.0/24

The CIDR for the network to use for provisioning. This option is required when not using the default address range on the provisioning network.

clusterProvisioningIP

The third IP address of the provisioningNetworkCIDR.

The IP address within the cluster where the provisioning services run. Defaults to the third IP address of the provisioning subnet. For example, 172.22.0.3.

bootstrapProvisioningIP

The second IP address of the provisioningNetworkCIDR.

The IP address on the bootstrap VM where the provisioning services run while the installer is deploying the control plane (master) nodes. Defaults to the second IP address of the provisioning subnet. For example, 172.22.0.2 or 2620:52:0:1307::2.

externalBridge

baremetal

The name of the baremetal bridge of the hypervisor attached to the baremetal network.

provisioningBridge

provisioning

The name of the provisioning bridge on the provisioner host attached to the provisioning network.

architecture

Defines the host architecture for your cluster. Valid values are amd64 or arm64.

defaultMachinePlatform

The default configuration used for machine pools without a platform configuration.

bootstrapOSImage

A URL to override the default operating system image for the bootstrap node. The URL must contain a SHA-256 hash of the image. For example: https://mirror.openshift.com/rhcos-<version>-qemu.qcow2.gz?sha256=<uncompressed_sha256>;.

provisioningNetwork

The provisioningNetwork configuration setting determines whether the cluster uses the provisioning network. If it does, the configuration setting also determines if the cluster manages the network.

Disabled: Set this parameter to Disabled to disable the requirement for a provisioning network. When set to Disabled, you must only use virtual media based provisioning, or bring up the cluster using the assisted installer. If Disabled and using power management, BMCs must be accessible from the baremetal network. If Disabled, you must provide two IP addresses on the baremetal network that are used for the provisioning services.

Managed: Set this parameter to Managed, which is the default, to fully manage the provisioning network, including DHCP, TFTP, and so on.

Unmanaged: Set this parameter to Unmanaged to enable the provisioning network but take care of manual configuration of DHCP. Virtual media provisioning is recommended but PXE is still available if required.

httpProxy

Set this parameter to the appropriate HTTP proxy used within your environment.

httpsProxy

Set this parameter to the appropriate HTTPS proxy used within your environment.

noProxy

Set this parameter to the appropriate list of exclusions for proxy usage within your environment.

Hosts

The hosts parameter is a list of separate bare metal assets used to build the cluster.

Table 3. Hosts
NameDefaultDescription

name

The name of the BareMetalHost resource to associate with the details. For example, openshift-master-0.

role

The role of the bare metal node. Either master or worker.

bmc

Connection details for the baseboard management controller. See the BMC addressing section for additional details.

bootMACAddress

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.

You must provide a valid MAC address from the host if you disabled the provisioning network.

networkConfig

Set this optional parameter to configure the network interface of a host. See “(Optional) Configuring host network interfaces” for additional details.

BMC addressing

Most vendors support Baseboard Management Controller (BMC) addressing with the Intelligent Platform Management Interface (IPMI). IPMI does not encrypt communications. It is suitable for use within a data center over a secured or dedicated management network. Check with your vendor to see if they support Redfish network boot. Redfish delivers simple and secure management for converged, hybrid IT and the Software Defined Data Center (SDDC). Redfish is human readable and machine capable, and leverages common internet and web services standards to expose information directly to the modern tool chain. If your hardware does not support Redfish network boot, use IPMI.

IPMI

Hosts using IPMI use the ipmi://<out-of-band-ip>:<port> address format, which defaults to port 623 if not specified. The following example demonstrates an IPMI configuration within the install-config.yaml file.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: openshift-master-0
  5. role: master
  6. bmc:
  7. address: ipmi://<out-of-band-ip>
  8. username: <user>
  9. password: <password>

The provisioning network is required when PXE booting using IPMI for BMC addressing. It is not possible to PXE boot hosts without a provisioning network. If you deploy without a provisioning network, you must use a virtual media BMC addressing option such as redfish-virtualmedia or idrac-virtualmedia. See “Redfish virtual media for HPE iLO” in the “BMC addressing for HPE iLO” section or “Redfish virtual media for Dell iDRAC” in the “BMC addressing for Dell iDRAC” section for additional details.

Redfish network boot

To enable Redfish, use redfish:// or redfish+http:// to disable TLS. The installer requires both the hostname or the IP address and the path to the system ID. The following example demonstrates a Redfish configuration within the install-config.yaml file.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: openshift-master-0
  5. role: master
  6. bmc:
  7. address: redfish://<out-of-band-ip>/redfish/v1/Systems/1
  8. username: <user>
  9. password: <password>

While it is recommended to have a certificate of authority for the out-of-band management addresses, you must include disableCertificateVerification: True in the bmc configuration if using self-signed certificates. The following example demonstrates a Redfish configuration using the disableCertificateVerification: True configuration parameter within the install-config.yaml file.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: openshift-master-0
  5. role: master
  6. bmc:
  7. address: redfish://<out-of-band-ip>/redfish/v1/Systems/1
  8. username: <user>
  9. password: <password>
  10. disableCertificateVerification: True

Redfish APIs

Several redfish API endpoints are called onto your BCM when using the bare-metal installer-provisioned infrastructure.

You need to ensure that your BMC supports all of the redfish APIs before installation.

List of redfish APIs

  • Power on

    1. curl -u $USER:$PASS -X POST -H'Content-Type: application/json' -H'Accept: application/json' -d '{"Action": "Reset", "ResetType": "On"}' https://$SERVER/redfish/v1/Systems/$SystemID/Actions/ComputerSystem.Reset
  • Power off

    1. curl -u $USER:$PASS -X POST -H'Content-Type: application/json' -H'Accept: application/json' -d '{"Action": "Reset", "ResetType": "ForceOff"}' https://$SERVER/redfish/v1/Systems/$SystemID/Actions/ComputerSystem.Reset
  • Temporary boot using pxe

    1. curl -u $USER:$PASS -X PATCH -H "Content-Type: application/json" https://$Server/redfish/v1/Systems/$SystemID/ -d '{"Boot": {"BootSourceOverrideTarget": "pxe", "BootSourceOverrideEnabled": "Once"}}
  • Set BIOS boot mode using Legacy or UEFI

    1. curl -u $USER:$PASS -X PATCH -H "Content-Type: application/json" https://$Server/redfish/v1/Systems/$SystemID/ -d '{"Boot": {"BootSourceOverrideMode":"UEFI"}}

List of redfish-virtualmedia APIs

  • Set temporary boot device using cd or dvd

    1. curl -u $USER:$PASS -X PATCH -H "Content-Type: application/json" https://$Server/redfish/v1/Systems/$SystemID/ -d '{"Boot": {"BootSourceOverrideTarget": "cd", "BootSourceOverrideEnabled": "Once"}}'
  • Mount virtual media

    1. curl -u $USER:$PASS -X PATCH -H "Content-Type: application/json" -H "If-Match: *" https://$Server/redfish/v1/Managers/$ManagerID/VirtualMedia/$VmediaId -d '{"Image": "https://example.com/test.iso", "TransferProtocolType": "HTTPS", "UserName": "", "Password":""}'

The PowerOn and PowerOff commands for redfish APIs are the same for the redfish-virtualmedia APIs.

HTTPS and HTTP are the only supported parameter types for TransferProtocolTypes.

BMC addressing for Dell iDRAC

The address field for each bmc entry is a URL for connecting to the OKD cluster nodes, including the type of controller in the URL scheme and its location on the network.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: <hostname>
  5. role: <master | worker>
  6. bmc:
  7. address: <address> (1)
  8. username: <user>
  9. password: <password>
1The address configuration setting specifies the protocol.

For Dell hardware, Red Hat supports integrated Dell Remote Access Controller (iDRAC) virtual media, Redfish network boot, and IPMI.

BMC address formats for Dell iDRAC

ProtocolAddress Format

iDRAC virtual media

idrac-virtualmedia://<out-of-band-ip>/redfish/v1/Systems/System.Embedded.1

Redfish network boot

redfish://<out-of-band-ip>/redfish/v1/Systems/System.Embedded.1

IPMI

ipmi://<out-of-band-ip>

Use idrac-virtualmedia as the protocol for Redfish virtual media. redfish-virtualmedia will not work on Dell hardware. Dell’s idrac-virtualmedia uses the Redfish standard with Dell’s OEM extensions.

See the following sections for additional details.

Redfish virtual media for Dell iDRAC

For Redfish virtual media on Dell servers, use idrac-virtualmedia:// in the address setting. Using redfish-virtualmedia:// will not work.

The following example demonstrates using iDRAC virtual media within the install-config.yaml file.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: openshift-master-0
  5. role: master
  6. bmc:
  7. address: idrac-virtualmedia://<out-of-band-ip>/redfish/v1/Systems/System.Embedded.1
  8. username: <user>
  9. password: <password>

While it is recommended to have a certificate of authority for the out-of-band management addresses, you must include disableCertificateVerification: True in the bmc configuration if using self-signed certificates. The following example demonstrates a Redfish configuration using the disableCertificateVerification: True configuration parameter within the install-config.yaml file.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: openshift-master-0
  5. role: master
  6. bmc:
  7. address: idrac-virtualmedia://<out-of-band-ip>/redfish/v1/Systems/System.Embedded.1
  8. username: <user>
  9. password: <password>
  10. disableCertificateVerification: True

There is a known issue on Dell iDRAC 9 with firmware version 04.40.00.00 or later for installer-provisioned installations on bare metal deployments. The Virtual Console plugin defaults to eHTML5, an enhanced version of HTML5, which causes problems with the InsertVirtualMedia workflow. Set the plugin to use HTML5 to avoid this issue. The menu path is ConfigurationVirtual consolePlug-in TypeHTML5 .

Ensure the OKD cluster nodes have AutoAttach enabled through the iDRAC console. The menu path is: ConfigurationVirtual MediaAttach ModeAutoAttach .

Use idrac-virtualmedia:// as the protocol for Redfish virtual media. Using redfish-virtualmedia:// will not work on Dell hardware, because the idrac-virtualmedia:// protocol corresponds to the idrac hardware type and the Redfish protocol in Ironic. Dell’s idrac-virtualmedia:// protocol uses the Redfish standard with Dell’s OEM extensions. Ironic also supports the idrac type with the WSMAN protocol. Therefore, you must specify idrac-virtualmedia:// to avoid unexpected behavior when electing to use Redfish with virtual media on Dell hardware.

Redfish network boot for iDRAC

To enable Redfish, use redfish:// or redfish+http:// to disable transport layer security (TLS). The installer requires both the hostname or the IP address and the path to the system ID. The following example demonstrates a Redfish configuration within the install-config.yaml file.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: openshift-master-0
  5. role: master
  6. bmc:
  7. address: redfish://<out-of-band-ip>/redfish/v1/Systems/System.Embedded.1
  8. username: <user>
  9. password: <password>

While it is recommended to have a certificate of authority for the out-of-band management addresses, you must include disableCertificateVerification: True in the bmc configuration if using self-signed certificates. The following example demonstrates a Redfish configuration using the disableCertificateVerification: True configuration parameter within the install-config.yaml file.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: openshift-master-0
  5. role: master
  6. bmc:
  7. address: redfish://<out-of-band-ip>/redfish/v1/Systems/System.Embedded.1
  8. username: <user>
  9. password: <password>
  10. disableCertificateVerification: True

There is a known issue on Dell iDRAC 9 with firmware version 04.40.00.00 or later for installer-provisioned installations on bare metal deployments. The Virtual Console plugin defaults to eHTML5, an enhanced version of HTML5, which causes problems with the InsertVirtualMedia workflow. Set the plugin to use HTML5 to avoid this issue. The menu path is ConfigurationVirtual consolePlug-in TypeHTML5 .

Ensure the OKD cluster nodes have AutoAttach enabled through the iDRAC console. The menu path is: ConfigurationVirtual MediaAttach ModeAutoAttach .

The redfish:// URL protocol corresponds to the redfish hardware type in Ironic.

BMC addressing for HPE iLO

The address field for each bmc entry is a URL for connecting to the OKD cluster nodes, including the type of controller in the URL scheme and its location on the network.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: <hostname>
  5. role: <master | worker>
  6. bmc:
  7. address: <address> (1)
  8. username: <user>
  9. password: <password>
1The address configuration setting specifies the protocol.

For HPE integrated Lights Out (iLO), Red Hat supports Redfish virtual media, Redfish network boot, and IPMI.

Table 4. BMC address formats for HPE iLO
ProtocolAddress Format

Redfish virtual media

redfish-virtualmedia://<out-of-band-ip>/redfish/v1/Systems/1

Redfish network boot

redfish://<out-of-band-ip>/redfish/v1/Systems/1

IPMI

ipmi://<out-of-band-ip>

See the following sections for additional details.

Redfish virtual media for HPE iLO

To enable Redfish virtual media for HPE servers, use redfish-virtualmedia:// in the address setting. The following example demonstrates using Redfish virtual media within the install-config.yaml file.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: openshift-master-0
  5. role: master
  6. bmc:
  7. address: redfish-virtualmedia://<out-of-band-ip>/redfish/v1/Systems/1
  8. username: <user>
  9. password: <password>

While it is recommended to have a certificate of authority for the out-of-band management addresses, you must include disableCertificateVerification: True in the bmc configuration if using self-signed certificates. The following example demonstrates a Redfish configuration using the disableCertificateVerification: True configuration parameter within the install-config.yaml file.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: openshift-master-0
  5. role: master
  6. bmc:
  7. address: redfish-virtualmedia://<out-of-band-ip>/redfish/v1/Systems/1
  8. username: <user>
  9. password: <password>
  10. disableCertificateVerification: True

Redfish virtual media is not supported on 9th generation systems running iLO4, because Ironic does not support iLO4 with virtual media.

Redfish network boot for HPE iLO

To enable Redfish, use redfish:// or redfish+http:// to disable TLS. The installer requires both the hostname or the IP address and the path to the system ID. The following example demonstrates a Redfish configuration within the install-config.yaml file.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: openshift-master-0
  5. role: master
  6. bmc:
  7. address: redfish://<out-of-band-ip>/redfish/v1/Systems/1
  8. username: <user>
  9. password: <password>

While it is recommended to have a certificate of authority for the out-of-band management addresses, you must include disableCertificateVerification: True in the bmc configuration if using self-signed certificates. The following example demonstrates a Redfish configuration using the disableCertificateVerification: True configuration parameter within the install-config.yaml file.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: openshift-master-0
  5. role: master
  6. bmc:
  7. address: redfish://<out-of-band-ip>/redfish/v1/Systems/1
  8. username: <user>
  9. password: <password>
  10. disableCertificateVerification: True

BMC addressing for Fujitsu iRMC

The address field for each bmc entry is a URL for connecting to the OKD cluster nodes, including the type of controller in the URL scheme and its location on the network.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: <hostname>
  5. role: <master | worker>
  6. bmc:
  7. address: <address> (1)
  8. username: <user>
  9. password: <password>
1The address configuration setting specifies the protocol.

For Fujitsu hardware, Red Hat supports integrated Remote Management Controller (iRMC) and IPMI.

Table 5. BMC address formats for Fujitsu iRMC
ProtocolAddress Format

iRMC

irmc://<out-of-band-ip>

IPMI

ipmi://<out-of-band-ip>

iRMC

Fujitsu nodes can use irmc://<out-of-band-ip> and defaults to port 443. The following example demonstrates an iRMC configuration within the install-config.yaml file.

  1. platform:
  2. baremetal:
  3. hosts:
  4. - name: openshift-master-0
  5. role: master
  6. bmc:
  7. address: irmc://<out-of-band-ip>
  8. username: <user>
  9. password: <password>

Currently Fujitsu supports iRMC S5 firmware version 3.05P and above for installer-provisioned installation on bare metal.

Root device hints

The rootDeviceHints parameter enables the installer to provision the Fedora CoreOS (FCOS) image to a particular device. The installer examines the devices in the order it discovers them, and compares the discovered values with the hint values. The installer uses the first discovered device that matches the hint value. The configuration can combine multiple hints, but a device must match all hints for the installer to select it.

Table 6. Subfields
SubfieldDescription

deviceName

A string containing a Linux device name like /dev/vda. The hint must match the actual value exactly.

hctl

A string containing a SCSI bus address like 0:0:0:0. The hint must match the actual value exactly.

model

A string containing a vendor-specific device identifier. The hint can be a substring of the actual value.

vendor

A string containing the name of the vendor or manufacturer of the device. The hint can be a sub-string of the actual value.

serialNumber

A string containing the device serial number. The hint must match the actual value exactly.

minSizeGigabytes

An integer representing the minimum size of the device in gigabytes.

wwn

A string containing the unique storage identifier. The hint must match the actual value exactly.

wwnWithExtension

A string containing the unique storage identifier with the vendor extension appended. The hint must match the actual value exactly.

wwnVendorExtension

A string containing the unique vendor storage identifier. The hint must match the actual value exactly.

rotational

A boolean indicating whether the device should be a rotating disk (true) or not (false).

Example usage

  1. - name: master-0
  2. role: master
  3. bmc:
  4. address: ipmi://10.10.0.3:6203
  5. username: admin
  6. password: redhat
  7. bootMACAddress: de:ad:be:ef:00:40
  8. rootDeviceHints:
  9. deviceName: "/dev/sda"

Optional: Setting proxy settings

To deploy an OKD cluster using a proxy, make the following changes to the install-config.yaml file.

  1. apiVersion: v1
  2. baseDomain: <domain>
  3. proxy:
  4. httpProxy: http://USERNAME:PASSWORD@proxy.example.com:PORT
  5. httpsProxy: https://USERNAME:PASSWORD@proxy.example.com:PORT
  6. noProxy: <WILDCARD_OF_DOMAIN>,<PROVISIONING_NETWORK/CIDR>,<BMC_ADDRESS_RANGE/CIDR>

The following is an example of noProxy with values.

  1. noProxy: .example.com,172.22.0.0/24,10.10.0.0/24

With a proxy enabled, set the appropriate values of the proxy in the corresponding key/value pair.

Key considerations:

  • If the proxy does not have an HTTPS proxy, change the value of httpsProxy from https:// to http://.

  • If using a provisioning network, include it in the noProxy setting, otherwise the installer will fail.

  • Set all of the proxy settings as environment variables within the provisioner node. For example, HTTP_PROXY, HTTPS_PROXY, and NO_PROXY.

When provisioning with IPv6, you cannot define a CIDR address block in the noProxy settings. You must define each address separately.

Optional: Deploying with no provisioning network

To deploy an OKD cluster without a provisioning network, make the following changes to the install-config.yaml file.

  1. platform:
  2. baremetal:
  3. apiVIPs:
  4. - <api_VIP>
  5. ingressVIPs:
  6. - <ingress_VIP>
  7. provisioningNetwork: "Disabled" (1)
1Add the provisioningNetwork configuration setting, if needed, and set it to Disabled.

The provisioning network is required for PXE booting. If you deploy without a provisioning network, you must use a virtual media BMC addressing option such as redfish-virtualmedia or idrac-virtualmedia. See “Redfish virtual media for HPE iLO” in the “BMC addressing for HPE iLO” section or “Redfish virtual media for Dell iDRAC” in the “BMC addressing for Dell iDRAC” section for additional details.

Optional: Deploying with dual-stack networking

For dual-stack networking in OKD clusters, you can configure IPv4 and IPv6 address endpoints for cluster nodes. To configure IPv4 and IPv6 address endpoints for cluster nodes, edit the machineNetwork, clusterNetwork, and serviceNetwork configuration settings in the install-config.yaml file. Each setting must have two CIDR entries each. Ensure the first CIDR entry is the IPv4 setting and the second CIDR entry is the IPv6 setting.

  1. machineNetwork:
  2. - cidr: {{ extcidrnet }}
  3. - cidr: {{ extcidrnet6 }}
  4. clusterNetwork:
  5. - cidr: 10.128.0.0/14
  6. hostPrefix: 23
  7. - cidr: fd02::/48
  8. hostPrefix: 64
  9. serviceNetwork:
  10. - 172.30.0.0/16
  11. - fd03::/112

The API VIP IP address and the Ingress VIP address must be of the primary IP address family when using dual-stack networking. Currently, Red Hat does not support dual-stack VIPs or dual-stack networking with IPv6 as the primary IP address family. However, Red Hat does support dual-stack networking with IPv4 as the primary IP address family. Therefore, the IPv4 entries must go before the IPv6 entries.

To provide an interface to the cluster for applications that use IPv4 and IPv6 addresses, configure IPv4 and IPv6 virtual IP (VIP) address endpoints for the Ingress VIP and API VIP services. To configure IPv4 and IPv6 address endpoints, edit the apiVIPs and ingressVIPs configuration settings in the install-config.yaml file . The apiVIPs and ingressVIPs configuration settings use a list format. The order of the list indicates the primary and secondary VIP address for each service.

  1. platform:
  2. baremetal:
  3. apiVIPs:
  4. - <api_ipv4>
  5. - <api_ipv6>
  6. ingressVIPs:
  7. - <wildcard_ipv4>
  8. - <wildcard_ipv6>

Optional: Configuring host network interfaces

Before installation, you can set the networkConfig configuration setting in the install-config.yaml file to configure host network interfaces using NMState.

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 supports other NMState features such as VLAN, VXLAN, bridges, bonds, routes, MTU, and DNS resolver settings.

Prequisites

  • Configure a PTR DNS record with a valid hostname for each node with a static IP address.

  • Install the NMState CLI (nmstate).

Procedure

  1. Optional: Consider testing the NMState syntax with nmstatectl gc before including it in the install-config.yaml file, because the installer will not check the NMState YAML 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.

    1. Create an NMState YAML file:

      1. interfaces:
      2. - name: <nic1_name> (1)
      3. type: ethernet
      4. state: up
      5. ipv4:
      6. address:
      7. - ip: <ip_address> (1)
      8. prefix-length: 24
      9. enabled: true
      10. dns-resolver:
      11. config:
      12. server:
      13. - <dns_ip_address> (1)
      14. routes:
      15. config:
      16. - destination: 0.0.0.0/0
      17. next-hop-address: <next_hop_ip_address> (1)
      18. next-hop-interface: <next_hop_nic1_name> (1)
      1Replace <nic1_name>, <ip_address>, <dns_ip_address>, <next_hop_ip_address> and <next_hop_nic1_name> with appropriate values.
    2. Test the configuration file by running the following command:

      1. $ nmstatectl gc <nmstate_yaml_file>

      Replace <nmstate_yaml_file> with the configuration file name.

  2. Use the networkConfig configuration setting by adding the NMState configuration to hosts within the install-config.yaml file:

    1. hosts:
    2. - name: openshift-master-0
    3. role: master
    4. bmc:
    5. address: redfish+http://<out_of_band_ip>/redfish/v1/Systems/
    6. username: <user>
    7. password: <password>
    8. disableCertificateVerification: null
    9. bootMACAddress: <NIC1_mac_address>
    10. bootMode: UEFI
    11. rootDeviceHints:
    12. deviceName: "/dev/sda"
    13. networkConfig: (1)
    14. interfaces:
    15. - name: <nic1_name> (2)
    16. type: ethernet
    17. state: up
    18. ipv4:
    19. address:
    20. - ip: <ip_address> (2)
    21. prefix-length: 24
    22. enabled: true
    23. dns-resolver:
    24. config:
    25. server:
    26. - <dns_ip_address> (2)
    27. routes:
    28. config:
    29. - destination: 0.0.0.0/0
    30. next-hop-address: <next_hop_ip_address> (2)
    31. next-hop-interface: <next_hop_nic1_name> (2)
    1Add the NMState YAML syntax to configure the host interfaces.
    2Replace <nic1_name>, <ip_address>, <dns_ip_address>, <next_hop_ip_address> and <next_hop_nic1_name> with appropriate values.

    After deploying the cluster, 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.

Configuring multiple cluster nodes

You can simultaneously configure OKD cluster nodes with identical settings. Configuring multiple cluster nodes avoids adding redundant information for each node to the install-config.yaml file. This file contains specific parameters to apply an identical configuration to multiple nodes in the cluster.

Compute nodes are configured separately from the controller node. However, configurations for both node types use the highlighted parameters in the install-config.yaml file to enable multi-node configuration. Set the networkConfig parameters to BOND, as shown in the following example:

  1. hosts:
  2. - name: ostest-master-0
  3. [...]
  4. networkConfig: &BOND
  5. interfaces:
  6. - name: bond0
  7. type: bond
  8. state: up
  9. ipv4:
  10. dhcp: true
  11. enabled: true
  12. link-aggregation:
  13. mode: active-backup
  14. port:
  15. - enp2s0
  16. - enp3s0
  17. - name: ostest-master-1
  18. [...]
  19. networkConfig: *BOND
  20. - name: ostest-master-2
  21. [...]
  22. networkConfig: *BOND

Configuration of multiple cluster nodes is only available for initial deployments on installer-provisioned infrastructure.

Optional: Configuring managed Secure Boot

You can enable managed Secure Boot when deploying an installer-provisioned cluster using Redfish BMC addressing, such as redfish, redfish-virtualmedia, or idrac-virtualmedia. To enable managed Secure Boot, add the bootMode configuration setting to each node:

Example

  1. hosts:
  2. - name: openshift-master-0
  3. role: master
  4. bmc:
  5. address: redfish://<out_of_band_ip> (1)
  6. username: <user>
  7. password: <password>
  8. bootMACAddress: <NIC1_mac_address>
  9. rootDeviceHints:
  10. deviceName: "/dev/sda"
  11. bootMode: UEFISecureBoot (2)
1Ensure the bmc.address setting uses redfish, redfish-virtualmedia, or idrac-virtualmedia as the protocol. See “BMC addressing for HPE iLO” or “BMC addressing for Dell iDRAC” for additional details.
2The bootMode setting is UEFI by default. Change it to UEFISecureBoot to enable managed Secure Boot.

See “Configuring nodes” in the “Prerequisites” to ensure the nodes can support managed Secure Boot. If the nodes do not support managed Secure Boot, see “Configuring nodes for Secure Boot manually” in the “Configuring nodes” section. Configuring Secure Boot manually requires Redfish virtual media.

Red Hat does not support Secure Boot with IPMI, because IPMI does not provide Secure Boot management facilities.

Manifest configuration files

Creating the OKD manifests

  1. Create the OKD manifests.

    1. $ ./openshift-baremetal-install --dir ~/clusterconfigs create manifests
    1. INFO Consuming Install Config from target directory
    2. WARNING Making control-plane schedulable by setting MastersSchedulable to true for Scheduler cluster settings
    3. WARNING Discarding the OpenShift Manifest that was provided in the target directory because its dependencies are dirty and it needs to be regenerated

Optional: Configuring NTP for disconnected clusters

OKD installs the chrony Network Time Protocol (NTP) service on the cluster nodes.

Configuring NTP for disconnected clusters

OKD nodes must agree on a date and time to run properly. When worker nodes retrieve the date and time from the NTP servers on the control plane nodes, it enables the installation and operation of clusters that are not connected to a routable network and thereby do not have access to a higher stratum NTP server.

Procedure

  1. Create a Butane config, 99-master-chrony-conf-override.bu, including the contents of the chrony.conf file for the control plane nodes.

    See “Creating machine configs with Butane” for information about Butane.

    Butane config example

    1. variant: openshift
    2. version: 4.12.0
    3. metadata:
    4. name: 99-master-chrony-conf-override
    5. labels:
    6. machineconfiguration.openshift.io/role: master
    7. storage:
    8. files:
    9. - path: /etc/chrony.conf
    10. mode: 0644
    11. overwrite: true
    12. contents:
    13. inline: |
    14. # Use public servers from the pool.ntp.org project.
    15. # Please consider joining the pool (https://www.pool.ntp.org/join.html).
    16. # The Machine Config Operator manages this file
    17. server openshift-master-0.<cluster-name>.<domain> iburst (1)
    18. server openshift-master-1.<cluster-name>.<domain> iburst
    19. server openshift-master-2.<cluster-name>.<domain> iburst
    20. stratumweight 0
    21. driftfile /var/lib/chrony/drift
    22. rtcsync
    23. makestep 10 3
    24. bindcmdaddress 127.0.0.1
    25. bindcmdaddress ::1
    26. keyfile /etc/chrony.keys
    27. commandkey 1
    28. generatecommandkey
    29. noclientlog
    30. logchange 0.5
    31. logdir /var/log/chrony
    32. # Configure the control plane nodes to serve as local NTP servers
    33. # for all worker nodes, even if they are not in sync with an
    34. # upstream NTP server.
    35. # Allow NTP client access from the local network.
    36. allow all
    37. # Serve time even if not synchronized to a time source.
    38. local stratum 3 orphan
    1You must replace <cluster-name> with the name of the cluster and replace <domain> with the fully qualified domain name.
  2. Use Butane to generate a MachineConfig object file, 99-master-chrony-conf-override.yaml, containing the configuration to be delivered to the control plane nodes:

    1. $ butane 99-master-chrony-conf-override.bu -o 99-master-chrony-conf-override.yaml
  3. Create a Butane config, 99-worker-chrony-conf-override.bu, including the contents of the chrony.conf file for the worker nodes that references the NTP servers on the control plane nodes.

    Butane config example

    1. variant: openshift
    2. version: 4.12.0
    3. metadata:
    4. name: 99-worker-chrony-conf-override
    5. labels:
    6. machineconfiguration.openshift.io/role: worker
    7. storage:
    8. files:
    9. - path: /etc/chrony.conf
    10. mode: 0644
    11. overwrite: true
    12. contents:
    13. inline: |
    14. # The Machine Config Operator manages this file.
    15. server openshift-master-0.<cluster-name>.<domain> iburst (1)
    16. server openshift-master-1.<cluster-name>.<domain> iburst
    17. server openshift-master-2.<cluster-name>.<domain> iburst
    18. stratumweight 0
    19. driftfile /var/lib/chrony/drift
    20. rtcsync
    21. makestep 10 3
    22. bindcmdaddress 127.0.0.1
    23. bindcmdaddress ::1
    24. keyfile /etc/chrony.keys
    25. commandkey 1
    26. generatecommandkey
    27. noclientlog
    28. logchange 0.5
    29. logdir /var/log/chrony
    1You must replace <cluster-name> with the name of the cluster and replace <domain> with the fully qualified domain name.
  4. Use Butane to generate a MachineConfig object file, 99-worker-chrony-conf-override.yaml, containing the configuration to be delivered to the worker nodes:

    1. $ butane 99-worker-chrony-conf-override.bu -o 99-worker-chrony-conf-override.yaml

Configuring network components to run on the control plane

You can configure networking components to run exclusively on the control plane nodes. By default, OKD allows any node in the machine config pool to host the ingressVIP virtual IP address. However, some environments deploy worker nodes in separate subnets from the control plane nodes, which requires configuring the ingressVIP virtual IP address to run on the control plane nodes.

When deploying remote workers in separate subnets, you must place the ingressVIP virtual IP address exclusively with the control plane nodes.

Installer-provisioned networking

Procedure

  1. Change to the directory storing the install-config.yaml file:

    1. $ cd ~/clusterconfigs
  2. Switch to the manifests subdirectory:

    1. $ cd manifests
  3. Create a file named cluster-network-avoid-workers-99-config.yaml:

    1. $ touch cluster-network-avoid-workers-99-config.yaml
  4. Open the cluster-network-avoid-workers-99-config.yaml file in an editor and enter a custom resource (CR) that describes the Operator configuration:

    1. apiVersion: machineconfiguration.openshift.io/v1
    2. kind: MachineConfig
    3. metadata:
    4. name: 50-worker-fix-ipi-rwn
    5. labels:
    6. machineconfiguration.openshift.io/role: worker
    7. spec:
    8. config:
    9. ignition:
    10. version: 3.2.0
    11. storage:
    12. files:
    13. - path: /etc/kubernetes/manifests/keepalived.yaml
    14. mode: 0644
    15. contents:
    16. source: data:,

    This manifest places the ingressVIP virtual IP address on the control plane nodes. Additionally, this manifest deploys the following processes on the control plane nodes only:

    • openshift-ingress-operator

    • keepalived

  5. Save the cluster-network-avoid-workers-99-config.yaml file.

  6. Create a manifests/cluster-ingress-default-ingresscontroller.yaml file:

    1. apiVersion: operator.openshift.io/v1
    2. kind: IngressController
    3. metadata:
    4. name: default
    5. namespace: openshift-ingress-operator
    6. spec:
    7. nodePlacement:
    8. nodeSelector:
    9. matchLabels:
    10. node-role.kubernetes.io/master: ""
  7. Consider backing up the manifests directory. The installer deletes the manifests/ directory when creating the cluster.

  8. Modify the cluster-scheduler-02-config.yml manifest to make the control plane nodes schedulable by setting the mastersSchedulable field to true. Control plane nodes are not schedulable by default. For example:

    1. $ sed -i "s;mastersSchedulable: false;mastersSchedulable: true;g" clusterconfigs/manifests/cluster-scheduler-02-config.yml

    If control plane nodes are not schedulable after completing this procedure, deploying the cluster will fail.

Optional: Deploying routers on worker nodes

During installation, the installer deploys router pods on worker nodes. By default, the installer installs two router pods. If a deployed cluster requires additional routers to handle external traffic loads destined for services within the OKD cluster, you can create a yaml file to set an appropriate number of router replicas.

Deploying a cluster with only one worker node is not supported. While modifying the router replicas will address issues with the degraded state when deploying with one worker, the cluster loses high availability for the ingress API, which is not suitable for production environments.

By default, the installer deploys two routers. If the cluster has no worker nodes, the installer deploys the two routers on the control plane nodes by default.

Procedure

  1. Create a router-replicas.yaml file:

    1. apiVersion: operator.openshift.io/v1
    2. kind: IngressController
    3. metadata:
    4. name: default
    5. namespace: openshift-ingress-operator
    6. spec:
    7. replicas: <num-of-router-pods>
    8. endpointPublishingStrategy:
    9. type: HostNetwork
    10. nodePlacement:
    11. nodeSelector:
    12. matchLabels:
    13. node-role.kubernetes.io/worker: ""

    Replace <num-of-router-pods> with an appropriate value. If working with just one worker node, set replicas: to 1. If working with more than 3 worker nodes, you can increase replicas: from the default value 2 as appropriate.

  2. Save and copy the router-replicas.yaml file to the clusterconfigs/openshift directory:

    1. $ cp ~/router-replicas.yaml clusterconfigs/openshift/99_router-replicas.yaml

Optional: Configuring the BIOS

The following procedure configures the BIOS during the installation process.

Procedure

  1. Create the manifests.

  2. Modify the BareMetalHost resource file corresponding to the node:

    1. $ vim clusterconfigs/openshift/99_openshift-cluster-api_hosts-*.yaml
  3. Add the BIOS configuration to the spec section of the BareMetalHost resource:

    1. spec:
    2. firmware:
    3. simultaneousMultithreadingEnabled: true
    4. sriovEnabled: true
    5. virtualizationEnabled: true

    Red Hat supports three BIOS configurations. Only servers with BMC type irmc are supported. Other types of servers are currently not supported.

  4. Create the cluster.

Additional resources

Optional: Configuring the RAID

The following procedure configures a redundant array of independent disks (RAID) during the installation process.

  1. OKD supports hardware RAID for baseboard management controllers (BMCs) using the iRMC protocol only. OKD 4.12 does not support software RAID.

  2. If you want to configure a hardware RAID for the node, verify that the node has a RAID controller.

Procedure

  1. Create the manifests.

  2. Modify the BareMetalHost resource corresponding to the node:

    1. $ vim clusterconfigs/openshift/99_openshift-cluster-api_hosts-*.yaml

    The following example uses a hardware RAID configuration because OKD 4.12 does not support software RAID.

    1. If you added a specific RAID configuration to the spec section, this causes the node to delete the original RAID configuration in the preparing phase and perform a specified configuration on the RAID. For example:

      1. spec:
      2. raid:
      3. hardwareRAIDVolumes:
      4. - level: "0" (1)
      5. name: "sda"
      6. numberOfPhysicalDisks: 1
      7. rotational: true
      8. sizeGibibytes: 0
      1level is a required field, and the others are optional fields.
    2. If you added an empty RAID configuration to the spec section, the empty configuration causes the node to delete the original RAID configuration during the preparing phase, but does not perform a new configuration. For example:

      1. spec:
      2. raid:
      3. hardwareRAIDVolumes: []
    3. If you do not add a raid field in the spec section, the original RAID configuration is not deleted, and no new configuration will be performed.

  3. Create the cluster.

Additional resources

Creating a disconnected registry

In some cases, you might want to install an OKD cluster using a local copy of the installation registry. This could be for enhancing network efficiency because the cluster nodes are on a network that does not have access to the internet.

A local, or mirrored, copy of the registry requires the following:

  • A certificate for the registry node. This can be a self-signed certificate.

  • A web server that a container on a system will serve.

  • An updated pull secret that contains the certificate and local repository information.

Creating a disconnected registry on a registry node is optional. If you need to create a disconnected registry on a registry node, you must complete all of the following sub-sections.

Prerequisites

Preparing the registry node to host the mirrored registry

The following steps must be completed prior to hosting a mirrored registry on bare metal.

Procedure

  1. Open the firewall port on the registry node:

    1. $ sudo firewall-cmd --add-port=5000/tcp --zone=libvirt --permanent
    1. $ sudo firewall-cmd --add-port=5000/tcp --zone=public --permanent
    1. $ sudo firewall-cmd --reload
  2. Install the required packages for the registry node:

    1. $ sudo yum -y install python3 podman httpd httpd-tools jq
  3. Create the directory structure where the repository information will be held:

    1. $ sudo mkdir -p /opt/registry/{auth,certs,data}

Mirroring the OKD image repository for a disconnected registry

Complete the following steps to mirror the OKD image repository for a disconnected registry.

Prerequisites

  • Your mirror host has access to the internet.

  • You configured a mirror registry to use in your restricted network and can access the certificate and credentials that you configured.

  • You have created a pull secret for your mirror repository.

Procedure

  1. Review the OKD downloads page to determine the version of OKD that you want to install and determine the corresponding tag on the Repository Tags page.

  2. Set the required environment variables:

    1. Export the release version:

      1. $ OCP_RELEASE=<release_version>

      For <release_version>, specify the tag that corresponds to the version of OKD to install, such as 4.5.4.

    2. Export the local registry name and host port:

      1. $ LOCAL_REGISTRY='<local_registry_host_name>:<local_registry_host_port>'

      For <local_registry_host_name>, specify the registry domain name for your mirror repository, and for <local_registry_host_port>, specify the port that it serves content on.

    3. Export the local repository name:

      1. $ LOCAL_REPOSITORY='<local_repository_name>'

      For <local_repository_name>, specify the name of the repository to create in your registry, such as ocp4/openshift4.

    4. Export the name of the repository to mirror:

      1. $ PRODUCT_REPO='openshift'
    5. Export the path to your registry pull secret:

      1. $ LOCAL_SECRET_JSON='<path_to_pull_secret>'

      For <path_to_pull_secret>, specify the absolute path to and file name of the pull secret for your mirror registry that you created.

    6. Export the release mirror:

      1. $ RELEASE_NAME="okd"
    7. Export the path to the directory to host the mirrored images:

      1. $ REMOVABLE_MEDIA_PATH=<path> (1)
      1Specify the full path, including the initial forward slash (/) character.
  3. Mirror the version images to the mirror registry:

    • If your mirror host does not have internet access, take the following actions:

      1. Connect the removable media to a system that is connected to the internet.

      2. Review the images and configuration manifests to mirror:

        1. $ oc adm release mirror -a ${LOCAL_SECRET_JSON} \
        2. --from=quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE} \
        3. --to=${LOCAL_REGISTRY}/${LOCAL_REPOSITORY} \
        4. --to-release-image=${LOCAL_REGISTRY}/${LOCAL_REPOSITORY}:${OCP_RELEASE} --dry-run
      3. Record the entire imageContentSources section from the output of the previous command. The information about your mirrors is unique to your mirrored repository, and you must add the imageContentSources section to the install-config.yaml file during installation.

      4. Mirror the images to a directory on the removable media:

        1. $ oc adm release mirror -a ${LOCAL_SECRET_JSON} --to-dir=${REMOVABLE_MEDIA_PATH}/mirror quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE}
      5. Take the media to the restricted network environment and upload the images to the local container registry.

        1. $ oc image mirror -a ${LOCAL_SECRET_JSON} --from-dir=${REMOVABLE_MEDIA_PATH}/mirror "file://openshift/release:${OCP_RELEASE}*" ${LOCAL_REGISTRY}/${LOCAL_REPOSITORY} (1)
        1For REMOVABLE_MEDIA_PATH, you must use the same path that you specified when you mirrored the images.
    • If the local container registry is connected to the mirror host, take the following actions:

      1. Directly push the release images to the local registry by using following command:

        1. $ oc adm release mirror -a ${LOCAL_SECRET_JSON} \
        2. --from=quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE} \
        3. --to=${LOCAL_REGISTRY}/${LOCAL_REPOSITORY} \
        4. --to-release-image=${LOCAL_REGISTRY}/${LOCAL_REPOSITORY}:${OCP_RELEASE}

        This command pulls the release information as a digest, and its output includes the imageContentSources data that you require when you install your cluster.

      2. Record the entire imageContentSources section from the output of the previous command. The information about your mirrors is unique to your mirrored repository, and you must add the imageContentSources section to the install-config.yaml file during installation.

        The image name gets patched to Quay.io during the mirroring process, and the podman images will show Quay.io in the registry on the bootstrap virtual machine.

  1. To create the installation program that is based on the content that you mirrored, extract it and pin it to the release:

    • If your mirror host does not have internet access, run the following command:

      1. $ oc adm release extract -a ${LOCAL_SECRET_JSON} --command=openshift-baremetal-install "${LOCAL_REGISTRY}/${LOCAL_REPOSITORY}:${OCP_RELEASE}"
    • If the local container registry is connected to the mirror host, run the following command:

      1. $ oc adm release extract -a ${LOCAL_SECRET_JSON} --command=openshift-baremetal-install "${LOCAL_REGISTRY}/${LOCAL_REPOSITORY}:${OCP_RELEASE}"

      To ensure that you use the correct images for the version of OKD that you selected, you must extract the installation program from the mirrored content.

      You must perform this step on a machine with an active internet connection.

      If you are in a disconnected environment, use the —image flag as part of must-gather and point to the payload image.

  2. For clusters using installer-provisioned infrastructure, run the following command:

    1. $ openshift-baremetal-install

Modify the install-config.yaml file to use the disconnected registry

On the provisioner node, the install-config.yaml file should use the newly created pull-secret from the pull-secret-update.txt file. The install-config.yaml file must also contain the disconnected registry node’s certificate and registry information.

Procedure

  1. Add the disconnected registry node’s certificate to the install-config.yaml file:

    1. $ echo "additionalTrustBundle: |" >> install-config.yaml

    The certificate should follow the "additionalTrustBundle: |" line and be properly indented, usually by two spaces.

    1. $ sed -e 's/^/ /' /opt/registry/certs/domain.crt >> install-config.yaml
  2. Add the mirror information for the registry to the install-config.yaml file:

    1. $ echo "imageContentSources:" >> install-config.yaml
    1. $ echo "- mirrors:" >> install-config.yaml
    1. $ echo " - registry.example.com:5000/ocp4/openshift4" >> install-config.yaml

    Replace registry.example.com with the registry’s fully qualified domain name.

    1. $ echo " source: quay.io/openshift-release-dev/ocp-release" >> install-config.yaml
    1. $ echo "- mirrors:" >> install-config.yaml
    1. $ echo " - registry.example.com:5000/ocp4/openshift4" >> install-config.yaml

    Replace registry.example.com with the registry’s fully qualified domain name.

    1. $ echo " source: quay.io/openshift-release-dev/ocp-v4.0-art-dev" >> install-config.yaml

Validation checklist for installation

  • OKD installer has been retrieved.

  • OKD installer has been extracted.

  • Required parameters for the install-config.yaml have been configured.

  • The hosts parameter for the install-config.yaml has been configured.

  • The bmc parameter for the install-config.yaml has been configured.

  • Conventions for the values configured in the bmc address field have been applied.

  • Created the OKD manifests.

  • (Optional) Deployed routers on worker nodes.

  • (Optional) Created a disconnected registry.

  • (Optional) Validate disconnected registry settings if in use.

Deploying the cluster via the OKD installer

Run the OKD installer:

  1. $ ./openshift-baremetal-install --dir ~/clusterconfigs --log-level debug create cluster

Following the installation

During the deployment process, you can check the installation’s overall status by issuing the tail command to the .openshift_install.log log file in the install directory folder:

  1. $ tail -f /path/to/install-dir/.openshift_install.log

Verifying static IP address configuration

If the DHCP reservation for a cluster node specifies an infinite lease, after the installer successfully provisions the node, the dispatcher script checks the node’s network configuration. If the script determines that the network configuration contains an infinite DHCP lease, it creates a new connection using the IP address of the DHCP lease as a static IP address.

The dispatcher script might run on successfully provisioned nodes while the provisioning of other nodes in the cluster is ongoing.

Verify the network configuration is working properly.

Procedure

  1. Check the network interface configuration on the node.

  2. Turn off the DHCP server and reboot the OKD node and ensure that the network configuration works properly.

Preparing to reinstall a cluster on bare metal

Before you reinstall a cluster on bare metal, you must perform cleanup operations.

Procedure

  1. Remove or reformat the disks for the bootstrap, control plane node, and worker nodes. If you are working in a hypervisor environment, you must add any disks you removed.

  2. Delete the artifacts that the previous installation generated:

    1. $ cd ; /bin/rm -rf auth/ bootstrap.ign master.ign worker.ign metadata.json \
    2. .openshift_install.log .openshift_install_state.json
  3. Generate new manifests and Ignition config files. See “Creating the Kubernetes manifest and Ignition config files” for more information.

  4. Upload the new bootstrap, control plane, and compute node Ignition config files that the installation program created to your HTTP server. This will overwrite the previous Ignition files.

Additional resources