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.

Upgrading the Operator using Helm

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.

Access the Resources

You can access and install the new Tanzu MySQL Operator using any of the two different methods used during the initial installation.

Upgrade the Operator

After downloading the Helm chart, upgrade the operator following these steps:

  1. Set the environment variable CHART_DIR to the location of the downloaded helm chart.

  2. Update the existing Tanzu MySQL Custom Resource Definitions (CRDs) with the new values:

    kubectl apply -f ${CHART_DIR}/crds/
    
  3. 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.

  4. 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   tanzu-mysql-for-kubernetes-system	4       	2022-07-13 07:19:04.877537 -0700 PDT	deployed	tanzu-sql-with-mysql-operator-1.5.0	1.5.0
    
  5. 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 output
    • operator_overrides_values.yaml is the overrides file

    The 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: tanzu-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.

  6. Clean up the temporary directory if it is no longer needed with the exported chart by running:

       rm -rf ${CHART_DIR}
    

Upgrading the Operator using the Tanzu CLI

  1. 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 registry
    • TARGET-REPOSITORY is your target repository
    • TDS-VERSION is the tag for the image bundle (e.g 1.4.0). Each Tanzu MySQL release corresponds to a TDS package version. For instance, MySQL Operator version 1.6.2 is part of TDS version 1.6.0. Insert the right version for your Tanzu MySQL Operator release.
  2. 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.3.0  Reconcile succeeded           data-services-operators
    tanzu-rabbitmq-repo  registry.tanzu.vmware.com/p-rabbitmq-for-kubernetes/tanzu-rabbitmq-package-repo     1.3.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.

  3. 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 repository
    • MY-REGISTRY is your own image registry
    • TARGET-REPOSITORY is your target repository
    • TDS-VERSION is the target version you'll like to upgrade to (e.g. 1.4.0)
    • 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'
    
  4. 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.4.0
    STATUS:        Reconcile succeeded
    REASON:
    
  5. 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.2    2022-09-29 09:49:15 -0700 PDT
    
  6. 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
      tanzu-mysql-operator  mysql-operator.with.sql.tanzu.vmware.com  1.5.0            Reconcile succeeded
    
  7. 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 list
    • MYSQL-OPERATOR-VERSION is the Operator version you choose in the step above
    • YOUR-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 'tanzu-mysql-operator'
    - Getting package install for 'tanzu-mysql-operator' 
    / Getting package install for 'tanzu-mysql-operator'
    / Getting package metadata for 'mysql-operator.with.sql.tanzu.vmware.com'
    | Updating package install for 'tanzu-mysql-operator'
    / Waiting for 'PackageInstall' reconciliation for 'tanzu-mysql-operator'
    / 'PackageInstall' resource install status: Reconciling
    
    Updated installed package 'tanzu-mysql-operator' in namespace 'data-services-operators'
    
  8. Verify the MySQL Operator package was updated successfully:

    tanzu package installed get tanzu-mysql-operator --namespace=<OPERATOR-NAMESPACE>
    

    where OPERATOR-NAMESPACE is the namespace of the package repository.

    - Retrieving installation details for tanzu-mysql-operator... 
    / Retrieving installation details for tanzu-mysql-operator...
    NAME:                    tanzu-mysql-operator
    PACKAGE-NAME:            mysql-operator.with.sql.tanzu.vmware.com
    PACKAGE-VERSION:         1.6.2
    STATUS:                  Reconcile succeeded
    CONDITIONS:              [{ReconcileSucceeded True  }]
    USEFUL-ERROR-MESSAGE:
    

Next Steps

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.

check-circle-line exclamation-circle-line close-line
Scroll to top icon