TKG Series-Part 1: Lab Setup

This blog series will cover how to deploy Tanzu Kubernetes Grid on vSphere and get your management and workload clusters provisioned. In part 1 of this series, I will cover the prerequisites that need to be met before attempting to install & configure TKG on vSphere.

Before you start with TKG deployment, make yourself familiar with the components that make up the TKG cluster. 

Hardware & Software Requirements

  • A vSphere environment with vSphere 6.7 U3 or 7.0 installed.
  • A dedicated resource pool to accommodate TKG Management & Workload cluster components.
  • A VM folder where TKG VM’s will be provisioned.
  • One DHCP enabled network segment. TKG VM’s get IP from dhcp pool.
  • TKG Ova’s & TKG CLI downloaded from here
  • A linux vm (ubuntu preferred) created in vSphere with docker & kubectl installed. This vm act as bootstrap vm on which we will install TKG CLI and other dependencies.

My Lab Walkthrough

  • I have a 4 node vSphere cluster with vSphere 6.7 U3 installed and licensed with Enterprise plus license
  • Build numbers used for ESXi & vCenter are 16316930 & 16616668 respectively.
  • I created a dedicated resource pool named TKG-RP for TKG VM’s.
  • A dedicated folder named TKG-Infra to collect the Tanzu Kubernetes Grid VM’s.

MJ-TKG-Lab01

MJ-TKG-Lab02

For networking I am using vyos, which is acting as ToR switch for my ESXi hosts, so I have leveraged DHCP functionality of vyos for one of the vSphere network. My TKG vm’s will be connecting to this portgroup. 

For bootstrap environment, I have a vm with Ubuntu desktop v20 installed. This VM has 2 vCPU and 8 GB memory and 40 GB disk space allocated. 

TKG Setup Steps

Preparing Bootstrap Environment

Connect to the linux vm used for bootstrapping and install Kubectl & Docker there.

1a: Install kubectl

1b: Install & Setup Docker

1c: Install TKG CLI

Download the TKG CLI binary from here and upload it on the bootstrap vm and run below commands to install it.

Note: Running above command automatically creates /root/.tkg folder and tkg config file is placed in this folder. 

1d: Create SSH Key Pair

In order for TKG VM’s to run tasks in vSphere, you need to provide the public key part of SSH key pair to TKG when deploying management cluster. Use below commands to create SSH key pair.

Note: Note down the contents of /root/.ssh/id_rsa.pub as we need this while creating config.yaml file for TKG mgmt cluster deployment.

Deploy TKG OVA’s & Create Templates in vSphere

Before we can deploy a TKG management cluster or Tanzu compute/workload clusters, we need to provide a base OS image template to vSphere. TKG uses these templates to creates management/compute cluster.

The base os images are available in myvmware portal. Basically you need below images:

  • Photon v3 Kubernetes v1.17.6 OVA or Photon v3 Kubernetes v1.18.3 OVA
  • Photon v3 capv haproxy v1.2.4 OVA

MJ-TKG-Lab03

Once the ova’s are downloaded, deploy both of them in vSphere and convert the deployed appliance into template.

MJ-TKG-Lab04

And that completes the infra setup part. We are now ready to deploy TKG management cluster followed by compute/workload cluster. Stay tuned for part 2 of this series !!!

I hope you enjoyed reading the post. Feel free to share this on social media if it is worth sharing 🙂 

Leave a Reply