Chapter 9. Installing on a single node 9.1. Preparing to install on a single node 9.1.1. Prerequisites You reviewed details about the OpenShift Container Platform installation and update processes. You have read the documentation on selecting a cluster installation method and preparing it for users . 9.1.2. About OpenShift on a single node You can create a single-node cluster with standard installation methods. OpenShift Container Platform on a single node is a specialized installation that requires the creation of a special ignition configuration ISO. The primary use case is for edge computing workloads, including intermittent connectivity, portable clouds, and 5G radio access networks (RAN) close to a base station. The major tradeoff with an installation on a single node is the lack of high availability. Important The use of OpenShiftSDN with single-node OpenShift is deprecated. OVN-Kubernetes is the default networking solution for single-node OpenShift deployments. 9.1.3. Requirements for installing OpenShift on a single node Installing OpenShift Container Platform on a single node alleviates some of the requirements for high availability and large scale clusters. However, you must address the following requirements: Administration host: You must have a computer to prepare the ISO, to create the USB boot drive, and to monitor the installation. Bare metal installation: Installing OpenShift Container Platform on a single node on bare metal requires that you specify the platform.none: {} parameter in the install-config.yaml configuration file. Production-grade server: Installing OpenShift Container Platform on a single node requires a server with sufficient resources to run OpenShift Container Platform services and a production workload. Table 9.1. Minimum resource requirements Profile vCPU Memory Storage Minimum 8 vCPU cores 32GB of RAM 120GB Note One vCPU is equivalent to one physical core when simultaneous multithreading (SMT), or hyperthreading, is not enabled. When enabled, use the following formula to calculate the corresponding ratio: (threads per core x cores) x sockets = vCPUs The server must have a Baseboard Management Controller (BMC) when booting with virtual media. Networking: The server must have access to the internet or access to a local registry if it is not connected to a routable network. The server must have a DHCP reservation or a static IP address for the Kubernetes API, Ingress route, and cluster node domain names. You must configure the DNS to resolve the IP address to each of the following fully qualified domain names (FQDN): Table 9.2. Required DNS records Usage FQDN Description Kubernetes API api.<cluster_name>.<base_domain> Add a DNS A/AAAA or CNAME record. This record must be resolvable by clients external to the cluster. Internal API api-int.<cluster_name>.<base_domain> Add a DNS A/AAAA or CNAME record when creating the ISO manually. This record must be resolvable by nodes within the cluster. Ingress route *.apps.<cluster_name>.<base_domain> Add a wildcard DNS A/AAAA or CNAME record that targets the node. This record must be resolvable by clients external to the cluster. Without persistent IP addresses, communications between the apiserver and etcd might fail. 9.2. Installing OpenShift on a single node 9.2.1. Generating the discovery ISO with the Assisted Installer Installing OpenShift Container Platform on a single node requires a discovery ISO, which the Assisted Installer (AI) can generate with the cluster name, base domain, Secure Shell (SSH) public key, and pull secret. Procedure On the administration node, open a browser and navigate to Install OpenShift with the Assisted Installer . Click Create Cluster to create a new cluster. In the Cluster name field, enter a name for the cluster. In the Base domain field, enter a base domain. For example: All DNS records must be subdomains of this base domain and include the cluster name. You cannot change the base domain after cluster installation. For example: Select Install single node OpenShift (SNO) . Read the 4.9 release notes, which outline some of the limitations for installing OpenShift Container Platform on a single node. Select the OpenShift Container Platform version. Optional: Edit the pull secret. Click . Click Generate Discovery ISO . Select Full image file to boot with a USB drive or PXE. Select Minimal image file to boot with virtual media. Add SSH public key of the administration node to the Public key field. Click Generate Discovery ISO . Download the discovery ISO. Make a note of the discovery ISO URL for installing with virtual media. 9.2.2. Generating the discovery ISO manually Installing OpenShift Container Platform on a single node requires a discovery ISO, which you can generate with the following procedure. Procedure Download the OpenShift Container Platform client ( oc ) and make it available for use by entering the following command: USD curl -k https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz > oc.tar.gz USD tar zxf oc.tar.gz USD chmod +x oc Set the OpenShift Container Platform version: USD OCP_VERSION=<ocp_version> 1 1 Replace <ocp_version> with the current version. For example. latest-4.9 Download the OpenShift Container Platform installer and make it available for use by entering the following commands: USD curl -k https://mirror.openshift.com/pub/openshift-v4/clients/ocp/USDOCP_VERSION/openshift-install-linux.tar.gz > openshift-install-linux.tar.gz USD tar zxvf openshift-install-linux.tar.gz USD chmod +x openshift-install Retrieve the RHCOS ISO URL: USD ISO_URL=USD(./openshift-install coreos print-stream-json | grep location | grep x86_64 | grep iso | cut -d\" -f4) Download the RHCOS ISO: USD curl -L USDISO_URL > rhcos-live.x86_64.iso Prepare the install-config.yaml file: apiVersion: v1 baseDomain: <domain> 1 compute: - name: worker replicas: 0 2 controlPlane: name: master replicas: 1 3 metadata: name: <name> 4 networking: networkType: OVNKubernetes clusterNetwork: - cidr: <IP_address>/<prefix> 5 hostPrefix: <prefix> 6 serviceNetwork: - <IP_address>/<prefix> 7 platform: none: {} bootstrapInPlace: installationDisk: <path_to_install_drive> 8 pullSecret: '<pull_secret>' 9 sshKey: | <ssh_key> 10 1 Add the cluster domain name. 2 Set the compute replicas to 0 . This makes the control plane node schedulable. 3 Set the controlPlane replicas to 1 . In conjunction with the compute setting, this setting ensures the cluster runs on a single node. 4 Set the metadata name to the cluster name. 5 Set the clusterNetwork CIDR. 6 Set the clusterNetwork host prefix. Pods receive their IP addresses from this pool. 7 Set the serviceNetwork CIDR. Services receive their IP addresses from this pool. 8 Set the path to the installation disk drive. 9 Copy the pull secret from the Red Hat OpenShift Cluster Manager . In step 1, click Download pull secret and add the contents to this configuration setting. 10 Add the public SSH key from the administration host so that you can log in to the cluster after installation. Generate OpenShift Container Platform assets: USD mkdir ocp USD cp install-config.yaml ocp USD ./openshift-install --dir=ocp create single-node-ignition-config Embed the ignition data into the RHCOS ISO: USD alias coreos-installer='podman run --privileged --pull always --rm \ -v /dev:/dev -v /run/udev:/run/udev -v USDPWD:/data \ -w /data quay.io/coreos/coreos-installer:release' USD cp ocp/bootstrap-in-place-for-live-iso.ign iso.ign USD coreos-installer iso ignition embed -fi iso.ign rhcos-live.x86_64.iso 9.2.3. Installing with USB media Installing with USB media involves creating a bootable USB drive with the discovery ISO on the administration node. Booting the server with the USB drive prepares the node for a single node installation. Procedure On the administration node, insert a USB drive into a USB port. Create a bootable USB drive: # dd if=<path-to-iso> of=<path/to/usb> status=progress For example: # dd if=discovery_image_sno.iso of=/dev/sdb status=progress After the ISO is copied to the USB drive, you can use the USB drive to install OpenShift Container Platform. On the server, insert the USB drive into a USB port. Reboot the server and enter the BIOS settings upon reboot. Change boot drive order to make the USB drive boot first. Save and exit the BIOS settings. The server will boot with the discovery image. 9.2.4. Monitoring the installation with the Assisted Installer If you created the ISO using the Assisted Installer, use this procedure to monitor the installation. Procedure On the administration host, return to the browser and refresh the page. If necessary, reload the Install OpenShift with the Assisted Installer page and select the cluster name. Click until you reach step 3, Networking . Select a subnet from the available subnets. Keep Use the same host discovery SSH key checked. You can change the SSH public key, if necessary. Click to proceed to the Review and Create step. Click Install cluster . Monitor the installation's progress. Watch the cluster events. After the installation process finishes writing the discovery image to the server's drive, the server will restart. Remove the USB drive and reset the BIOS to boot to the server's local media rather than the USB drive. The server will restart several times, deploying the control plane. 9.2.5. Monitoring the installation manually If you created the ISO manually, use this procedure to monitor the installation. Procedure Monitor the installation: USD ./openshift-install --dir=ocp wait-for install-complete The server will restart several times while deploying the control plane. Optional: After the installation is complete, check the environment: USD export KUBECONFIG=ocp/auth/kubeconfig USD oc get nodes USD oc get clusterversion

Commands:
example.com
<cluster-name>.example.com
curl -k https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz > oc.tar.gz
tar zxf oc.tar.gz
chmod +x oc
OCP_VERSION=<ocp_version> 1
curl -k https://mirror.openshift.com/pub/openshift-v4/clients/ocp/USDOCP_VERSION/openshift-install-linux.tar.gz > openshift-install-linux.tar.gz
tar zxvf openshift-install-linux.tar.gz
chmod +x openshift-install
ISO_URL=USD(./openshift-install coreos print-stream-json | grep location | grep x86_64 | grep iso | cut -d\" -f4)
curl -L USDISO_URL > rhcos-live.x86_64.iso
apiVersion: v1 baseDomain: <domain> 1 compute: - name: worker replicas: 0 2 controlPlane: name: master replicas: 1 3 metadata: name: <name> 4 networking: networkType: OVNKubernetes clusterNetwork: - cidr: <IP_address>/<prefix> 5 hostPrefix: <prefix> 6 serviceNetwork: - <IP_address>/<prefix> 7 platform: none: {} bootstrapInPlace: installationDisk: <path_to_install_drive> 8 pullSecret: '<pull_secret>' 9 sshKey: | <ssh_key> 10
mkdir ocp
cp install-config.yaml ocp
./openshift-install --dir=ocp create single-node-ignition-config
alias coreos-installer='podman run --privileged --pull always --rm -v /dev:/dev -v /run/udev:/run/udev -v USDPWD:/data -w /data quay.io/coreos/coreos-installer:release'
cp ocp/bootstrap-in-place-for-live-iso.ign iso.ign
coreos-installer iso ignition embed -fi iso.ign rhcos-live.x86_64.iso
dd if=<path-to-iso> of=<path/to/usb> status=progress
dd if=discovery_image_sno.iso of=/dev/sdb status=progress
./openshift-install --dir=ocp wait-for install-complete
export KUBECONFIG=ocp/auth/kubeconfig
oc get nodes
oc get clusterversion