Installing the Tanzu MySQL for Kubernetes Operator

Warning: VMware Tanzu™ SQL with MySQL for Kubernetes is currently in beta and is intended for evaluation and test purposes only. Do not use this product in a production environment. If you discover any bugs, contact Support.

Page last updated:

This topic describes how operators install, configure, and deploy the VMware Tanzu™ SQL with MySQL for Kubernetes Operator.

Overview

To install and configure Tanzu MySQL for Kubernetes, you must download resources and install the Tanzu MySQL for Kubernetes Operator using Helm.

To download resources and install the Operator:

  1. Download the Resources
  2. Install the Operator
    1. Create Namespace and Secret
    2. (Optional) Edit the Helm Chart
    3. Use Helm CLI to Install the Operator

Prerequisites

Before you deploy the Tanzu MySQL for Kubernetes Operator, you need:

  • Access to Tanzu MySQL for Kubernetes in VMware Tanzu Network and VMware Tanzu Network Registry.

  • The Helm command line tool installed. For more information, see Installing Helm from the Helm documentation.

  • The Kubernetes Command Line Interface (kubectl) installed. For more information, see the Kubernetes documentation.

  • The Docker command line tool installed and Docker running on your local machine.

  • An existing Kubernetes environment.

  • cluster-admin ClusterRole access to the Kubernetes cluster. For more information, see the Kubernetes documentation.

Download the Resources

To install the Tanzu MySQL for Kubernetes Operator, you must download the Helm chart, images, and deployment templates.

To download the resources:

  1. Log in to Helm from the command line by running:

    echo "$MY_PASSWORD" | helm registry login registry.pivotal.io \
    --username=USER-EMAIL --password-stdin
    

    Where:

    • MY_PASSWORD is an environment variable containing the password for the registry account.
    • USER-EMAIL is the email address associated with the registry account.
  2. Log in to VMware Tanzu Network and go to the VMware Tanzu™ SQL with MySQL for Kubernetes product page.

  3. Click Tanzu MySQL Deployment Templates to download the deployment templates to your local machine.

  4. Click Artifact References to navigate into the artifacts directory. Keep the page open to reference in the following step.

  5. Download each of the artifact references using the command line.

    1. To download tanzu-mysql-operator-chart to the Helm cache: Click the artifact from VMware Tanzu Network and paste the two commands into the command line.
      Modal shows 4 pieces of data: type, digest, 'set the environment variable' and 'pull this chart'


      For example:
      $ export HELM_EXPERIMENTAL_OCI=1
      $ helm chart pull registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-operator-chart:0.1.0
      
      0.1.0: Pulling from registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-operator-chart ref: registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-operator-chart:0.1.0 digest: 2b6e1d010ab1737dcc5a426b223a06db1c616107d2ceaf368db6fda48d96a61a size: 4.2 KiB name: tanzu-mysql-operator version: 0.1.0 Status: Downloaded newer chart for registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-operator-chart:0.1.0
    2. To download tanzu-mysql-instance: Click the artifact from VMware Tanzu Network and paste the command into the command line.

      For example:
      $ docker pull registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-instance:0.1.0
      
      0.1.0: Pulling from tanzu-mysql-for-kubernetes/tanzu-mysql-instance f22ccc0b8772: Pull complete 3cf8fb62ba5f: Pull complete e80c964ece6a: Pull complete 0c31331fda89: Pull complete 0e9674cd2c60: Pull complete d88e035d5311: Pull complete 5055f7e93495: Pull complete 80e0c3183303: Pull complete 6312f33f1306: Pull complete 47733910cd21: Pull complete 4ac582ac7e82: Pull complete e9ad4cffabdc: Pull complete 4b9107ee1e3e: Pull complete faffd54990ce: Pull complete Digest: sha256:78073dcf626603da192b78643bda24e0098f944d0bd54da1d60924b20d5eea8c Status: Downloaded newer image for registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-instance:0.1.0 registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-instance:0.1.0
    3. To download tanzu-mysql-operator: Click the artifact from VMware Tanzu Network and paste the command into the command line.

      For example:
      $ docker pull registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-operator:0.1.0
      
      0.1.0: Pulling from tanzu-mysql-for-kubernetes/tanzu-mysql-operator be69922ffb42: Pull complete ef291e196a72: Pull complete Digest: sha256:91664f6866b7228b68d3fb9ff8e13af95f618b7b78e5fd35690dd29394a08db1 Status: Downloaded newer image for registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-operator:0.1.0 registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-operator:0.1.0

Install the Operator

To install the Tanzu MySQL for Kubernetes Operator, you must use kubectl to create a namespace and secret. Then, use the Helm CLI to install the Operator.

Create Namespace and Secret

To create the namespace and secret:

  1. Create the namespace by running:

    kubectl create namespace tanzu-mysql-for-kubernetes-system
    
  2. Set your kubectl context to the newly-created namespace by running:

    kubectl config set-context --current --namespace tanzu-mysql-for-kubernetes-system
    
  3. Create a Kubernetes secret for accessing registry containing the Tanzu MySQL for Kubernetes images by running:

    kubectl create secret docker-registry tanzu-mysql-image-registry --docker-server=https://registry.pivotal.io/ \
    --docker-username=DOCKER-USERNAME --docker-password=DOCKER-PASSWORD
    
  4. Download the Helm chart to your current working directory on your local machine by running:

    helm chart export REGISTRY-URL
    

    Where REGISTRY-URL is the reference to the Tanzu MySQL for Kubernetes Helm chart.


    The value of REGISTRY-URL has the following pattern:

    registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-operator-chart:VERSION-NUMBER-TAG
    

    Where VERSION-NUMBER-TAG is the version of the Helm chart.


    This downloads a directory named tanzu-mysql-operator/ into your current working directory that contains:

    • The Tanzu MySQL for Kubernetes Helm chart
    • Custom Resource Definitions (CRDs)
    • Role-Based Access Control (RBAC) definitions required to install the operator with Helm


    For example:

    $ helm chart export registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-operator-chart:0.1.0
    
    ref: registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-operator-chart:0.1.0 digest: 2b6e1d010ab1737dcc5a426b223a06db1c616107d2ceaf368db6fda48d96a61a size: 4.2 KiB name: tanzu-mysql-operator version: 0.1.0 Exported chart to tanzu-mysql-operator/

(Optional) Edit the Helm Chart

You might want to edit the values in your Tanzu MySQL for Kubernetes Operator Helm chart before you install.

To edit your Helm chart:

  1. Open the values.yaml file inside your local tanzu-mysql-operator directory. You can edit the following values:

    Key Value Type Description
    imagePullSecret String Name of image secret. This value must match the name of the Kubernetes secret you create in Install the Operator below.
    operatorImage URI Reference to the Tanzu MySQL for Kubernetes Operator image. If you uploaded the Operator image to a private registry, you must change this reference to pull the Operator image from your registry.
    tanzuMySQLImage URI Reference to the Tanzu MySQL for Kubernetes image. If you have uploaded the Tanzu MySQL for Kubernetes image to a private registry, you must change this reference to pull the Tanzu MySQL for Kubernetes image from your registry.
    resources List Limits and requests for CPU and memory for the Tanzu MySQL for Kubernetes Operator. You can change these values to scale your resources.


    See the following example values.yaml file:

    ---
    imagePullSecret: tanzu-mysql-image-registry
    
    operatorImage: registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-operator:0.1.0
    tanzuMySQLImage: registry.pivotal.io/tanzu-mysql-for-kubernetes/tanzu-mysql-instance:0.1.0
    resources: limits: cpu: 100m memory: 30Mi requests: cpu: 100m memory: 20Mi

Use Helm CLI to Install the Operator

To install the Operator using the Helm CLI:

  1. Verify that you are in the same working directory as where you downloaded the Helm chart in Step 4 of Create Namespace and Secret above.

  2. Install the Tanzu MySQL for Kubernetes Operator by running:

    helm install tanzu-mysql-operator ./tanzu-mysql-operator/
    
  3. See that your Operator has installed successfully by running:

    kubectl get all
    

    The Tanzu MySQL for Kubernetes Operator has finished installing when you see the value of the STATUS column for the Tanzu MySQL for Kubernetes Operator Pod is Running. See example output:

    $ kubectl get all
    NAME                                                           READY   STATUS    RESTARTS   AGE
    pod/mysql-for-kubernetes-controller-manager-84d76dfb77-lq5mb   1/1     Running   0          21s
    
    NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/mysql-for-kubernetes-controller-manager 1/1 1 1 23s
    NAME DESIRED CURRENT READY AGE replicaset.apps/mysql-for-kubernetes-controller-manager-84d76dfb77 1 1 1 23s

    Note: You can only have one Tanzu MySQL for Kubernetes Operator installed in a Kubernetes cluster.