Setting up the environment for an OpenShift installation

Installing RHEL on the provisioner node

With the networking configuration complete, the next step is to install Fedora 8.x 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 RHEL 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
    2. # passwd kni
    3. # echo "kni ALL=(root) NOPASSWD:ALL" | tee -a /etc/sudoers.d/kni
    4. # 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
    2. $
  5. Use Red Hat Subscription Manager to register the provisioner node.

    1. $ sudo subscription-manager register --username=<user> --password=<pass> --auto-attach
    2. $ sudo subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms --enable=rhel-8-for-x86_64-baseos-rpms

    For more information about Red Hat Subscription Manager, see Using and Configuring Red Hat Subscription Manager.

  6. Install the following packages.

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

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

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

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

    1. $ sudo virsh pool-define-as --name default --type dir --target /var/lib/libvirt/images
    2. $ sudo virsh pool-start default
    3. $ sudo virsh pool-autostart default
  11. Configure networking.

    This step can also be run from the web console.

    1. $ export PUB_CONN=<baremetal_nic_name>
    2. $ export PROV_CONN=<prov_nic_name>
    3. $ sudo nohup bash -c "
    4. nmcli con down \"$PROV_CONN\"
    5. nmcli con down \"$PUB_CONN\"
    6. nmcli con delete \"$PROV_CONN\"
    7. nmcli con delete \"$PUB_CONN\"
    8. # RHEL 8.1 appends the word \"System\" in front of the connection, delete in case it exists
    9. nmcli con down \"System $PUB_CONN\"
    10. nmcli con delete \"System $PUB_CONN\"
    11. nmcli connection add ifname provisioning type bridge con-name provisioning
    12. nmcli con add type bridge-slave ifname \"$PROV_CONN\" master provisioning
    13. nmcli connection add ifname baremetal type bridge con-name baremetal
    14. nmcli con add type bridge-slave ifname \"$PUB_CONN\" master baremetal
    15. pkill dhclient;dhclient baremetal
    16. nmcli connection modify provisioning ipv6.addresses fd00:1101::1/64 ipv6.method manual
    17. nmcli con down provisioning
    18. nmcli con up provisioning
    19. "

    The ssh connection might disconnect after executing this step.

    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.

  12. ssh back into the provisioner node (if required).

    1. # ssh kni@provisioner.<cluster-name>.<domain>
  13. 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
  14. Create a pull-secret.txt file.

    1. $ vim pull-secret.txt

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

Retrieving the OKD installer

Use the latest-4.x version of the installer to deploy the latest generally available version of OKD:

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

Additional resources

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
    2. $ export pullsecret_file=~/pull-secret.txt
    3. $ 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
    2. $ oc adm release extract --registry-config "${pullsecret_file}" --command=$cmd --to "${extract_dir}" ${RELEASE_IMAGE}
    3. $ sudo cp openshift-baremetal-install /usr/local/bin

Creating an FCOS images cache (optional)

To employ image caching, you must download two images: the Fedora CoreOS (FCOS) image used by the bootstrap VM and the FCOS image used by the installer to provision the different nodes. Image caching is optional, but especially useful when running the installer on a network with limited bandwidth.

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

Use the following steps to install a container that contains the images.

  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 and clusterosimage.

    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(/.*)?"
    2. $ sudo restorecon -Rv rhcos_image_cache/
  5. Get the commit ID from the installer. The ID determines which images the installer needs to download.

    1. $ export COMMIT_ID=$(/usr/local/bin/openshift-baremetal-install version | grep '^built from commit' | awk '{print $4}')
  6. Get the URI for the FCOS image that the installer will deploy on the nodes.

    1. $ export RHCOS_OPENSTACK_URI=$(curl -s -S https://raw.githubusercontent.com/openshift/installer/$COMMIT_ID/data/data/rhcos.json | jq .images.openstack.path | sed 's/"//g')
  7. Get the URI for the FCOS image that the installer will deploy on the bootstrap VM.

    1. $ export RHCOS_QEMU_URI=$(curl -s -S https://raw.githubusercontent.com/openshift/installer/$COMMIT_ID/data/data/rhcos.json | jq .images.qemu.path | sed 's/"//g')
  8. Get the path where the images are published.

    1. $ export RHCOS_PATH=$(curl -s -S https://raw.githubusercontent.com/openshift/installer/$COMMIT_ID/data/data/rhcos.json | jq .baseURI | sed 's/"//g')
  9. Get the SHA hash for the FCOS image that will be deployed on the bootstrap VM.

    1. $ export RHCOS_QEMU_SHA_UNCOMPRESSED=$(curl -s -S https://raw.githubusercontent.com/openshift/installer/$COMMIT_ID/data/data/rhcos.json | jq -r '.images.qemu["uncompressed-sha256"]')
  10. Get the SHA hash for the FCOS image that will be deployed on the nodes.

    1. $ export RHCOS_OPENSTACK_SHA_COMPRESSED=$(curl -s -S https://raw.githubusercontent.com/openshift/installer/$COMMIT_ID/data/data/rhcos.json | jq -r '.images.openstack.sha256')
  11. Download the images and place them in the /home/kni/rhcos_image_cache directory.

    1. $ curl -L ${RHCOS_PATH}${RHCOS_QEMU_URI} -o /home/kni/rhcos_image_cache/${RHCOS_QEMU_URI}
    2. $ curl -L ${RHCOS_PATH}${RHCOS_OPENSTACK_URI} -o /home/kni/rhcos_image_cache/${RHCOS_OPENSTACK_URI}
  12. Confirm SELinux type is of httpd_sys_content_t for the newly created files.

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

    1. $ podman run -d --name rhcos_image_cache \
    2. -v /home/kni/rhcos_image_cache:/var/www/html \
    3. -p 8080:8080/tcp \
    4. registry.centos.org/centos/httpd-24-centos7:latest

Configuration files

Configuring the install-config.yaml file

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

  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. machineCIDR: <public-cidr>
    7. networkType: OVNKubernetes
    8. compute:
    9. - name: worker
    10. replicas: 2 (1)
    11. controlPlane:
    12. name: master
    13. replicas: 3
    14. platform:
    15. baremetal: {}
    16. platform:
    17. baremetal:
    18. apiVIP: <api-ip>
    19. ingressVIP: <wildcard-ip>
    20. provisioningNetworkInterface: <NIC1>
    21. provisioningNetworkCIDR: <CIDR>
    22. hosts:
    23. - name: openshift-master-0
    24. role: master
    25. bmc:
    26. address: ipmi://<out-of-band-ip> (2)
    27. username: <user>
    28. password: <password>
    29. bootMACAddress: <NIC1-mac-address>
    30. hardwareProfile: default
    31. - name: <openshift-master-1>
    32. role: master
    33. bmc:
    34. address: ipmi://<out-of-band-ip> (2)
    35. username: <user>
    36. password: <password>
    37. bootMACAddress: <NIC1-mac-address>
    38. hardwareProfile: default
    39. - name: <openshift-master-2>
    40. role: master
    41. bmc:
    42. address: ipmi://<out-of-band-ip> (2)
    43. username: <user>
    44. password: <password>
    45. bootMACAddress: <NIC1-mac-address>
    46. hardwareProfile: default
    47. - name: <openshift-worker-0>
    48. role: worker
    49. bmc:
    50. address: ipmi://<out-of-band-ip> (2)
    51. username: <user>
    52. password: <password>
    53. bootMACAddress: <NIC1-mac-address>
    54. hardwareProfile: unknown
    55. - name: <openshift-worker-1>
    56. role: worker
    57. bmc:
    58. address: ipmi://<out-of-band-ip>
    59. username: <user>
    60. password: <password>
    61. bootMACAddress: <NIC1-mac-address>
    62. hardwareProfile: unknown
    63. pullSecret: '<pull_secret>'
    64. sshKey: '<ssh_pub_key>'
    1Scale the worker machines based on the number of worker nodes that are part of the OKD cluster.
    2Refer to the BMC addressing sections for more options.
  2. Create a directory to store cluster configs.

    1. $ mkdir ~/clusterconfigs
    2. $ 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

Setting proxy settings within the install-config.yaml file (optional)

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.

Modifying the install-config.yaml file for no provisioning network (optional)

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

  1. platform:
  2. baremetal:
  3. apiVIP: <apiVIP>
  4. ingressVIP: <ingress/wildcard VIP>
  5. provisioningNetwork: "Disabled"
  6. provisioningHostIP: <baremetal_network_IP1>
  7. bootstrapProvisioningIP: <baremetal_network_IP2>

Requires providing two IP addresses from the baremetal network for the provisioningHostIP and bootstrapProvisioningIP configuration settings, and removing the provisioningBridge and provisioningNetworkCIDR configuration settings.

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.

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. machineCIDR:

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 control plane nodes connected to the provisioning network.

defaultMachinePlatform

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

apiVIP

api.<clustername.clusterdomain>

The VIP to use for internal API communication.

This setting must either be provided or pre-configured in the DNS so that the default name resolves correctly.

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.

ingressVIP

test.apps.<clustername.clusterdomain>

The VIP to use for ingress traffic.

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 on the bootstrap VM where the provisioning services run while the installer is deploying the control plane (master) nodes. Defaults to the second IP of the provisioning subnet. For example, 172.22.0.2 .

When using no provisioning network, set this value to an IP address that is available on the baremetal network.

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.

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>; .

clusterOSImage

A URL to override the default operating system for cluster nodes. The URL must include a SHA-256 hash of the image. For example, https://mirror.openshift.com/images/rhcos-<version>-openstack.qcow2.gz?sha256=<compressed_sha256>;.

provisioningNetwork

Set this parameter to Disabled to disable the requirement for a provisioning network. User may only do virtual media based provisioning, or bring up the cluster using assisted installation. If using power management, BMC’s must be accessible from the machine networks. User must provide two IP addresses on the external network that are used for the provisioning services. Set this parameter to managed, which is the default, to fully manage the provisioning network, including DHCP, TFTP, and so on.

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

provisioningHostingIp

Set this parameter to an available IP address on the baremetal network when the provisioningNetwork configuration setting is set to Disabled.

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.

Name

Default

Description

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 the host will use to boot on the provisioning network.

BMC addressing

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.

IPMI

IPMI hosts use ipmi://<out-of-band-ip>:<port> and 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>

RedFish for HPE

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 for Dell

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/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

Currently RedFish is only supported on Dell with iDRAC firmware version 4.20.20.20 or higher for installer-provisioned installations of OKD on bare metal deployments.

RedFish Virtual Media for HPE

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>

RedFish Virtual Media for Dell

For RedFish Virtual Media on Dell servers, use idrac-virtualmedia:// in the address setting.

RedFish Virtual Media on Dell servers has a known issue in OKD 4.6. The 4.6.1 point release will resolve the issue.

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>

idrac-virtualmedia requires iDRAC firmware version 4.20.20.20 or higher.

Ensure the OKD cluster nodes have AutoAttach Enabled through the iDRAC console. The menu path is: Configuration→Virtual Media→Attach Mode→AutoAttach.

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 3. 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"

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

Creating a disconnected registry (optional)

In some cases, you might want to install an OpenShift KNI 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 webserver - this will be served by a container on a system.

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

Creating a disconnected registry on a registry node is optional. The subsequent sections indicate that they are optional since they are steps you need to execute only when creating a disconnected registry on a registry node. You should execute all of the subsequent sub-sections labeled “(optional)” when creating a disconnected registry on a registry node.

Preparing the registry node to host the mirrored registry (optional)

Make the following changes to the registry node.

Procedure

  1. Open the firewall port on the registry node.

    1. $ sudo firewall-cmd --add-port=5000/tcp --zone=libvirt --permanent
    2. $ sudo firewall-cmd --add-port=5000/tcp --zone=public --permanent
    3. $ 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}

Generating the self-signed certificate (optional)

Generate a self-signed certificate for the registry node and put it in the /opt/registry/certs directory.

Procedure

  1. Adjust the certificate information as appropriate.

    1. $ host_fqdn=$( hostname --long )
    2. $ cert_c="<Country Name>" # Country Name (C, 2 letter code)
    3. $ cert_s="<State>" # Certificate State (S)
    4. $ cert_l="<Locality>" # Certificate Locality (L)
    5. $ cert_o="<Organization>" # Certificate Organization (O)
    6. $ cert_ou="<Org Unit>" # Certificate Organizational Unit (OU)
    7. $ cert_cn="${host_fqdn}" # Certificate Common Name (CN)
    8. $ openssl req \
    9. -newkey rsa:4096 \
    10. -nodes \
    11. -sha256 \
    12. -keyout /opt/registry/certs/domain.key \
    13. -x509 \
    14. -days 365 \
    15. -out /opt/registry/certs/domain.crt \
    16. -addext "subjectAltName = DNS:${host_fqdn}" \
    17. -subj "/C=${cert_c}/ST=${cert_s}/L=${cert_l}/O=${cert_o}/OU=${cert_ou}/CN=${cert_cn}"
    When replacing <Country Name>, ensure that it only contains two letters. For example, US.
  2. Update the registry node’s ca-trust with the new certificate.

    1. $ sudo cp /opt/registry/certs/domain.crt /etc/pki/ca-trust/source/anchors/
    2. $ sudo update-ca-trust extract

Creating the registry podman container (optional)

The registry container uses the /opt/registry directory for certificates, authentication files, and to store its data files.

The registry container uses httpd and needs an htpasswd file for authentication.

Procedure

  1. Create an htpasswd file in /opt/registry/auth for the container to use.

    1. $ htpasswd -bBc /opt/registry/auth/htpasswd <user> <passwd>

    Replace <user> with the user name and <passwd> with the password.

  2. Create and start the registry container.

    1. $ podman create \
    2. --name ocpdiscon-registry \
    3. -p 5000:5000 \
    4. -e "REGISTRY_AUTH=htpasswd" \
    5. -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry" \
    6. -e "REGISTRY_HTTP_SECRET=ALongRandomSecretForRegistry" \
    7. -e "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd" \
    8. -e "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt" \
    9. -e "REGISTRY_HTTP_TLS_KEY=/certs/domain.key" \
    10. -e "REGISTRY_COMPATIBILITY_SCHEMA1_ENABLED=true" \
    11. -v /opt/registry/data:/var/lib/registry:z \
    12. -v /opt/registry/auth:/auth:z \
    13. -v /opt/registry/certs:/certs:z \
    14. docker.io/library/registry:2
    1. $ podman start ocpdiscon-registry

Copy and update the pull-secret (optional)

Copy the pull secret file from the provisioner node to the registry node and modify it to include the authentication information for the new registry node.

Procedure

  1. Copy the pull-secret.txt file.

    1. $ scp kni@provisioner:/home/kni/pull-secret.txt pull-secret.txt
  2. Update the host_fqdn environment variable with the fully qualified domain name of the registry node.

    1. $ host_fqdn=$( hostname --long )
  3. Update the b64auth environment variable with the base64 encoding of the http credentials used to create the htpasswd file.

    1. $ b64auth=$( echo -n '<username>:<passwd>' | openssl base64 )

    Replace <username> with the user name and <passwd> with the password.

  4. Set the AUTHSTRING environment variable to use the base64 authorization string. The $USER variable is an environment variable containing the name of the current user.

    1. $ AUTHSTRING="{\"$host_fqdn:5000\": {\"auth\": \"$b64auth\",\"email\": \"$USER@redhat.com\"}}"
  5. Update the pull-secret.txt file.

    1. $ jq ".auths += $AUTHSTRING" < pull-secret.txt > pull-secret-update.txt

Mirroring the repository (optional)

Procedure

  1. Copy the oc binary from the provisioner node to the registry node.

    1. $ sudo scp kni@provisioner:/usr/local/bin/oc /usr/local/bin
  2. Mirror the remote install images to the local repository.

    1. $ /usr/local/bin/oc adm release mirror \
    2. -a pull-secret-update.txt
    3. --from=$UPSTREAM_REPO \
    4. --to-release-image=$LOCAL_REG/$LOCAL_REPO:${VERSION} \
    5. --to=$LOCAL_REG/$LOCAL_REPO

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

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. The certificate should follow the "additionalTrustBundle: |" line and be properly indented, usually by two spaces.

    1. $ echo "additionalTrustBundle: |" >> install-config.yaml
    2. $ 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
    2. $ echo "- mirrors:" >> install-config.yaml
    3. $ echo " - registry.example.com:5000/ocp4/openshift4" >> install-config.yaml
    4. $ echo " source: quay.io/openshift-release-dev/ocp-release" >> install-config.yaml
    5. $ echo "- mirrors:" >> install-config.yaml
    6. $ echo " - registry.example.com:5000/ocp4/openshift4" >> install-config.yaml
    7. $ echo " source: quay.io/openshift-release-dev/ocp-v4.0-art-dev" >> install-config.yaml
    Replace registry.example.com with the registry’s fully qualified domain name.

Deploying routers on worker nodes

During installation, the installer deploys router pods on worker nodes. By default, the installer installs two router pods. If the initial cluster has only one worker node, or 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.

By default, the installer deploys two routers. If the cluster has at least two worker nodes, you can skip this section. For more information on the Ingress Operator see: Ingress Operator in OpenShift Container Platform.

If the cluster has no worker nodes, the installer deploys the two routers on the control plane nodes by default. If the cluster has no worker nodes, you can skip this section.

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

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 a disconnected registry (optional).

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

  • (optional) Deployed routers on worker nodes.

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