3.1 Deploy using Helm

Potential values for creating a MySQL InnoDB Cluster are visible here:

$> helm show values mysql-operator/mysql-innodbcluster

Public Registry

The most common Helm repository is the public https://artifacthub.io/, which is used by these examples.

This example defines credentials in a file named credentials.yaml, sets tls.useSelfSigned=true to avoid setting up SSL, uses the default namespace, and sets mycluster as the cluster's name:

Example credentials.yaml:

credentials:
  root:
    user: root
    password: sakila
    host: "%"
$> helm install mycluster mysql-operator/mysql-innodbcluster \
   --set tls.useSelfSigned=true --values credentials.yaml

The manifest for this simple installation looks similar to this:

$> helm get manifest mycluster

---
# Source: mysql-innodbcluster/templates/service_account_cluster.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: mycluster-sa
  namespace: default
---
# Source: mysql-innodbcluster/templates/cluster_secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: mycluster-cluster-secret
  namespace: default
stringData:
  rootUser: "root"
  rootHost: "%"
  rootPassword: "sakila"
---
# Source: mysql-innodbcluster/templates/deployment_cluster.yaml
apiVersion: mysql.oracle.com/v2
kind: InnoDBCluster
metadata:
  name: mycluster
  namespace: default
spec:
  instances: 3
  tlsUseSelfSigned: true
  router:
    instances: 1
  secretName: mycluster-cluster-secret
  imagePullPolicy : IfNotPresent
  baseServerId: 1000
  version: 9.1.0
  serviceAccountName: mycluster-sa

Alternatively set options using command-line parameters:

$> helm install mycluster mysql-operator/mysql-innodbcluster \
    --set credentials.root.user='root' \
    --set credentials.root.password='sakila' \
    --set credentials.root.host='%' \
    --set serverInstances=3 \
    --set routerInstances=1 \
    --set tls.useSelfSigned=true

To view user-supplied values for an existing cluster:

$> helm get values mycluster

USER-SUPPLIED VALUES:
credentials:
  root:
    host: '%'
    password: sakila
    user: root
routerInstances: 1
serverInstances: 3
tls:
  useSelfSigned: true

See also Chapter 5, Connecting to MySQL InnoDB Cluster.