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.

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.

Download the helm chart

You can download the new VMware 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. Identify where the chart is downloaded.

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

    kubectl apply -f <CHART-DIR>/crds/
    

    where CHART-DIR is the path to the downloaded helm chart.

  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.

  4. Identify the name and namespace of the helm installation

    helm ls -A
    
    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	vmware-sql-with-mysql-operator-1.7.1	1.7.1
    
  5. Upgrade the Operator using:

    helm upgrade <RELEASE-NAME> <CHART-DIR> \
      -n <OPERATOR-NAMESPACE> \
      --wait
    

    If you need to specify an override file:

    helm upgrade <RELEASE-NAME> <CHART-DIR> \
      -f <OVERRIDE-FILE> \
      -n <OPERATOR-NAMESPACE> \
      --wait
    

    where:

    • RELEASE-NAME is the Helm release value under the NAME column of the list output
    • CHART-DIR is the location of the MySQL Operator helm chart
    • OPERATOR-NAMESPACE is the namespace where the operator is installed
    • OVERRIDE-FILE is the path to the override file

    For example:

    helm upgrade my-mysql-operator /tmp/vmware-sql-with-mysql-operator \
      -n vmware-mysql-for-kubernetes-system \
      --wait
    

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

  6. Clean up the downloaded chart if it is no longer needed:

      rm -rf <CHART-DIR>
    

    where CHART-DIR is the directory of the downloaded helm chart.

    For example:

      rm -rf /tmp/vmware-sql-with-mysql-operator
    

Upgrading the Operator using the Tanzu CLI

  1. (Optional) Relocate the images from the VMware Tanzu Network registry to a private registry

    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.9.0). Each VMware MySQL Operator release corresponds to a TDS package version. For instance, MySQL Operator version 1.8.0 is part of TDS version 1.9.0. Insert the right version for your VMware 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.9.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 (or whatever custom repository is used).

  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> \
        -n <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.9.0)
    • OPERATOR-NAMESPACE is the namespace of the package repository

    For example:

    tanzu package repository update sql-data-services \
         --url registry.tanzu.vmware.com/packages-for-vmware-tanzu-data-services/tds-packages:1.9.0
         -n data-services-operators
    
    | Updating package repository 'sql-data-services'
    - Getting package repository 'sql-data-services'
    / Getting package repository 'sql-data-services'
    | Validating provided settings for the package repository
    | Updating package repository resource
    - Waiting for 'PackageRepository' reconciliation for 'sql-data-services'
    / 'PackageRepository' resource install status: Reconciling
    
    Updated package repository 'sql-data-services' in namespace 'data-services-operators'
    
  4. Verify you have updated the package repository

    tanzu package repository get <PACKAGE-REPOSITORY-NAME> -n <OPERATOR-NAMESPACE>
    

    where:

    • PACKAGE-REPOSITORY-NAME is your chosen name for the installed package repository
    • OPERATOR-NAMESPACE is the namespace of the package repository.

    For example:

    tanzu package repository get sql-data-services -n data-services-operators
    
    / Retrieving repository sql-data-services...
    NAME:          sql-data-services
    VERSION:       2571192
    REPOSITORY:    registry.tanzu.vmware.com/packages-for-vmware-tanzu-data-services/tds-packages
    TAG:           1.9.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 -n <OPERATOR-NAMESPACE>
    

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

    For example:

    tanzu package available list mysql-operator.with.sql.tanzu.vmware.com -n data-services-operators
    
    / 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
    mysql-operator.with.sql.tanzu.vmware.com  1.8.0    2023-06-05 08:22:43 -0700 PDT
    
  6. List the installed packages.

    tanzu package installed list -n <OPERATOR-NAMESPACE>
    

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

    For example:

    tanzu package installed list -n data-services-operators
    
    / Retrieving installed packages...
      NAME                   PACKAGE-NAME                              PACKAGE-VERSION  STATUS
      vmware-mysql-operator  mysql-operator.with.sql.tanzu.vmware.com  1.8.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> \
      -n <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

    For example:

    tanzu package installed update vmware-mysql-operator \
      --package-name mysql-operator.with.sql.tanzu.vmware.com \
      --version 1.9.0 \
      -n data-services-operators
    
    | 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'
    
  8. Verify the MySQL Operator package was updated successfully:

    tanzu package installed get <PACKAGE-NAME> -n <OPERATOR-NAMESPACE>
    

    where:

    • OPERATOR-NAMESPACE is the namespace of the package repository
    • PACKAGE-NAME is the name shown from the installed package list

    For example:

    tanzu package installed get vmware-mysql-operator -n data-services-operators
    
    - 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.9.0
    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