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:
| Feature | Installer-Provisioned Infrastructure (IPI) | User-Provisioned Infrastructure (UPI) |
| Automation | Fully Automated (“Full-Stack”) | Manual / Existing Infrastructure |
| Infrastructure | Installer creates VMs, networks, storage, and load balancers. | You manually pre-provision VMs, networking, DNS, and load balancers. |
| Day-2 Management | Machine Config Operator (MCO) can scale nodes up/down automatically. | You manually provision and add new host nodes to the cluster. |
| Best For | AWS, Azure, GCP, VMware vSphere, OpenStack, Bare Metal (with IPMI/BMC). | Strict enterprise environments, custom network topologies, air-gapped bare metal. |
Prerequisites Checklist
- Red Hat Account & Pull Secret: Download your cluster pull secret from console.redhat.com/openshift/install.
- Domain & DNS Records: A base domain (e.g.,
example.com). For cluster nameocp4, 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.
- Helper/Bastion Node: A machine running Linux with
openshift-installandocCLI tools installed. - 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 CLIwget https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-install-linux.tar.gzwget https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz# Extract binariestar -xvf openshift-install-linux.tar.gz -C /usr/local/bin/tar -xvf openshift-client-linux.tar.gz -C /usr/local/bin/# Verify installationopenshift-install versionoc 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-installopenshift-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: v1baseDomain: example.comcompute:- hyperthreading: Enabled name: worker replicas: 3controlPlane: hyperthreading: Enabled name: master replicas: 3metadata: name: ocp4platform: aws: region: us-east-1pullSecret: '{"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:
- A temporary Bootstrap VM is created.
- Bootstrap provisions control plane nodes and installs a temporary single-node etcd cluster.
- Control plane nodes boot RHCOS via Ignition files, join etcd, and initialize cluster operators.
- Bootstrap VM is torn down automatically.
- 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 statusoc 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: 1andcompute.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.