Setting up the environment for an OpenShift Container Platform installation on IBM Cloud(R) Bare Metal (Classic)¶
After you complete the prerequisites, set up the environment for an OpenShift Container Platform installation on IBM Cloud(R) Bare Metal (Classic) by preparing the provisioner node, configuring the network, and deploying the cluster.
Preparing the provisioner node on IBM Cloud(R) Bare Metal (Classic) infrastructure¶
Before you install OpenShift Container Platform on IBM Cloud(R) Bare Metal (Classic) infrastructure, prepare the provisioner node by creating a non-root user, configuring network bridges, registering the node, installing required packages, and downloading the pull secret.
Procedure
-
Log in to the provisioner node via
ssh. -
Create a non-root user (
kni) and give that usersudoprivileges: -
Create an
sshkey for the new user: -
Log in as the new user on the provisioner node:
-
Use Red Hat Subscription Manager to register the provisioner node:
$ sudo subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms \ --enable=rhel-8-for-x86_64-baseos-rpmsNote
For more information about Red Hat Subscription Manager, see Registering a RHEL system with command-line tools.
-
Install the following packages:
-
Change the user to add the
libvirtgroup to the newly created user: -
Start
firewalld: -
Enable
firewalld: -
Start the
httpservice: -
Start and enable the
libvirtdservice: -
Set the ID of the provisioner node:
You can view the ID with the following
ibmcloudcommand: -
Set the ID of the public subnet:
You can view the ID with the following
ibmcloudcommand: -
Set the ID of the private subnet:
You can view the ID with the following
ibmcloudcommand: -
Set the provisioner node public IP address:
-
Set the CIDR for the public network:
-
Set the IP address and CIDR for the public network:
-
Set the gateway for the public network:
-
Set the private IP address of the provisioner node:
-
Set the CIDR for the private network:
-
Set the IP address and CIDR for the private network:
-
Set the gateway for the private network:
-
Set up the bridges for the
baremetalandprovisioningnetworks:$ sudo nohup bash -c " nmcli --get-values UUID con show | xargs -n 1 nmcli con delete nmcli connection add ifname provisioning type bridge con-name provisioning nmcli con add type bridge-slave ifname eth1 master provisioning nmcli connection add ifname baremetal type bridge con-name baremetal nmcli con add type bridge-slave ifname eth2 master baremetal nmcli connection modify baremetal ipv4.addresses $PUB_IP_CIDR ipv4.method manual ipv4.gateway $PUB_GATEWAY nmcli connection modify provisioning ipv4.addresses 172.22.0.1/24,$PRIV_IP_CIDR ipv4.method manual nmcli connection modify provisioning +ipv4.routes \"10.0.0.0/8 $PRIV_GATEWAY\" nmcli con down baremetal nmcli con up baremetal nmcli con down provisioning nmcli con up provisioning init 6 "Note
For
eth1andeth2, substitute the appropriate interface name, as needed. -
If required, SSH back into the
provisionernode: -
Verify the connection bridges have been properly created:
Example outputNAME UUID TYPE DEVICE baremetal 4d5133a5-8351-4bb9-bfd4-3af264801530 bridge baremetal provisioning 43942805-017f-4d7d-a2c2-7cb3324482ed bridge provisioning virbr0 d9bca40f-eee1-410b-8879-a2d4bb0465e7 bridge virbr0 bridge-slave-eth1 76a8ed50-c7e5-4999-b4f6-6d9014dd0812 ethernet eth1 bridge-slave-eth2 f31c3353-54b7-48de-893a-02d2b34c4736 ethernet eth2 -
Create a
pull-secret.txtfile:Go to Install on Bare Metal with user-provisioned infrastructure. In step 1, click Download pull secret. Paste the contents into the
pull-secret.txtfile and save the contents in thekniuser’s home directory.
Configuring the public subnet¶
To offer DHCP services for OpenShift Container Platform cluster nodes on the public subnet in IBM Cloud(R) Bare Metal (Classic), you can install and configure dnsmasq on the provisioner node.
All of the OpenShift Container Platform cluster nodes must be on the public subnet. IBM Cloud(R) Bare Metal (Classic) does not offer a DHCP server on the subnet. Set it up separately on the provisioner node.
You must reset the BASH variables defined when preparing the provisioner node. Rebooting the provisioner node after preparing it will delete the BASH variables set before.
Procedure
-
Install
dnsmasq: -
Open the
dnsmasqconfiguration file: -
Add the following configuration to the
dnsmasqconfiguration file:interface=baremetal except-interface=lo bind-dynamic log-dhcp dhcp-range=<ip_addr>,<ip_addr>,<pub_cidr> dhcp-option=baremetal,121,0.0.0.0/0,<pub_gateway>,<prvn_priv_ip>,<prvn_pub_ip> dhcp-hostsfile=/var/lib/dnsmasq/dnsmasq.hostsfilewhere:
dhcp-range- Specifies the DHCP range for the
baremetalnetwork. Replace both instances of<ip_addr>with one unused IP address from the public subnet so that the range begins and ends with the same IP address. Replace<pub_cidr>with the CIDR of the public subnet.
dhcp-option- Specifies the DHCP option for the
baremetalnetwork. Replace<pub_gateway>with the IP address of the gateway for thebaremetalnetwork. Replace<prvn_priv_ip>with the private IP address of the provisioner node on theprovisioningnetwork. Replace<prvn_pub_ip>with the public IP address of the provisioner node on thebaremetalnetwork.
-
To retrieve the value for
<pub_cidr>, run the following command:Replace
<publicsubnetid>with the ID of the public subnet. -
To retrieve the value for
<pub_gateway>, run the following command:Replace
<publicsubnetid>with the ID of the public subnet. -
To retrieve the value for
<prvn_priv_ip>, run the following command:Replace
<id>with the ID of the provisioner node. -
To retrieve the value for
<prvn_pub_ip>, run the following command:Replace
<id>with the ID of the provisioner node. -
Obtain the list of hardware for the cluster:
-
Obtain the MAC addresses and IP addresses for each node:
$ ibmcloud sl hardware detail <id> --output JSON | \ jq '.networkComponents[] | \ "\(.primaryIpAddress) \(.macAddress)"' | grep -v nullReplace
<id>with the ID of the node.Make a note of the MAC address and IP address of the public network. Make a separate note of the MAC address of the private network, which you will use later in the
install-config.yamlfile. Repeat this procedure for each node until you have all the public MAC and IP addresses for the publicbaremetalnetwork, and the MAC addresses of the privateprovisioningnetwork. -
Add the MAC and IP address pair of the public
baremetalnetwork for each node into thednsmasq.hostsfilefile:Example input00:e0:ed:6a:ca:b5,141.125.65.215,master-0 <mac>,<ip>,master-1 <mac>,<ip>,master-2 <mac>,<ip>,worker-0 <mac>,<ip>,worker-1 ...Replace
<mac>,<ip>with the public MAC address and public IP address of the corresponding node name. -
Start
dnsmasq: -
Enable
dnsmasqso that it starts when booting the node: -
Verify
dnsmasqis running:Example output● dnsmasq.service - DNS caching server. Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2021-10-05 05:04:14 CDT; 49s ago Main PID: 3101 (dnsmasq) Tasks: 1 (limit: 204038) Memory: 732.0K CGroup: /system.slice/dnsmasq.service └─3101 /usr/sbin/dnsmasq -k -
Open ports
53and67with UDP protocol: -
Add
provisioningto the external zone with masquerade:This step ensures network address translation for IPMI calls to the management subnet.
-
Reload the
firewalldconfiguration:
Retrieving the OpenShift Container Platform installer¶
Use the stable-4.x version of the installation program and your selected architecture to deploy the generally available stable version of OpenShift Container Platform.
Procedure
-
Retrieve the installation program by running one of the following commands:
Extracting the OpenShift Container Platform installer¶
Extract the OpenShift Container Platform installer after retrieving it to prepare for the installation of the cluster.
Procedure
-
Set the environment variables:
-
Get the
ocbinary: -
Extract the installer:
Configuring the install-config.yaml file¶
To configure OpenShift Container Platform for IBM Cloud(R) Bare Metal (Classic) infrastructure, you can edit the install-config.yaml file to set the required IPMI privilege level and hardware parameters for your bare-metal nodes.
The install-config.yaml file requires some additional details. Most of the information is teaching the installation program and the resulting cluster enough about the available IBM Cloud(R) Bare Metal (Classic) hardware so that it is able to fully manage it. The material difference between installing on bare metal and installing on IBM Cloud(R) Bare Metal (Classic) is that you must explicitly set the privilege level for IPMI in the BMC section of the install-config.yaml file.
Procedure
-
Configure
install-config.yaml. Change the appropriate variables to match the environment, includingpullSecretandsshKey.apiVersion: v1 baseDomain: <domain> metadata: name: <cluster_name> networking: machineNetwork: - cidr: <public-cidr> networkType: OVNKubernetes compute: - name: worker replicas: 2 controlPlane: name: master replicas: 3 platform: baremetal: {} platform: baremetal: apiVIP: <api_ip> ingressVIP: <wildcard_ip> provisioningNetworkInterface: <NIC1> provisioningNetworkCIDR: <CIDR> hosts: - name: openshift-master-0 role: master bmc: address: ipmi://10.196.130.145?privilegelevel=OPERATOR username: root password: <password> bootMACAddress: 00:e0:ed:6a:ca:b4 rootDeviceHints: deviceName: "/dev/sda" - name: openshift-worker-0 role: worker bmc: address: ipmi://<out-of-band-ip>?privilegelevel=OPERATOR username: <user> password: <password> bootMACAddress: <NIC1_mac_address> rootDeviceHints: deviceName: "/dev/sda" pullSecret: '<pull_secret>' sshKey: '<ssh_pub_key>'where:
bmc.address- Specifies the IPMI address with
privilegelevel=OPERATOR. IBM Cloud(R) Bare Metal (Classic) infrastructure requires this privilege level.
bootMACAddress-
Specifies the MAC address of the private
provisioningnetwork NIC for the corresponding node.
-
Create a directory to store the cluster configuration:
-
Copy the
install-config.yamlfile into the directory: -
Power off all bare-metal nodes before installing the OpenShift Container Platform cluster:
-
Remove old bootstrap resources if any remain from an earlier deployment try:
Additional installation configuration parameters¶
Some parameters, such as the cluster domain name, are required in the install-config.yaml file when installing a cluster on bare metal. Others, such as the provisioning network CIDR, are optional.
Required parameters
| Parameters | Default | Description |
|---|---|---|
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.Note For hardware that implements |
platform:
baremetal:
bootstrapExternalStaticDNS |
The static network DNS of the bootstrap node. You must set this value when deploying a cluster with static IP addresses when there is no Dynamic Host Configuration Protocol (DHCP) server on the bare-metal network. If you do not set this value, the installation program will use the value from bootstrapExternalStaticGateway, which causes problems when the IP address values of the gateway and DNS are different. |
|
platform:
baremetal:
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 bare metal network. | |
platform:
baremetal:
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 bare metal network. | |
sshKey |
The sshKey parameter sets the key in the ~/.ssh/id_rsa.pub file required to access the control plane nodes and compute nodes. Typically, this key is from the provisioner node. |
|
pullSecret |
The pullSecret parameter sets a copy of the pull secret downloaded from the Install OpenShift on Bare Metal page when preparing the provisioner node. |
|
metadata:
name: |
The OpenShift Container Platform cluster name. For example, openshift. |
|
networking:
machineNetwork:
- cidr: |
The public CIDR (Classless Inter-Domain Routing) of the external network. For example, 10.0.0.0/24. |
|
compute: - name: worker |
The OpenShift Container Platform cluster requires a name for each compute node even if there are zero nodes. | |
compute:
replicas: 2 |
Replicas sets the number of compute nodes in the OpenShift Container Platform cluster. | |
controlPlane:
name: master |
The OpenShift Container Platform cluster requires a name for control plane nodes. | |
controlPlane:
replicas: 3 |
Replicas sets the number of control plane nodes included as part of the OpenShift Container Platform cluster. | |
provisioningNetworkInterface |
The name of the network interface on nodes connected to the provisioning network. For OpenShift Container Platform 4.9 and later releases, use the bootMACAddress parameter to enable Ironic to identify the IP address of the NIC instead of using the provisioningNetworkInterface parameter 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. You must either provide this setting in the install-config.yaml file as a reserved IP from the MachineNetwork parameter or preconfigured 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. For dual-stack networking, the primary IP address can be either an IPv4 network or an IPv6 network. If not set, the installation program uses api.<cluster_name>.<base_domain> to derive the IP address from the DNS.Note Before OpenShift Container Platform 4.12, the cluster installation program only accepted an IPv4 address or an IPv6 address for the |
bmcCACert |
redfish and redfish-virtualmedia need this parameter to manage BMC addresses when using self-signed certificates with disableCertificateVerification set to False. |
ingressVIPs |
|
| (Optional) The virtual IP address for ingress traffic. You must either provide this setting in the install-config.yaml file as a reserved IP from the MachineNetwork parameter or preconfigured 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. For dual-stack networking, the primary IP address can be either an IPv4 network or an IPv6 network. If not set, the installation program uses test.apps.<cluster_name>.<base_domain> to derive the IP address from the DNS.Note Before OpenShift Container Platform 4.12, the cluster installation program only accepted an IPv4 address or an IPv6 address for the |
Optional Parameters
| Parameters | Default | Description |
|---|---|---|
platform:
baremetal:
additionalNTPServers:
- <ip_address_or_domain_name> |
An optional list of additional NTP servers to add to each host. You can use an IP address or a domain name to specify each NTP server. Additional NTP servers are user-defined NTP servers that enable preinstallation clock synchronization when the cluster host clocks are out of synchronization. | |
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. When not using the default address range on the provisioning network, you must set this configuration parameter. |
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 installation program is deploying the control plane 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 bare metal bridge of the hypervisor attached to the bare metal 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 parameter determines whether the cluster uses the provisioning network. If it does, the parameter 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 install the cluster by using the Assisted Installer. If Disabled and using power management, BMCs must be accessible from the bare metal network. If Disabled, you must provide two IP addresses on the bare metal network for the provisioning services to use.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.
Hosts
| 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 (control plane node) or worker (compute node). |
|
bmc |
Connection details for the baseboard management controller. See the BMC addressing section for additional details. | |
bmc:
address: |
The protocol and address of the BMC as a URL. | |
bmc:
username: |
The username of the BMC. | |
bmc:
password: |
The password of the BMC. | |
bmc:
disableCertificateVerification: |
False |
redfish and redfish-virtualmedia need this parameter to manage BMC addresses. For OpenShift Container Platform 4.16 and earlier, the value should be True when using a self-signed certificate. OpenShift Container Platform supports self-signed certificates with certificate verification when used with the bmcVerifyCA parameter. |
platform:
baremetal:
bmcVerifyCA: |
A local or self-signed CA certificate that the installation program will use to secure communication with the BMC. If you specify your own CA certificate, ensure that disableCertificateVerification is set to False so that the user-provided CA certificate is validated. |
|
bootMACAddress |
The MAC address of the NIC that the host uses for the provisioning network. Ironic retrieves the IP address by using the bootMACAddress parameter. Then, it binds to the host.Note 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. |
Root device hints¶
The rootDeviceHints parameter enables the installer to provision the Red Hat Enterprise Linux CoreOS (RHCOS) 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.
Subfields
| Subfield | Description |
|---|---|
deviceName |
A string containing a Linux device name such as /dev/vda or /dev/disk/by-path/.Note It is recommended to use the 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). |
- name: master-0
role: master
bmc:
address: ipmi://10.10.0.3:6203
username: admin
password: redhat
bootMACAddress: de:ad:be:ef:00:40
rootDeviceHints:
deviceName: "/dev/sda"
Creating the OpenShift Container Platform manifests¶
Create manifest files to begin customizing your cluster installation.
Procedure
-
Create the OpenShift Container Platform manifests by running the following command:
Example outputINFO Consuming Install Config from target directory WARNING Making control-plane schedulable by setting MastersSchedulable to true for Scheduler cluster settings WARNING Discarding the OpenShift Manifest that was provided in the target directory because its dependencies are dirty and it needs to be regenerated
Deploying the cluster via the OpenShift Container Platform installer¶
You can deploy the cluster by running the OpenShift Container Platform installer.
Procedure
-
Run the OpenShift Container Platform installer:
Following the progress of 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.
Procedure
-
Track installation progress by running the following command: