How to install TKG 1.2.0 on vSphere: Part 1: Prepare bootstrap machine

VMware Tanzu Kubernetes Grid provides a consistent, upstream-compatible implementation of Kubernetes, that is tested, signed, and supported by VMware. Tanzu Kubernetes Grid is central to many of the offerings in the VMware Tanzu portfolio.

In this blog post we will start with installing TKG 1.2.0 version on our on-premises vSphere environment. TKG creates a temporary management cluster using a Kubernetes in Docker (kind) cluster on the bootstrap environment. TKG uses the temporary management cluster created locally to provision the final management cluster in the platform of your choice, which is vSphere in this case.

Preparing a Bootstrap vm:

The bootstrap machine is the laptop, host, or server on which the initial bootstrapping of a management cluster is performed. The bootstrap machine is typically local, but it can also be a physical machine or a virtual machine that can be accessed remotely. We make use of the bootstrap vm to install TKG cli command line tool and initiate the TKG deployment.

Prerequisites:

  • Bootstrap machine with a minimum system configuration of 6 GB of RAM and a 2-core CPU
  • Bootstrap machine can be Windows, Linux or macOS
  • Docker should be installed and running on your bootstrap machine
  • kind should be installed
  • If you would like to use the TKG installer interface, a web browser must be available
  • System time is synchronized with a Network Time Protocol (NTP) server

Download the TKG installation packages

Login to the myvmware product page and download the below listed packages. You can download the right package based on the type os running in the bootstrap vm.

  • VMware Tanzu Kubernetes Grid 1.2.0 CLI
  • VMware Tanzu Kubernetes Grid 1.2.0 OVAs for Kubernetes
  • Kubectl 1.19.1 for VMware Tanzu Kubernetes Grid 1.2.0

Using Winscp, move the TKG and Kubectl binary file bundle to the bootstrap vm.

Install TKG CLI

  1. Unpack the TKG cli binary by running the below command.
tar -zxvf tkg-linux-amd64-v1.2.0-vmware.1.tar.gz

2. Move the binary to /usr/local/bin

mv ./tkg-linux-amd64-v1.2.0+vmware.1 /usr/local/bin/tkg

3. Make the binary executable by running

chmod +x tkg

Run tkg --help to see the list of commands that the Tanzu Kubernetes Grid CLI provides

Install Kubectl

  1. Unpack the kubectl binary file by running
gunzip kubectl-linux-v1.19.1-vmware.2.gz

2. Move the binary to /usr/local/bin

mv kubectl-linux-v1.19.1-vmware.2 /usr/local/bin/kubectl

3. Make the binary executable by running

chmod +x kubectl

Create the config folder

Run the below TKG command to generate the ~/.tkg folder in your home directory.

tkg get management-cluster

Running the above tkg command for the first time creates the ~/.tkg folder in your home directory, that contains the Tanzu Kubernetes Grid configuration files.

  • The cluster configuration file ~/.tkg/config.yaml, from which management clusters and TKG clusters are created.
  • The ~/.tkg/bom folder, containing bom-*.yaml files that provide references to the correct versions of all of the packages that TKG requires when creating clusters for all of the versions of Kubernetes that it supports.

Create an SSH Key Pair

In order for TKG VMs to run tasks in vSphere, you must provide the public key part of an SSH key pair to TKG when you deploy the management cluster.

  1. On the bootstrap machine, run the below command
ssh-keygen -t rsa -b 4096 -C "email@example.com"

2. At the prompt Enter file in which to save the key (/root/.ssh/id_rsa): press Enter to accept the default.

3. Enter a password for the key pair

4. Run the below command and add the private key to the SSH agent running on your machine. You will need to enter the password you created in the step 3.

ssh-add ~/.ssh/id_rsa

5. Copy the content of .ssh/id_rsa.pub file, you will use it when you deploy a management cluster.

This completes the preparation of the bootstrap vm. We have also downloaded VMware Tanzu Kubernetes Grid 1.2.0 OVAs for Kubernetes earlier. We will be making use of it in the Part 2 of this TKG installation series.

Other blogs from this TKG installation series can be found below.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: