Install Red Hat OpenShift on AlmaLinux 9/10

This guide provides a step-by-step installation of Red Hat OpenShift Container Platform (OCP) on AlmaLinux 9 or AlmaLinux 10 using User Provisioned Infrastructure (UPI).

1. Prerequisites


- AlmaLinux 9 or AlmaLinux 10 servers
- Minimum 16 GB RAM per node
- Minimum 4 vCPU per node
- Static IP addresses
- Proper DNS configuration
- Load Balancer configured
- Internet connectivity
- SSH access enabled
- SELinux enabled

2. Set Hostname


sudo hostnamectl set-hostname master1.ocp.example.com

3. Configure /etc/hosts


sudo vi /etc/hosts

# Add:
192.168.1.10 api.ocp.example.com
192.168.1.11 master1.ocp.example.com
192.168.1.12 master2.ocp.example.com
192.168.1.13 master3.ocp.example.com
192.168.1.21 worker1.ocp.example.com
192.168.1.22 worker2.ocp.example.com

4. Update System Packages


sudo dnf update -y
sudo reboot

5. Install Required Packages


sudo dnf install -y \
wget \
curl \
git \
vim \
jq \
tar \
podman \
bind-utils \
net-tools

6. Disable Swap


sudo swapoff -a

sudo sed -i '/swap/d' /etc/fstab

7. Configure SELinux


sudo setenforce 1

sestatus

8. Configure Firewall


sudo firewall-cmd --permanent --add-port=6443/tcp
sudo firewall-cmd --permanent --add-port=22623/tcp
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https

sudo firewall-cmd --reload

9. Download OpenShift Installer


wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-install-linux.tar.gz

tar -xvf openshift-install-linux.tar.gz

sudo mv openshift-install /usr/local/bin/

10. Download OpenShift Client Tools


wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz

tar -xvf openshift-client-linux.tar.gz

sudo mv oc kubectl /usr/local/bin/

11. Verify Installation Tools


openshift-install version

oc version

kubectl version --client

12. Create Installation Directory


mkdir ~/openshift-install

cd ~/openshift-install

13. Generate SSH Key


ssh-keygen -t rsa -b 4096

cat ~/.ssh/id_rsa.pub

14. Create Install Configuration


openshift-install create install-config

15. Create OpenShift Cluster


openshift-install create cluster \
--dir=~/openshift-install \
--log-level=info

16. Access OpenShift Web Console


https://console-openshift-console.apps.ocp.example.com

17. Login to OpenShift CLI


oc login -u kubeadmin -p  \
https://api.ocp.example.com:6443

18. Verify Cluster Status


oc get nodes

oc get pods -A

oc cluster-info

19. Configure Persistent Storage (Optional)


- Configure NFS Storage
- Configure Ceph Storage
- Configure Local Persistent Volumes

20. Optional Post Installation Tasks


- Install Operators
- Configure Monitoring
- Configure Logging
- Configure Authentication
- Configure Ingress
- Create Projects and Users