This topic describes how to upgrade the VMware 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.
Ensure you have access to Tanzu Network and Tanzu Network Registry. You can use the same credentials for both sites.
Note: Use Helm CLI 3.8.0 and later.
You can access and install the new VMware MySQL Operator using any of the two different methods used during the initial installation.
Use Setup the VMware MySQL Operator via Tanzu Network Registry for a faster installation process, and if your server hosts have access to the internet.
Use Setup the VMware MySQL Operator via Downloadable Archive File if your server hosts do not have access to the internet, or if you want to install from a private registry.
After downloading the Helm chart, upgrade the operator following these steps:
Set the environment variable CHART_DIR
to the location of the downloaded helm chart.
Update the existing VMware MySQL Operator Custom Resource Definitions (CRDs) with the new values:
kubectl apply -f ${CHART_DIR}/crds/
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.
Target the namespace where you installed the Helm release:
kubectl config set-context --current --namespace=<MYSQL-OPERATOR-NAMESPACE>
where MYSQL-OPERATOR-NAMESPACE
is the namespace where the previous operator version is installed.
List the Helm releases using:
helm ls
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
my-mysql-operator vmware-mysql-for-kubernetes-system 4 2022-07-13 07:19:04.877537 -0700 PDT deployed tanzu-sql-with-mysql-operator-1.6.2 1.6.2
Upgrade the Operator using:
helm upgrade <RELEASE-NAME> ${CHART_DIR} -f /<path-to-your-file>/operator_overrides_values.yaml --wait
where
RELEASE-NAME
is the Helm release value under the NAME
column of the list outputoperator_overrides_values.yaml
is the overrides fileThe output is similar to:
Release "my-mysql-operator" has been upgraded. Happy Helming!
NAME: my-mysql-operator
LAST DEPLOYED: Mon Oct 3 15:31:43 2022
NAMESPACE: vmware-mysql-for-kubernetes-system
STATUS: deployed
REVISION: 5
TEST SUITE: None
where REVISION
is a counter for the number of Operator upgrades you have performed. If you have upgraded from 1.0 to 1.1, and from 1.1 to 1.2, the REVISION number would be 3.
Clean up the temporary directory if it is no longer needed with the exported chart by running:
rm -rf ${CHART_DIR}
Relocate the images from the VMware Tanzu Network registry to a private registry with the Carvel tool imgpkg
by running:
imgpkg copy -b registry.tanzu.vmware.com/packages-for-vmware-tanzu-data-services/tds-packages:<TDS-VERSION> \
--to-repo <MY-REGISTRY>/<TARGET-REPOSITORY>/tds-packages
where:
MY-REGISTRY
is your own image registryTARGET-REPOSITORY
is your target repositoryTDS-VERSION
is the tag for the image bundle (e.g 1.7.1
). Each VMware MySQL Operator release corresponds to a TDS package version. For instance, MySQL Operator version 1.7.1 is part of TDS version 1.7.1. Insert the right version for your VMware MySQL Operator release.Find the package repository name of the VMware Tanzu Data Services package repository:
tanzu package repository list -A
/ Retrieving repositories...
NAME REPOSITORY TAG STATUS DETAILS NAMESPACE
tds-repo registry.tanzu.vmware.com/packages-for-vmware-tanzu-data-services/tds-packages 1.6.0 Reconcile succeeded data-services-operators
tanzu-rabbitmq-repo registry.tanzu.vmware.com/p-rabbitmq-for-kubernetes/tanzu-rabbitmq-package-repo 1.4.0 Reconcile succeeded rabbitmq-operator
where column NAME
represents the name of the package repository.
Note the namespace where registry.tanzu.vmware.com/packages-for-vmware-tanzu-data-services/tds-packages
repository is located.
Update the package repository to reflect the new target version:
tanzu package repository update <PACKAGE-REPOSITORY-NAME> \
--url <MY-REGISTRY>/<TARGET-REPOSITORY>/tds-packages:<TDS-VERSION> \
--namespace=<OPERATOR-NAMESPACE>
where:
PACKAGE-REPOSITORY-NAME
is the name listed for the installed package repositoryMY-REGISTRY
is your own image registryTARGET-REPOSITORY
is your target repositoryTDS-VERSION
is the target version you'll like to upgrade to (e.g. 1.7.1
)OPERATOR-NAMESPACE
is the namespace of the package repository| Updating package repository 'tds-repo'
- Getting package repository 'tds-repo'
/ Getting package repository 'tds-repo'
| Validating provided settings for the package repository
| Updating package repository resource
- Waiting for 'PackageRepository' reconciliation for 'tds-repo'
/ 'PackageRepository' resource install status: Reconciling
Updated package repository 'tds-repo' in namespace 'data-services-operators'
Verify you have updated the package repository
tanzu package repository get <PACKAGE-REPOSITORY-NAME> --namespace=<OPERATOR-NAMESPACE>
where:
PACKAGE-REPOSITORY-NAME
is your chosen name for the installed package repository/OPERATOR-NAMESPACE
is the namespace of the package repository./ Retrieving repository tds-repo...
NAME: tds-repo
VERSION: 2571192
REPOSITORY: registry.tanzu.vmware.com/packages-for-vmware-tanzu-data-services/tds-packages
TAG: 1.7.1
STATUS: Reconcile succeeded
REASON:
Select your desired version of the available MySQL Operator version
tanzu package available list mysql-operator.with.sql.tanzu.vmware.com --namespace=<OPERATOR-NAMESPACE>
where OPERATOR-NAMESPACE
is the namespace of the package repository.
/ Retrieving package versions for mysql-operator.with.sql.tanzu.vmware.com...
NAME VERSION RELEASED-AT
mysql-operator.with.sql.tanzu.vmware.com 1.5.0 2022-07-07 17:26:16 -0700 PDT
mysql-operator.with.sql.tanzu.vmware.com 1.6.0 2022-09-16 12:59:05 -0700 PDT
mysql-operator.with.sql.tanzu.vmware.com 1.6.1 2022-09-29 09:49:15 -0700 PDT
mysql-operator.with.sql.tanzu.vmware.com 1.6.2 2022-09-29 09:49:15 -0700 PDT
mysql-operator.with.sql.tanzu.vmware.com 1.7.0 2023-03-02 12:12:15 -0700 PDT
mysql-operator.with.sql.tanzu.vmware.com 1.7.1 2023-04-05 12:12:15 -0700 PDT
List the installed packages.
tanzu package installed list --namespace=<OPERATOR-NAMESPACE>
where OPERATOR-NAMESPACE
is the namespace of the package repository.
/ Retrieving installed packages...
NAME PACKAGE-NAME PACKAGE-VERSION STATUS
vmware-mysql-operator mysql-operator.with.sql.tanzu.vmware.com 1.6.2 Reconcile succeeded
Update the MySQL Operator installed package to your desired version:
tanzu package installed update <PACKAGE-NAME> \
--package-name mysql-operator.with.sql.tanzu.vmware.com \
--version <MYSQL-OPERATOR-VERSION> \
-f <YOUR-OVERRIDES-FILE-PATH> \
--namespace <OPERATOR-NAMESPACE>
where:
PACKAGE-NAME
is the name shown from the installed package listMYSQL-OPERATOR-VERSION
is the Operator version you choose in the step aboveYOUR-OVERRIDES-FILE-PATH
is your custom overrides path and file, for example overrides.yaml
.OPERATOR-NAMESPACE
is the namespace of the packagerepository| Updating installed package 'vmware-mysql-operator'
- Getting package install for 'vmware-mysql-operator'
/ Getting package install for 'vmware-mysql-operator'
/ Getting package metadata for 'mysql-operator.with.sql.tanzu.vmware.com'
| Updating package install for 'vmware-mysql-operator'
/ Waiting for 'PackageInstall' reconciliation for 'vmware-mysql-operator'
/ 'PackageInstall' resource install status: Reconciling
Updated installed package 'vmware-mysql-operator' in namespace 'data-services-operators'
Verify the MySQL Operator package was updated successfully:
tanzu package installed get vmware-mysql-operator --namespace=<OPERATOR-NAMESPACE>
where OPERATOR-NAMESPACE
is the namespace of the package repository.
- Retrieving installation details for vmware-mysql-operator...
/ Retrieving installation details for vmware-mysql-operator...
NAME: vmware-mysql-operator
PACKAGE-NAME: mysql-operator.with.sql.tanzu.vmware.com
PACKAGE-VERSION: 1.7.1
STATUS: Reconcile succeeded
CONDITIONS: [{ReconcileSucceeded True }]
USEFUL-ERROR-MESSAGE:
Check the status of your existing MySQL 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.