Kubernetes (often shortened to “K8s”) is an open-source system for automating the deployment, scaling, and management of containerized applications. It was originally developed by Google and is now maintained by the Cloud Native Computing Foundation.

Kubernetes can run on any Linux distribution and supports diffrent container runtimes (like containerd, CRI-O), networking solutions (such as Calico..etc), and high-availability options (e.g., HAProxy, kube-vip).

This setup uses RHEL 10 as the base OS, contained as the container runtime, Calico for CNI networking, kube-vip to provide high availability and headlamp as a dashboard.

Total 4 – Nodes ,3 control plane and 1 compute .

Install RHEL 10 on all servers and enable subscription and create a DNS records for all nodes and VIP.

You can download script files using below link

https://github.com/Dineshk1205/k8s.git

01-prepare-all-nodes.sh — The foundation script you run on every node before anything else. It handles all the boring-but-critical groundwork: disabling swap and SELinux, loading the right kernel modules, installing containerd (configured for systemd cgroups), and pulling down kubeadm/kubelet/kubectl 1.35. Also pre-pulls the kube-vip image on control plane nodes.

02-init-control0.sh — The big one, runs only on your first control plane node. It bootstraps the entire cluster: writes the kube-vip static pod manifest, runs kubeadm init, then layers on Calico for networking, metrics-server, and Headlamp (the web UI) via Helm. Spits out your join commands and a Headlamp token at the end.

03-join-control-plane.sh — Runs on control1 and control2 to bring them into the cluster. It writes their own kube-vip manifest (pointing to admin.conf instead of super-admin.conf), then prompts you to paste the control plane join command from the previous script’s output.

04-join-worker.sh — The simplest of the four. Just prompts you for the worker join command, appends the containerd socket flag if it’s missing, and runs it. Reminds you to label the node afterward.

  1. Run 01-prepare-all-nodes.sh on all nodes .

2. Run 02-init-control0.sh only on first/primary controller

Take a note of control plane and worker token

3. Next, Run 03-join-control-plane.sh on only control plane nodes .

prompted to enter a token—simply paste the token when requested

4. Final step , run 04-join-worker.sh on worker nodes .

prompted to enter a token—simply paste the token when requested

Deployment is completed .You can check node status.