Guide to Installing Red Hat OpenShift OCP 4.x

Installing Red Hat OpenShift Container Platform (OCP) 4.x is an automated, declarative process driven by the OpenShift Installer.

Unlike legacy Kubernetes setups, OCP 4 uses Red Hat Enterprise Linux CoreOS (RHCOS) as its immutable host operating system, which is automatically provisioned and managed by the cluster itself.

Key Installation Paradigms

Before deploying, you must choose between two main installation paradigms:

FeatureInstaller-Provisioned Infrastructure (IPI)User-Provisioned Infrastructure (UPI)
AutomationFully Automated (“Full-Stack”)Manual / Existing Infrastructure
InfrastructureInstaller creates VMs, networks, storage, and load balancers.You manually pre-provision VMs, networking, DNS, and load balancers.
Day-2 ManagementMachine Config Operator (MCO) can scale nodes up/down automatically.You manually provision and add new host nodes to the cluster.
Best ForAWS, Azure, GCP, VMware vSphere, OpenStack, Bare Metal (with IPMI/BMC).Strict enterprise environments, custom network topologies, air-gapped bare metal.

Prerequisites Checklist

  1. Red Hat Account & Pull Secret: Download your cluster pull secret from console.redhat.com/openshift/install.
  2. Domain & DNS Records: A base domain (e.g., example.com). For cluster name ocp4, you need:
    • api.ocp4.example.com$\rightarrow$ Points to control plane / API load balancer.
    • api-int.ocp4.example.com$\rightarrow$ Points to internal API load balancer.
    • *.apps.ocp4.example.com$\rightarrow$ Points to ingress/router load balancer.
  3. Helper/Bastion Node: A machine running Linux with openshift-install and oc CLI tools installed.
  4. Minimum Sizing (Standard Cluster):
    • 3 Control Plane (Master) Nodes: Minimum 4 vCPU, 16 GB RAM, 120 GB Storage each.
    • 2+ Worker Nodes: Minimum 2 vCPU, 8 GB RAM, 120 GB Storage each.

1.Download Installer and CLI Tools:Command-line Tooling.

From the Red Hat Hybrid Cloud Console, download the binaries for your target release:

Bash

# Download OpenShift Installer and oc CLI
wget https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-install-linux.tar.gz
wget https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz
# Extract binaries
tar -xvf openshift-install-linux.tar.gz -C /usr/local/bin/
tar -xvf openshift-client-linux.tar.gz -C /usr/local/bin/
# Verify installation
openshift-install version
oc version

Verification: Running openshift-install version outputs the targeted OCP version (e.g., 4.16.x).

2.Generate the Installation Configuration:Declarative Manifests.

Create a clean working directory and generate the default install-config.yaml:

Bash

mkdir ~/ocp4-install && cd ~/ocp4-install
openshift-install create install-config --dir=.

An interactive wizard will prompt you for:

  • SSH Public Key: For emergency node debugging.
  • Platform: (e.g., aws, vsphere, baremetal, azure, gcp).
  • Base Domain:example.com
  • Cluster Name:ocp4
  • Pull Secret: Paste the JSON string downloaded from Red Hat.

Example install-config.yaml output:

YAML

apiVersion: v1
baseDomain: example.com
compute:
- hyperthreading: Enabled
name: worker
replicas: 3
controlPlane:
hyperthreading: Enabled
name: master
replicas: 3
metadata:
name: ocp4
platform:
aws:
region: us-east-1
pullSecret: '{"auths": ...}'
sshKey: 'ssh-rsa AAAAB3NzaC1...'

3.Trigger Cluster Creation (IPI Method):Automated Deployment.

Run the installer using your install-config.yaml:

Bash

openshift-install create cluster --dir=. --log-level=info

What happens under the hood during this step:

  1. A temporary Bootstrap VM is created.
  2. Bootstrap provisions control plane nodes and installs a temporary single-node etcd cluster.
  3. Control plane nodes boot RHCOS via Ignition files, join etcd, and initialize cluster operators.
  4. Bootstrap VM is torn down automatically.
  5. Worker nodes are provisioned, join the cluster, and standard workloads initialize.

Verification: The installation completes when the terminal prints the kubeadmin credentials and Console URL.

4.Verify Cluster Health & Operators:Post-Install Validation.

Export the generated kubeconfig to interact with your new cluster:

Bash

export KUBECONFIG=~/ocp4-install/auth/kubeconfig
# Check node status
oc get nodes
# Check ClusterOperator status (all should be Available=True, Progressing=False, Degraded=False)
oc get clusteroperators

Verification: All nodes report Ready status and all 30+ ClusterOperators report AVAILABLE=True.

Alternative Installation Variants

  • Single Node OpenShift (SNO): Packs control plane and worker roles onto a single bare-metal server or VM (ideal for edge computing). Set controlPlane.replicas: 1 and compute.replicas: 0.
  • Assisted Installer (Web GUI): Red Hat offers a cloud-hosted GUI at console.redhat.com that generates a custom bootable ISO for bare-metal/VM installs without needing an external bastion node.
  • Air-Gapped / Disconnected Install: Requires mirroring OpenShift container images into an internal private registry (e.g., Red Hat Quay) prior to running openshift-install.

Leave a Reply