kubernetes

Kubernetes Cluster Deployment

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.

Dineshreddy Kayithi

Rooted in a solid academic foundation with a Bachelor's Degree in Information Technology, my career has been deeply entrenched in designing, deploying, and managing enterprise-grade infrastructure across virtualization, cloud-native, and containerized environments. Industry certifications from VMware, AWS, Microsoft, and Kubernetes validate my hands-on expertise in architecting scalable, resilient systems spanning hypervisors, public/hybrid cloud platforms, and container orchestration frameworks. I'm driven by a relentless pursuit of emerging technologies — translating them into production-ready solutions that solve complex operational challenges.

View Comments

  • Hey Dinesh,

    Very detailed explanation. I thought this is cluster installation what you explained in this article.

Recent Posts

OpenShift VM Backup and Restore

The following steps demonstrate how to back up and restore an OpenShift virtual machine using…

4 weeks ago

Red Hat OpenShift VM Micro-segmentation Using MultiNetworkPolicy

OpenShift Virtualization allows virtual machines (VMs) to run natively on Kubernetes alongside container workloads. Using…

3 months ago

Red Hat OpenStack Services on OpenShift (RHOSO)

Red Hat OpenStack Services on OpenShift (RHOSO) provides the foundation to build a private or public…

3 months ago

Ceph cluster on a single machine

Ceph is an open-source, distributed storage platform that provides object, block, and file storage in…

4 months ago

vSphere to OpenShift VM Migration

Prerequisites Red Hat OpenShift cluster deployed and operational You can refer to my earlier post…

4 months ago

Installing OpenShift 4.21 in an air-gapped on-premises/BareMetal environment using Agent-based deployment

Agent-Based Installation The Agent-based installation method provides the flexibility to boot your on-premise servers in…

6 months ago