VMware

Deploying OpenShift (OCP) Cluster on vSphere Using Terraform

Prerequisite for deployment:-

  1. DHCP Network and Two Static IPs For Each Cluster.
  2. DNS Records – Create API VIP and Ingress VIP DNS A/AAAA and PTR Records with Cluster name

api.<cluster_name>.<base_domain>. #api.ocp4.kdinesh.in

*.apps.<cluster_name>.<base_domain>. #*. apps.ocp4.kdinesh.in

  1. VM With Terraform
  2. Linux – Centos/RedHat Template
  3. OpenShift Compatible vSphere Version
  4. Sufficient resources – RAM, CPU, Storage in vSphere env
  5. OpenShift License – (You can try 60 days Evaluation license)
  6. Internet Access (For Offline deployment, you can check the official doc)

Deployment Flow Diagram: –

Terraform Will deploy one VM, ON VM vSphere OpenShift installer, and OCP Client tools will be installed, and cluster deployment will be instantiated.

OpenShift Installer will deploy one temporary Bootstrap VM and OCP Cluster.

Once Cluster is Running, Temporary Bootstrap will be deleted automatically.

Deployment: –

Created required DNS Records.

Created Linux VM and Installed Terraform.

Created Linux-Centos8 Template in vSphere.

Created Terraform Files for deploying the OpenShift Cluster.

You can download the OpenShift deployment Terraform File using the following link – https://github.com/Dineshk1205/OCP-Terraform

Update Paraments in terraform.tfvars file and in scripts directory ocp. sh file (In ocp. sh only update parameters in first section # OCP Deployment Required)

First Run Terraform init command

Next, Run the command – Terraform apply -auto-approve

Wait a few minutes; the OpenShift cluster will be deployed based on the specified parameters.

Login to Bastion/Bootstrap VM and Check Cluster 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

Canary Deployments on OpenShift with GitOps: A Practical Walkthrough

Shipping a new version of an application is always a small act of faith. Even…

2 weeks ago

OpenShift VM Backup and Restore

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

2 months ago

Red Hat OpenShift VM Micro-segmentation Using MultiNetworkPolicy

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

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

4 months ago

Kubernetes Cluster Deployment

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

4 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