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 uses all default values in the default namespace with mycluster as the release name:

$> helm install mycluster mysql-operator/mysql-innodbcluster

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
  router:
    instances: 1
  secretName: mycluster-cluster-secret
  imagePullPolicy : IfNotPresent
  baseServerId: 1000
  version: 8.0.31
  serviceAccountName: mycluster-sa
  tls:
    useSelfSigned: false

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 4, Connecting to MySQL InnoDB Cluster.