Installing OpenShift on a single node

Generating the discovery ISO with the Assisted Installer

Installing OKD 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

  1. On the administration node, open a browser and navigate to Install OpenShift with the Assisted Installer.

  2. Click Create Cluster to create a new cluster.

  3. In the Cluster name field, enter a name for the cluster.

  4. In the Base domain field, enter a base domain. For example:

    1. example.com

    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:

    1. <cluster-name>.example.com
  5. Select Install single node OpenShift (SNO).

  6. Read the limitations for installing OKD on a single node.

  7. Select the OKD version.

  8. Optional: Edit the pull secret.

  9. Click Next.

  10. Click Generate Discovery ISO.

  11. Select Full image file to boot with a USB drive or PXE. Select Minimal image file to boot with virtual media.

  12. Add SSH public key of the administration node to the Public key field.

  13. Click Generate Discovery ISO.

  14. Download the discovery ISO.

  15. Make a note of the discovery ISO URL for installing with virtual media.

Generating the discovery ISO manually

Installing OKD on a single node requires a discovery ISO, which you can generate with the following procedure.

Procedure

  1. Download the OKD client (oc) and make it available for use by entering the following command:

    1. $ curl -k https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz > oc.tar.gz
    1. $ tar zxf oc.tar.gz
    1. $ chmod +x oc
  2. Set the OKD version:

    1. $ OCP_VERSION=<ocp_version> (1)
    1Replace <ocp_version> with the current version. For example. latest-4.9
  3. Download the OKD installer and make it available for use by entering the following commands:

    1. $ curl -k https://mirror.openshift.com/pub/openshift-v4/clients/ocp/$OCP_VERSION/openshift-install-linux.tar.gz > openshift-install-linux.tar.gz
    1. $ tar zxvf openshift-install-linux.tar.gz
    1. $ chmod +x openshift-install
  4. Retrieve the FCOS ISO URL:

    1. $ ISO_URL=$(./openshift-install coreos print-stream-json | grep location | grep x86_64 | grep iso | cut -d\" -f4)
  5. Download the FCOS ISO:

    1. $ curl $ISO_URL > rhcos-live.x86_64.iso
  6. Prepare the install-config.yaml file:

    1. apiVersion: v1
    2. baseDomain: <domain> (1)
    3. compute:
    4. - name: worker
    5. replicas: 0 (2)
    6. controlPlane:
    7. name: master
    8. replicas: 1 (3)
    9. metadata:
    10. name: <name> (4)
    11. networking:
    12. networkType: OVNKubernetes
    13. clusterNetwork:
    14. - cidr: <IP_address>/<prefix> (5)
    15. hostPrefix: <prefix> (6)
    16. serviceNetwork:
    17. - <IP_address>/<prefix> (7)
    18. platform:
    19. none: {}
    20. BootstrapInPlace:
    21. InstallationDisk: <path_to_install_drive> (8)
    22. pullSecret: '<pull_secret>' (9)
    23. sshKey: |
    24. <ssh_key> (10)
    1Add the cluster domain name.
    2Set the compute replicas to 0. This makes the control plane node schedulable.
    3Set the controlPlane replicas to 1. In conjunction with the previous compute setting, this setting ensures the cluster runs on a single node.
    4Set the metadata name to the cluster name.
    5Set the clusterNetwork CIDR.
    6Set the clusterNetwork host prefix. Pods receive their IP addresses from this pool.
    7Set the serviceNetwork CIDR. Services receive their IP addresses from this pool.
    8Set the path to the installation disk drive.
    9Copy the pull secret from Red Hat Hybrid Cloud Console. In step 1, click Download pull secret and add the contents to this configuration setting.
    10Add the public SSH key from the administration host so that you can log in to the cluster after installation.
  7. Generate OKD assets:

    1. $ mkdir ocp
    1. $ cp install-config.yaml ocp
    1. $ ./openshift-install --dir=ocp create single-node-ignition-config
  8. Embed the ignition data into the FCOS ISO:

    1. $ alias coreos-installer='podman run --privileged --rm \
    2. -v /dev:/dev -v /run/udev:/run/udev -v $PWD:/data \
    3. -w /data quay.io/coreos/coreos-installer:release'
    1. $ cp ocp/bootstrap-in-place-for-live-iso.ign iso.ign
    1. $ coreos-installer iso ignition embed -fi iso.ign rhcos-live.x86_64.iso

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

  1. On the administration node, insert a USB drive into a USB port.

  2. Create a bootable USB drive:

    1. # dd if=<path-to-iso> of=<path/to/usb> status=progress

    For example:

    1. # 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 OKD.

  3. On the server, insert the USB drive into a USB port.

  4. Reboot the server and enter the BIOS settings upon reboot.

  5. Change boot drive order to make the USB drive boot first.

  6. Save and exit the BIOS settings. The server will boot with the discovery image.

Monitoring the installation with the Assisted Installer

If you created the ISO using the Assisted Installer, use this procedure to monitor the installation.

Procedure

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

  2. Click Next until you reach step 3, Networking.

  3. Select a subnet from the available subnets.

  4. Keep Use the same host discovery SSH key checked. You can change the SSH public key, if necessary.

  5. Click Next to proceed to the Review and Create step.

  6. Click Install cluster.

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

Monitoring the installation manually

If you created the ISO manually, use this procedure to monitor the installation.

Procedure

  1. Monitor the installation:

    1. $ ./openshift-install --dir=ocp wait-for install-complete

    The server will restart several times while deploying the control plane.

  2. Optional: After the installation is complete, check the environment:

    1. $ export KUBECONFIG=ocp/auth/kubeconfig
    1. $ oc get nodes
    1. $ oc get clusterversion