This topic describes how to upgrade the VMware Tanzu™ SQL with MySQL for Kubernetes Operator.
NOTE: Upgrading the MySQL Operator does not automatically upgrade any existing MySQL instances. Any instance upgrades require user intervention. The owners of the instances might be encouraged to upgrade or update their instances to a later supported version.
To upgrade Tanzu MySQL for Kubernetes, you must download the resources, and upgrade the Tanzu MySQL for Kubernetes Operator using Helm.
These instructions assume your Operator is installed in the Operator namespace tanzu-mysql-for-kubernetes-system as described in Operator Installation documentation. If your Operator is installed in a different namespace, replace tanzu-mysql-for-kubernetes-system with that namespace in the below commands.
Set the environment variable to enable OCI support in the Helm v3 client by running:
export HELM_EXPERIMENTAL_OCI=1
Update an existing overrides file or create an operator_overrides_values.yaml file at a location of your choice. Refer to Review the Operator Values for details on setting the appropriate overrides.
If your Operator was previously installed using an Operator values override file (or other command-line values overrides), then Helm will re-apply those override values to this upgrade, unless you perform the upgrade with other overrides or with the --reset-values flag. See Helm Upgrade documentation for details.
Customers upgrading from Operator 1.3.0, where the Helm chart value defaultInstanceVersion was removed, need to remove this key from the Helm overrides file, or use the command line option --reset-values.
Use Helm to log in to the Tanzu Network Registry by running:
helm registry login registry.tanzu.vmware.com
Follow the prompts to enter the email address and password for your VMware Tanzu Network account.
Verify that you have a running Tanzu MySQL for Kubernetes Operator by running:
helm ls -n tanzu-mysql-for-kubernetes-system
For example:
helm ls -n tanzu-mysql-for-kubernetes-system
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
tanzu-mysql-operator tanzu-mysql-for-kubernetes-system 1 2022-09-11 12:15:07.16966 -0500 CDT deployed tanzu-sql-with-mysql-operator-1.4.0 1.4.0
Create a temporary working directory to export the chart into by running:
CHART_DIR=$(mktemp -d /tmp/tanzu-mysql-operator-chart:1.5.0.XXXXX)
Download the Helm chart to your temporary working directory on your local machine by running these commands:
If you're using Helm CLI 3.6 and earlier:
helm chart pull registry.tanzu.vmware.com/tanzu-mysql-for-kubernetes/tanzu-mysql-operator-chart:1.5.0
helm chart export registry.tanzu.vmware.com/tanzu-mysql-for-kubernetes/tanzu-mysql-operator-chart:1.5.0 -d ${CHART_DIR}
If you're using Helm CLI 3.7.1 and later:
helm pull oci://registry.tanzu.vmware.com/tanzu-mysql-for-kubernetes/tanzu-mysql-operator-chart \
--version 1.5.0 --untar --untardir ${CHART_DIR}
In the location where the new release has been downloaded, apply the new CRDs by running:
kubectl apply -f ${CHART_DIR}/tanzu-sql-with-mysql-operator/crds/
Note: You can ignore the warnings in the output.
Upgrade the Operator by running:
helm upgrade tanzu-sql-with-mysql-operator ${CHART_DIR}/tanzu-sql-with-mysql-operator \
-n tanzu-mysql-for-kubernetes-system
When you see deployed in the STATUS column, the Operator Helm chart has upgraded:
helm history tanzu-sql-with-mysql-operator -n tanzu-mysql-for-kubernetes-system
If your Operator was previously installed using an Operator values override file (or other command-line values overrides), then Helm will re-apply those override values to this upgrade, unless you perform the upgrade with other overrides or with the --reset-values flag. See Helm Upgrade documentation for details.
For customers upgrading from Operator 1.4.0, the Helm chart value defaultInstanceVersion has been removed. On Operator upgrade, remove this key from the Helm overrides file, or use the command line option --reset-values.
Clean up the temporary directory if it is no longer needed with the exported chart by running:
rm ${CHART_DIR}
Check the status of your existing instances, and plan for an upgrade or an update.
Use the command kubectl get mysqls and review List Instance Versions, Upgrade an Instance and Updating an Instance.