Introduction
OpenShift is a powerful Kubernetes-based platform designed to accelerate the development, deployment, and management of containerized applications. Built by Red Hat, it provides developers with self-service capabilities while giving IT teams the tools to ensure security, compliance, and operational efficiency.
Organizations can use OpenShift for:
- Developing modern applications with built-in CI/CD pipelines.
- Streamlining DevOps workflows by standardizing Kubernetes-based infrastructure.
- Managing hybrid or multi-cloud environments with ease and scalability.
If you’re looking to deploy OpenShift on-premises using Red Hat Enterprise Linux, follow the steps below to set up your cluster.
Prerequisites
-
Hardware Requirements (minimum):
- Control Plane (Master): 4 CPUs, 16GB RAM, 120GB storage.
- Worker Nodes: 2 CPUs, 8GB RAM, 120GB storage per node.
-
Software Requirements:
- RHEL 8.x installed on all nodes.
- SSH access to all servers.
- A wildcard DNS configured for OpenShift routes (e.g.,
*.apps.your-domain.com
).
-
Download OpenShift Components:
- OpenShift Installer: From Red Hat OpenShift Console.
- Pull Secret: Available from the same portal.
-
Networking Requirements:
- Open ports: 443, 6443, and 22623 on all nodes.
Step 1: Prepare RHEL on All Nodes
-
Update Your System:
Ensure all nodes are running the latest updates.sudo dnf update -y
-
Install Required Packages:
sudo dnf install -y wget git vim net-tools bind-utils iptables-services \ bash-completion chrony podman
-
Enable NTP for Time Synchronization:
sudo systemctl enable --now chronyd
-
Disable Swap (required for Kubernetes):
sudo swapoff -a sudo sed -i '/swap/d' /etc/fstab
-
Enable Kernel Modules:
sudo modprobe overlay sudo modprobe br_netfilter echo 'overlay' | sudo tee -a /etc/modules-load.d/overlay.conf echo 'br_netfilter' | sudo tee -a /etc/modules-load.d/br_netfilter.conf
-
Configure Firewall Rules:
sudo firewall-cmd --permanent --add-port=6443/tcp sudo firewall-cmd --permanent --add-port=22623/tcp sudo firewall-cmd --permanent --add-port=443/tcp sudo firewall-cmd --reload
Step 2: Set Up the OpenShift Installer
-
Download and Extract the Installer:
wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-install-linux.tar.gz tar -xvf openshift-install-linux.tar.gz -C /usr/local/bin
-
Verify the Installation:
openshift-install version
Step 3: Generate the Configuration
-
Create the install-config.yaml File:
Run the following command:openshift-install create install-config
You will need to provide:
- Cluster name.
- Base domain.
- Your pull secret.
- SSH public key for node access.
-
Edit Configuration (Optional):
Customizeinstall-config.yaml
to adjust networking, storage, or machine sets.
Step 4: Deploy the Cluster
-
Start Installation:
Run the following command to begin deploying your OpenShift cluster:openshift-install create cluster
This process will install the control plane and worker nodes.
-
Monitor Progress:
The installer will provide real-time updates. Logs are stored at/var/log/openshift-install.log
.
Step 5: Access Your OpenShift Cluster
-
Retrieve the Administrator Credentials:
cat ./auth/kubeadmin-password
-
Open the OpenShift Console:
Navigate to:https://<api.cluster-name.domain>:6443
Log in using the
kubeadmin
user and the password from the previous step.
Step 6: Verify Your Cluster
-
Check Node Status:
oc get nodes
-
Verify Pod Deployments:
oc get pods -n openshift-*
Troubleshooting Tips
- DNS Issues: Use
dig
ornslookup
to confirm DNS records. - Firewall Configuration: Ensure required ports are open between nodes.
- Logs: Check logs at
/var/log/openshift-install.log
for detailed error messages.
With OpenShift running on RHEL, you’re ready to deliver containerized workloads with enterprise-grade reliability and efficiency. Have any questions or need help? Drop them in the comments!