Upgrade Tanzu Kubernetes Grid from v1.3.x to 1.4.x

Tanzu KubernetestaTanzu Kubernetes Grid 1.4 is all set to be released today. A lot of new features are coming up with this release including (not limited to):

  • K8’s versions including 1.21.2, 1.20.8, and 1.19.12 are supported with the 1.4 release.
  • Support for NSX Advanced Load Balancer versions 20.1.3 & 20.1.6. 
  • New vSphere configuration variables “VSPHERE_REGION” and “VSPHERE_ZONE” are added to enable CSI storage for workload clusters in vSphere environments with multiple data centers or clusters.
  • Supports L7 ingress (using NSX ALB) for workload clusters.
  • AKO deployment is fully automated. No need to install it via helm or using custom yaml for deployment as both AKO and AKO Operator are provided as core packages. 

It’s a good time to upgrade TKG in the lab and through this blog post, I will walk through the steps of upgrading TKGm from v1.3 to v1.4. 

Upgrade Procedure

Step 1: Download and install the new version of the Tanzu CLI and Kubectl on the bootstrapper machine. 

1.1: Upgrade kubectl

The below steps assumes that you have already downloaded the necessary TKG binaries and uploaded them to the bootstrapper machine and extracted the installer. 

[root@tkg-bootstrapper ~]# mv /usr/local/bin/kubectl /usr/local/bin/kubectl-old

[root@tkg-bootstrapper ~]# cd kubectl-linux-v1.21.2+vmware.1/

[root@tkg-bootstrapper ~]# chmod +x kubectl

[root@tkg-bootstrapper ~]# mv kubectl /usr/local/bin/

Verify the Kubectl version

1.2: Upgrade Tanzu CLI

[root@tkg-bootstrapper ~]# mv /usr/local/bin/tanzu /usr/local/bin/tanzu-old

[root@tkg-bootstrapper ~]# cd ~/tanzu-cli-bundle-linux-amd64/cli

[root@tkg-bootstrapper ~]# install core/v1.4.0/tanzu-core-linux_amd64 /usr/local/bin/tanzu

Verify Tanzu CLI version

1.3: Upgrade Tanzu Plugins

[root@tkg-bootstrapper ~]# tanzu plugin clean

[root@tkg-bootstrapper ~]# cd ~/tanzu-cli-bundle-linux-amd64

[root@tkg-bootstrapper ~]# tanzu plugin install –local cli all

Verify Tanzu Plugins version

Step 2: Import new versions of the Kubernetes template images that the upgraded management and Tanzu Kubernetes clusters will run.

The following K8 templates are available in TKG 1.4:

  • photon-3-kube-v1.19.12+vmware.1-tkg.2-2347849454212388110.ova
  • photon-3-kube-v1.20.8+vmware.1-tkg.2-9893064678268559535.ova
  • photon-3-kube-v1.21.2+vmware.1-tkg.2-12816990095845873721.ova
  • ubuntu-2004-kube-v1.19.12+vmware.1-tkg.1-15841320193950299489.ova
  • ubuntu-2004-kube-v1.20.8+vmware.1-tkg.1-17589475007677388652.ova
  • ubuntu-2004-kube-v1.21.2+vmware.1-tkg.1-7832907791984498322.ova

Depending on the K8 version to which you want to upgrade, import the corresponding template into vSphere.

In my lab, I am going to bump my setup to the latest K8 version, hence I have uploaded the photon-3-kube-v1.21.2+vmware.1 ova image and converted it into a template. 

 

Step 3: Upgrade Management Clusters

To upgrade the Tanzu Kubernetes Grid instance, you must upgrade all management clusters in your deployment. You cannot upgrade Tanzu Kubernetes clusters until you have upgraded the management clusters that manage them.

3.1: List the management clusters available for upgrade.

I only have one management cluster running at Kubernetes version v1.20.5 in my environment. 

3.2: To upgrade the management cluster, run the tanzu management-cluster upgrade command and enter y to confirm.

Note: If you have imported the same version of Kubernetes templates, for e.g Photon and Ubuntu templates with Kubernetes v1.21.2, specify –os-name in the upgrade command to upgrade your management cluster to run a specific os version.

Note: If for some reason the upgrade times out before it completes, run the upgrade command with the –timeout option with a value greater than the default of 30 minutes.

The upgrade process first upgrades the Cluster API providers followed by upgrading the Kubernetes version on all the control plane and worker nodes of the management cluster.

3.3: Verify that the management cluster has been upgraded.

The above output shows that the management cluster is now running the new version (v1.21.2) of Kubernetes, but the workload cluster is still running previous versions of Kubernetes.

Step 4: Upgrade Tanzu Kubernetes Clusters

If you have more than one management cluster, switch to the management cluster context which is managing the Tanzu Kubernetes cluster that you want to upgrade. 

3.1: List Tanzu Kubernetes Clusters available for upgrade

Run the tanzu cluster list command to verify the version of Kubernetes that is running in the Tanzu Kubernetes cluster.

3.2: To discover which versions of Kubernetes are available for upgrade, run the below command against your Tanzu Kubernetes Cluster

3.3: To upgrade Tanzu Kubernetes clusters, run the tanzu cluster upgrade <CLUSTER-NAME> command and enter y to confirm.

Note: If the Tanzu Kubernetes cluster is not running in the default namespace, specify the –namespace option with the upgrade command.

3.4: Verify that Tanzu Kubernetes cluster has been upgraded to newer Kubernetes version

The above output confirms that the cluster is now upgraded to v1.21.2. 

And that’s it for this post. In the next post, I will cover the steps of upgrading TKG Extensions. Stay tuned!!!

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

Leave a Reply