Prerequisites
Before installing Kubernetes on RHEL 9 with kubeadm:
- Administrative/root access
- Minimum 2 CPU cores and 2GB RAM per node
- Internet connectivity
- Container runtime (containerd recommended)
Installation Steps
Step 1: Prepare the System
# Disable swap (required for kubelet)
sudo swapoff -a
# Load required kernel modules
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF
sudo modprobe overlay && sudo modprobe br_netfilter
# Set sysctl params
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1
EOF
sudo sysctl --systemStep 2: Install Container Runtime
# Install containerd
sudo apt-get update && sudo apt-get install -y containerd
sudo mkdir -p /etc/containerd
containerd config default | sudo tee /etc/containerd/config.toml
sudo systemctl restart containerdStep 3: Install Kubernetes Components
# Add Kubernetes repo and install
# kubeadm, kubelet, kubectlStep 4: Initialize the Cluster
# Initialize control plane
sudo kubeadm init --pod-network-cidr=10.244.0.0/16
# Configure kubectl
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/configStep 5: Install Network Plugin
# Install Calico CNI
kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
# Verify nodes are Ready
kubectl get nodesVerify Installation
# Check cluster status
kubectl cluster-info
kubectl get nodes -o wide
kubectl get pods -A
# Deploy test application
kubectl create deployment nginx --image=nginx
kubectl expose deployment nginx --port=80 --type=NodePortNext Steps
- Join worker nodes to the cluster
- Install an Ingress controller (nginx or traefik)
- Set up monitoring with Prometheus and Grafana
- Configure storage with a CSI driver
- Deploy your applications with Helm or Kustomize
Master Kubernetes with Luca Bertonβs courses β from cluster setup to production-grade deployments.
