Agent-based offline installation

Install an OpenShift cluster with the Agent-based Installer from a local mirror, with no connection to the internet during the install.

Updated CompTech Team

An air-gapped site cannot pull images from Red Hat during an install, and it often has no extra machine to spare as a bootstrap host. The Agent-based Installer solves both. openshift-install agent create image builds one ISO. You boot every node from that ISO. One node, the rendezvous host, coordinates the install. The release images come from a mirror registry you filled beforehand. This lab builds a three-node compact cluster, three control-plane hosts and no dedicated workers, so the masters are schedulable. A single node uses the same ISO path.

Prerequisites

  • A mirror host that can reach the internet before the site is sealed, with oc, openshift-install and podman. The installer binary must be the same z-stream as the release you mirror.
  • A pull secret from console.redhat.com, plus an SSH public key.
  • Three bare-metal or virtual hosts on one L2 network, with static IPs, DNS and NTP. Clocks that disagree will stall the install.
  • DNS names api.<name>.<base> and *.apps.<name>.<base> that you control.

Mirror the release

Stand up a registry the cluster can see. The mirror registry for Red Hat OpenShift is the small one we use in the lab:

mirror-registry install \
  --quayHostname mirror.lab.example.com \
  --quayRoot /data/quay
podman login mirror.lab.example.com:8443

Mirror one pinned release. Replace the tag with the z-stream you downloaded:

oc adm release mirror \
  --from=quay.io/openshift-release-dev/ocp-release:4.21.0-x86_64 \
  --to=mirror.lab.example.com:8443/ocp/release \
  --to-release-image=mirror.lab.example.com:8443/ocp/release:4.21.0-x86_64

The command prints an imageContentSources block. Keep it. You will paste it into install-config.yaml. Merge the mirror CA and a login for the mirror into the pull secret the installer carries. To mirror operator catalogs as well, use the oc-mirror plugin v2 later; the cluster install itself only needs the release. The operator list is the set we mirror.

Write the two manifests

Create a directory and put install-config.yaml and agent-config.yaml in it. These two files are the preferred input. GitOps ZTP manifests are the other accepted input; this lab uses the preferred pair.

apiVersion: v1
baseDomain: lab.example.com
metadata:
  name: lab
compute:
- architecture: amd64
  hyperthreading: Enabled
  name: worker
  replicas: 0
controlPlane:
  architecture: amd64
  hyperthreading: Enabled
  name: master
  replicas: 3
networking:
  networkType: OVNKubernetes
  machineNetwork:
  - cidr: 192.168.111.0/24
platform:
  baremetal:
    apiVIPs:
    - 192.168.111.20
    ingressVIPs:
    - 192.168.111.21
pullSecret: '<merged pull secret>'
sshKey: '<ssh public key>'
imageContentSources:
- mirrors:
  - mirror.lab.example.com:8443/ocp/release
  source: quay.io/openshift-release-dev/ocp-release
- mirrors:
  - mirror.lab.example.com:8443/ocp/release
  source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
additionalTrustBundle: |
  -----BEGIN CERTIFICATE-----
  <mirror registry CA>
  -----END CERTIFICATE-----

imageContentSources must be the block the mirror command printed, not a guess. additionalTrustBundle is the mirror CA, so nodes trust the registry. Set fips: true here when the site requires FIPS. The API and ingress VIPs sit on the machine network and must not be the address of any host.

agent-config.yaml names the rendezvous host and gives every node a static address. Repeat the hosts entry for .11 and .12.

apiVersion: v1beta1
kind: AgentConfig
metadata:
  name: lab
rendezvousIP: 192.168.111.10
hosts:
- hostname: master-0
  role: master
  interfaces:
  - name: eno1
    macAddress: 00:ef:44:21:e6:a5
  rootDeviceHints:
    deviceName: /dev/sda
  networkConfig:
    interfaces:
    - name: eno1
      type: ethernet
      state: up
      mac-address: 00:ef:44:21:e6:a5
      ipv4:
        enabled: true
        dhcp: false
        address:
        - ip: 192.168.111.10
          prefix-length: 24

Add the nmstate DNS resolver (192.168.111.1) and a default route on eno1. Match macAddress to the NIC that will boot the ISO. A wrong root device hint installs onto the wrong disk.

Build the ISO and boot

openshift-install agent create image --dir ./lab --log-level info

The ISO is ./lab/agent.x86_64.iso. Boot all three hosts from it with virtual media, USB or PXE. They need the mirror, DNS and the VIPs. From a host that can route to the machine network:

openshift-install agent wait-for bootstrap-complete --dir ./lab
openshift-install agent wait-for install-complete --dir ./lab
export KUBECONFIG=./lab/auth/kubeconfig
oc get nodes
oc get clusterversion
oc get clusteroperators

kubeadmin and its password are in ./lab/auth/kubeadmin-password. Store the kubeconfig with the pull secret.

When the install sits still

What you see What to check
Nodes never join Rendezvous IP, VLAN and the MAC in agent-config.yaml
Image pulls fail imageContentSources, the mirror CA, and the pull secret's mirror login
API never answers DNS for api. and *.apps., and that the VIPs are free
Operators degrade after install The catalog is still the default internet one. Mirror it and point CatalogSource at the mirror

What's next

  1. Operator list: the operators we subscribe after the mirror is in place, and how the list is reviewed.
  2. Connectivity Link: Gateway API, authentication and rate limits on the new cluster.
  3. One sovereign platform: GPU servers, OpenShift AI and NVIDIA AI Enterprise on this same air-gapped cluster.