VMware

Deploying Kubernetes Cluster on vSphere using Kubeadm and Terraform

Deployment Perquisites: –

vSphere Environment with sufficient resources – Memory, CPU, Storage.

Static IPs with the Internet

Template – Redhat/CentOS


VM with Terraform

My Env: –

vSphere Version – 7.0

Template – Redhat 8.6

Domain Name – kdinesh.in

DNS Server – 192.168.5.150

3 Master – master0, master1, master3 – IP’s 172.90.0.103-105

2 Worker – Worker0, worker1 – IP’s – 172.90.0.106-107

VIP – 172.90.0.102

Deployment: –

Kubernetes deployed using CRI-O as a Container Runtime Engine

From terraform VM, Download Deployment files using the following link – https://github.com/Dineshk1205/Terraform-Kubeadm

In Provider. tf, variable.tf file, no changes required. Update the remaining file according to your infra (IPs, Hostnames, Credentials, Kubernetes version. Etc.)

Terraform init

Next, run the below command.

Terraform apply -auto-approve

The deployment will start; you can check on vSphere.

Once it’s completed successfully, you can see the kubeadm join token and certificate.

On master1, master2 nodes run control plane kubeadm join command, and worker0, worker1 nodes run worker node kubeadm join command.

Check node and pod 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.

Share
Published by
Dineshreddy Kayithi

Recent Posts

Red Hat OpenShift VM Micro-segmentation Using MultiNetworkPolicy

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

4 weeks ago

Red Hat OpenStack Services on OpenShift (RHOSO)

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

1 month ago

Kubernetes Cluster Deployment

Kubernetes (often shortened to “K8s”) is an open-source system for automating the deployment, scaling, and…

2 months ago

Ceph cluster on a single machine

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

2 months ago

vSphere to OpenShift VM Migration

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

2 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…

4 months ago