Tuesday, June 23, 2020

Tanzu Kubernetes Grid (TKG) on vSphere 6.7 U3 - Part1


TKG is an enterprise-ready Kubernetes runtime which provides a consistent, upstream-compatible implementation of Kubernetes, that is tested, signed, and supported by VMware. 

Installation

I am using a 3 node vSAN cluster running vSphere 6.7 U3 to deploy TKG. The first step is to prepare a VM that will be used to kickstart the deployment process. Here I am using a CentOS 7 VM with desktop UI. Download the TKG CLI, TKG Kubernetes OVA, and Load Balancer OVA from the following link:


I am using the following versions:
  • VMware Tanzu Kubernetes Grid CLI 1.1 Linux
  • VMware Tanzu Kubernetes Grid 1.1.0 Kubernetes v1.18.2 OVA
  • VMware Tanzu Kubernetes Grid 1.1 Load Balancer OVA

Unzip and install TKG CLI on the CentOS VM.


Install Docker and kubectl on the CentOS VM. I installed kubectl v1.18.2.

Import the Kubernetes and HA Proxy OVA to the vCenter server and convert it to a template. Once the templates are ready you can view them in the VCSA under VMs and Templates section.

Create a new VM and Template folder to store your TKG related VMs.


You can use any existing resource pool to deploy TKG VMs or you can create a new one. Another important point is you should have a DHCP enabled network and that should have internet access too.

Now login to the CentOS VM and run "tkg init --ui". This will open a web browser with an installation wizard. Select Deploy on vSphere.


Provide the VCSA IP and creds and click Connect.


You will need to provide a public key. If you don't have one you can create a key pair as shown below.


Select the Datacenter and paste the public key. Click Next.


You can select a development or production environment. In this case, I am deploying a production management cluster. It will deploy 3 master nodes, 1 worker node and there will be a load balancer node too. Provide a cluster name and select other required fields as shown below.


Select the VM folder, Datastore, and Resource pool. Click Next.


Select a Network. This network should be DHCP enabled and should have internet access. I am using the default for the other two fields.


Select the Kubernetes OVA. Click Review configuration.


Click Deploy management cluster.


This will take around 20-30 minutes. 


You can see the progress below.


If you look at the VCSA you can see the VMs getting deployed.


Once the deployment is complete and successful you will get the below on the web UI as well as the terminal.



If you do "kubectl get nodes -o wide" you can see 3 master nodes and a worker node. Kubernetes master will point to the IP of the load balancer. 


Now the TKG management cluster is ready and you are all set to deploy multiple K8s workload clusters as per your requirement. I will cover that in the next part. I hope this was useful. Cheers!

References

No comments:

Post a Comment