Generate the custom single-node OpenShift ISO

Create a customized, bootable Red Hat Enterprise Linux CoreOS (RHCOS) live ISO that contains pre-configured OpenShift Container Platform manifests and NVIDIA node customizations.

Before you begin

  • You have reviewed the requirements for installing OpenShift on a single node.
  • You have installed podman.
  • You are starting with a fresh installation location.

    Remove older installations before starting the installation process to prevent disk issues.

  • You have contacted Red Hat Support before starting this process.

    You will need assistance from Red Hat Support to obtain the RHCOS ISO.

Procedure

  1. Set the OpenShift Container Platform version:
    $ export OCP_VERSION=<ocp_version>
    Important
    You must set <ocp_version> to a 4.22 value, such as latest-4.22, because 4.22 is the only version currently allowed.
  2. Set the installation host architecture:
    $ export HOST_ARCH=$(uname -m)

    This command detects the architecture of the installation host. If the installation host architecture differs from the target cluster architecture, the downloaded binaries must match the installation host. For example, if you are installing an aarch64 cluster from an x86_64 bastion host, HOST_ARCH is x86_64.

  3. Download the OpenShift Container Platform client (oc) and make it available for use by entering the following commands:
    $ curl https://mirror.openshift.com/pub/openshift-v4/$HOST_ARCH/clients/ocp/$OCP_VERSION/openshift-client-linux.tar.gz -o oc.tar.gz
    $ tar zxf oc.tar.gz
    $ chmod +x oc
  4. Download the OpenShift Container Platform installer and make it available for use by entering the following commands:
    $ curl https://mirror.openshift.com/pub/openshift-v4/$HOST_ARCH/clients/ocp/$OCP_VERSION/openshift-install-linux.tar.gz -o openshift-install-linux.tar.gz
    $ tar zxvf openshift-install-linux.tar.gz
    $ chmod +x openshift-install
  5. Export the RHCOS ISO URL by running the following command:
    $ export ISO_URL="<iso_url>"

    Replace <iso_url> with the URL for the ISO. Contact Red Hat Support for assistance with obtaining the ISO.

  6. Download the RHCOS ISO:
    $ curl -L $ISO_URL -o rhcos-live.iso
  7. Prepare the install-config.yaml file:
    apiVersion: v1
    baseDomain: nvidia.local
    compute:
    - name: worker
      replicas: 0 
    controlPlane:
      name: master
      replicas: 1 
    metadata:
      name: next-gen
    networking: 
      clusterNetwork:
      - cidr: 10.128.0.0/14
        hostPrefix: 23
      machineNetwork:
      - cidr:  10.78.214.0/27
      networkType: OVNKubernetes
      serviceNetwork:
      - 172.30.0.0/16
    platform:
      none: {}
    bootstrapInPlace:
      installationDisk: /dev/disk/by-id/<disk_id>
    osImageStream: "rhel-10"
    featureSet: TechPreviewNoUpgrade
    pullSecret: '<pull_secret>'
    sshKey: |
      <ssh_key>

    where:

    baseDomain
    Specifies the cluster domain name.
    compute.replicas
    Specifies the value of compute.replicas as 0. This makes the control plane node schedulable.
    controlPlane.replicas
    Specifies the value of controlPlane.replicas as 1. In conjunction with the previous compute setting, this setting ensures the cluster runs on a single node.
    metadata.name
    Specifies the metadata name to the cluster name.
    networking
    Specifies the networking details. OVN-Kubernetes is the only allowed network plugin type for single-node clusters.
    machineNetwork.cidr
    Specifies the cidr value to match the subnet of the cluster.
    installationDisk
    Specifies the path to the installation disk drive, for example, /dev/disk/by-id/wwn-0x64cd98f04fde100024684cf3034da5c2.
    osImageStream
    Specifies a value of rhel-10 to use RHCOS 10 for NVIDIA hardware testing. Standard OpenShift Container Platform 4.22 clusters only support RHCOS 9.
    featureSet
    Specifies a value of TechPreviewNoUpgrade to use the Technology Preview feature set.
    pullSecret
    Specifies the pullSecret parameter. Copy the pull secret from Red Hat OpenShift Cluster Manager and add the contents to this configuration setting.
    sshKey
    Specifies the sshKey parameter. Add the public SSH key from the administration host so that you can log in to the cluster after installation.
  8. Build the custom NVIDIA node image.
    1. Obtain the base image for your OpenShift Container Platform 4.22 release by running the following command:
      $ oc adm release info quay.io/openshift-release-dev/ocp-release:4.22.<z_stream>-aarch64 --image-for=rhel-coreos-10

      Replace <z_stream> with your OpenShift Container Platform 4.22 z-stream. You must use version 4.22.10 or later.

      For example:

      $ oc adm release info quay.io/openshift-release-dev/ocp-release:4.22.10-aarch64 --image-for=rhel-coreos-10

      Save the output to use as the base image in the Dockerfile in the next step.

    2. Create a file called Dockerfile with the following contents:
      FROM <base_image>
      
      RUN <<EOF
      
      arch="$(uname -m)"
      dnf remove kernel-core --assumeyes
      
      kernel_name='kernel-core kernel-modules-extra'
      [ "$arch" = 'aarch64' ] && kernel_name='kernel-64k-core kernel-64k-modules-extra'
      
      dnf install --assumeyes --releasever=10.2 --disablerepo=* --enablerepo=rhel-10-for-aarch64-baseos-rpms --enablerepo=rhel-10-for-aarch64-appstream-rpms --enablerepo=rhel-10-for-aarch64-nvidia-rpms $kernel_name
      
      kver=$(ls /usr/lib/modules)
      env DRACUT_NO_XATTR=1 dracut -vf /usr/lib/modules/$kver/initramfs.img "$kver"
      EOF

      Replace <base_image> with the base node image from the output of the previous step.

    3. Build the custom node image and push it to an image registry.
      If you use a personal or private registry, ensure that the image is accessible to the cluster during installation.
  9. Create a file called 99-os-layer-custom.yaml with the following contents to define the custom NVIDIA layered image:
    apiVersion: machineconfiguration.openshift.io/v1
    kind: MachineConfig
    metadata:
      labels:
        machineconfiguration.openshift.io/role: master
      name: os-layer-custom
    spec:
      osImageURL: <custom_node_image_url>

    Replace <custom_node_image_url> with the URL of the custom node image that you built and pushed in the previous steps.

  10. Generate OpenShift Container Platform manifests by running the following commands:
    $ mkdir ocp
    $ cp install-config.yaml ocp
    $ ./openshift-install create manifests --dir ocp/
  11. Copy the custom NVIDIA layered image configuration file into the assets directory by running the following command:
    $ cp 99-os-layer-custom.yaml ocp/openshift/.
  12. Generate the single-node OpenShift Ignition config by running the following commands:
    $ ./openshift-install --dir=ocp create single-node-ignition-config
  13. Embed the Ignition data into the RHCOS ISO by running the following commands:
    $ alias coreos-installer='podman run --privileged --pull always --rm \
            -v /dev:/dev -v /run/udev:/run/udev -v $PWD:/data \
            -w /data quay.io/coreos/coreos-installer:release'
    $ coreos-installer iso ignition embed -fi ocp/bootstrap-in-place-for-live-iso.ign rhcos-live.iso
    Important
    The SSL certificates for the RHCOS ISO installation image are only valid for 24 hours. If you use the ISO image to install a node more than 24 hours after creating the image, the installation can fail. To re-create the image after 24 hours, delete the ocp directory and re-create the OpenShift Container Platform assets.

Results

You can now install Red Hat OpenShift for NVIDIA by booting the server from the ISO.