To upgrade Tanzu Kubernetes Grid (TKG), you download and install the new version of the Tanzu CLI on the machine that you use as the bootstrap machine. You must also download and install base image templates in vSphere.
In the TKG upgrade path, v2.5.x immediately follows v2.4.x.
After you have installed the new versions of the components, you use the tanzu mc upgrade
and tanzu cluster upgrade
CLI commands to upgrade management clusters and workload clusters.
The next sections are the overall steps required to upgrade Tanzu Kubernetes Grid. This procedure assumes that you are upgrading to Tanzu Kubernetes Grid v2.5.2.
Some steps are only required if you are performing a minor upgrade from Tanzu Kubernetes Grid v2.4.x to v2.5.x and are not required if you are performing a patch upgrade from Tanzu Kubernetes Grid v2.5.x to v2.5.y.
Important
If you are using TKG with a standalone management cluster and you do not require any of the functionality listed in in When to Use a Standalone Management Cluster in About TKG, see Reference Design for Migration from TKGm to TKGs (vSphere with Tanzu) for information about how to migrate from a standalone management cluster to the vSphere Iaas control plane (formerly vSphere with Tanzu) Supervisor.
Tanzu Kubernetes Grid v2.5.x does not support upgrading existing standalone TKG management clusters and TKG workload clusters on AWS and Azure. For more information, see End of Support for TKG Management and Workload Clusters on AWS and Azure in the VMware Tanzu Kubernetes Grid v2.5.x Release Notes.
Tanzu Kubernetes Grid does not support upgrading management clusters or workload clusters to v2.5.1 on vSphere 6.7. For more information, see End of Support for TKG Management and Workload Clusters on vSphere 6.7.
Before you upgrade to TKG v2.5.x, ensure that your current deployment is TKG v2.4.x or an earlier v2.5.x version. To upgrade to TKG v2.5.x from versions earlier than v2.4, you must first upgrade to v2.4.x with a v2.4.x of the Tanzu CLI.
If you are not sure which version of TKG is running in your management cluster, you can extract the version from the management cluster object.
Run the tanzu context use
command to see an interactive list of management clusters available for upgrade.
tanzu context use
Select the management cluster that you want to check.
Get the admin credentials of the cluster. The Tanzu CLI alias mc
is short for management-cluster
.
tanzu mc kubeconfig get --admin
Connect kubectl
to the management cluster.
kubectl config use-context MGMT-CLUSTER-NAME-admin@MGMT-CLUSTER-NAME.
You can copy the exact command, including the name of the management cluster context, from the output of the tanzu mc kubeconfig get --admin
command that you ran in the preceding step.
Run the kubectl get cluster
command to extract the TKG version.
kubectl get cluster MGMT-CLUSTER-NAME -n tkg-system -o yaml | grep TKGVERSION
The output will show the version of TKG running in your management cluster, for example:
TKGVERSION: v2.4.0
If you have used environment variables for cluster creation, you must unset some of them before starting the upgrade process. If these variables are set in the environment where you run the upgrade, the upgrade process will treat them as reconfiguration options and the upgrade might fail.
Run the following commands to unset the relevant variables:
unset VSPHERE_DATACENTER
unset VSPHERE_DATASTORE
unset VSPHERE_FOLDER
unset VSPHERE_NETWORK
unset VSPHERE_RESOURCE_POOL
This step is required for both major v2.4.x to v2.5.x and patch v2.5.x to v2.5.y upgrades.
To download and install the new version of the Tanzu CLI and plugins, perform the following steps.
Delete the ~/.config/tanzu/tkg/compatibility/tkg-compatibility.yaml
file.
If you do not delete this file, the new version of the Tanzu CLI will continue to use the Bill of Materials (BOM) for the previous release. Deleting this file causes the Tanzu CLI to pull the updated BOM. You must perform this step both when upgrading from 2.4.x to 2.5.x, and when upgrading from 2.5.x to 2.5.y.
Follow the instructions in Install the Tanzu CLI and Kubernetes CLI for Use with Standalone Management Clusters to download and install the Tanzu CLI and plugins and kubectl
on the machine where you currently run your tanzu
commands. If any of your standalone management clusters are configured to use an LDAP identity provider, perform the steps in (LDAP Only) Update LDAP Settings after installing Tanzu CLI and before updating your CLI plugins to Tanzu Kubernetes Grid v2.5.
tanzu plugin install
to install the current --vmware-tkg
plugin group.tanzu version
to check that the correct version of the Tanzu CLI is properly installed. For a list of CLI versions compatible with Tanzu Kubernetes Grid v2.5, see Product Interoperability Matrix.kubectl
, run kubectl version
to check that the correct version of kubectl
is properly installed.For information about Tanzu CLI commands and options that are available, see the Tanzu CLI Command Reference.
Before you can upgrade a Tanzu Kubernetes Grid deployment, you must import into vSphere new versions of the base image templates that the upgraded management and workload clusters will run. VMware publishes base image templates in OVA format for each supported OS and Kubernetes version. After importing the OVAs, you must convert the resulting VMs into VM templates. This step is required for both major v2.4.x to v2.5.x and patch v2.5.x to v2.5.y upgrades.
This procedure assumes that you are upgrading to Tanzu Kubernetes Grid v2.5.2.
Download the latest Tanzu Kubernetes Grid OVAs for the OS and Kubernetes version lines that your management and workload clusters are running. For Kubernetes v1.28 and later, TKG supports Ubuntu 22.04 and Photon 5, and for Kubernetes v1.27 and earlier, TKG supports Ubuntu 20.04 and 22.04 and Photon 3 and 5.
ImportantIn TKG 2.5.2, management clusters run Kubernetes v1.28.11, so you must download at least one OVA with Kubernetes v1.28.11. The Kubernetes v1.30.2, 1.29.6, 1.27.15, and 1.26.14 OVAs are for workload clusters only.
For example, for Photon images:
For Ubuntu images:
ImportantMake sure you download the most recent OVA base image templates in the event of security patch releases. You can find updated base image templates that include security patches on the Tanzu Kubernetes Grid product download page.
Follow the installer prompts to deploy a VM from the OVA.
tkg-user
, to the template with the Tanzu Kubernetes Grid role, for example, TKG
. You created this user and role in Prepare to Deploy Management Clusters to vSphere.Repeat the procedure for each of the Kubernetes versions for which you have downloaded the OVA file.
VMware Cloud on AWS SDDC Compatibility
If you are upgrading workload clusters that are deployed on VMware Cloud on AWS, verify that the underlying Software-Defined Datacenter (SDDC) version used by your existing deployment is compatible with the version of Tanzu Kubernetes Grid you are upgrading to.
To view the version of an SDDC, select View Details on the SDDC tile in VMware Cloud Console and click on the Support pane.
To validate compatibility with Tanzu Kubernetes Grid, refer to the VMware Product Interoperablity Matrix.
This step is required for both major v2.4.x to v2.5.x and patch v2.5.x to v2.5.y upgrades.
To upgrade Tanzu Kubernetes Grid, you must upgrade all management clusters in your deployment. You cannot upgrade workload clusters until you have upgraded the management clusters that manage them.
Follow the procedure in Upgrade Standalone Management Clusters to upgrade your management clusters.
This step is required for both major v2.4.x to v2.5.x and patch v2.5.x to v2.5.y upgrades.
Follow the procedure in Upgrade Workload Clusters to upgrade the workload clusters that are running your workloads.
After you have upgraded your clusters, there are additional steps to perform to complete the upgrade process.
Some packages that are installed by default in the management cluster, for example, cert-manager
can be installed as CLI-managed packages in workload and the shared services clusters. When the management cluster is upgraded to the latest Tanzu Kubernetes Grid release, its default packages are automatically updated.
You can run different versions of the CLI-managed packages in different workload clusters. In a workload cluster, you can run either the latest supported version of a CLI-managed package or the package’s versions in your last two previously-installed versions of Tanzu Kubernetes Grid. For example, if the latest packaged version of cert-manager
is v1.12.2 and your previous two Tanzu Kubernetes Grid installations ran cert-manager
v1.11.1 and v1.10.1, then you can run cert-manager
versions v1.12.2, v1.11.1, and v1.10.1 in workload clusters.
For any workload clusters that are running package versions that are more than n-2 installed Tanzu Kubernetes Grid versions older than the package versions in the management cluster, you must update the package repository (See Update a Package Repository) and then upgrade the package in the workload clusters (See Update a Package). If you do not upgrade the package version, you will not be able to update the package configuration because the package repository might not include over n-2 older version of the package.
If NSX ALB was not enabled in your TKG v2.4 installation, see Install and Configure NSX Advanced Load Balancer for information on how to install NSX ALB.
If NSX ALB was enabled in your TKG v2.4 installation, see the Tanzu Kubernetes Grid v2.5.x Release Notes for which Avi Controller versions are supported in this release, and if needed upgrade the Avi Controller to a compatible version. For how to upgrade the Avi Controller, see Flexible Upgrades for Avi Vantage.
Examine your upgraded management clusters or register them in Tanzu Mission Control. See Examine and Register a Newly-Deployed Standalone Management Cluster.