Back to Charts

⚠️ Repo Archive Notice

incubator/mysqlha/README.md

latest7.0 KB
Original Source

⚠️ Repo Archive Notice

As of Nov 13, 2020, charts in this repo will no longer be updated. For more information, see the Helm Charts Deprecation and Archive Notice, and Update.

MySQL - Single Master, Multiple Slaves

MySQL is one of the most popular database servers in the world. Notable users include Wikipedia, Facebook and Google.

DEPRECATION NOTICE

This chart is deprecated and no longer supported.

Introduction

This chart bootstraps a single master and multiple slave MySQL deployment on a Kubernetes cluster using the Helm package manager. Largely inspired by this tutorial, further work was made to 'production-ize' the example.

Prerequisites

  • Kubernetes 1.10+ with Beta APIs enabled
  • PV provisioner support in the underlying infrastructure

Installing the Chart

To install the chart with the release name my-release:

bash
$ helm install --name my-release incubator/mysqlha

The command deploys MySQL cluster on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Uninstall

To uninstall/delete the my-release deployment:

bash
$ helm delete my-release

Configuration

The following table lists the configurable parameters of the MySQL chart and their default values.

ParameterDescriptionDefault
mysqlImagemysql image and tag.mysql:5.7.13
xtraBackupImagextrabackup image and tag.gcr.io/google-samples/xtrabackup:1.0
imagePullPolicyImage pull policy.IfNotPresent
nameOverrideString to partially override mysqlha.fullname template with a string (will prepend the release name)nil
fullnameOverrideString to fully override mysqlha.fullname template with a stringnil
replicaCountNumber of MySQL replicas3
mysqlRootPasswordPassword for the root user.Randomly generated
mysqlUserUsername of new user to create.nil
mysqlPasswordPassword for the new user.Randomly generated
mysqlReplicationUserUsername for replication userrepl
mysqlReplicationPasswordPassword for replication user.Randomly generated
mysqlDatabaseName of the new Database to createnil
configFiles.master.cnfMaster configuration fileSee values.yaml
configFiles.slave.cnfSlave configuration fileSee values.yaml
podAnnotationsPod annotationsnil
schedulerNameName of the k8s scheduler (other than default)nil
persistence.enabledCreate a volume to store datatrue
persistence.sizeSize of persistent volume claim10Gi
persistence.storageClassType of persistent volume claimnil
persistence.accessModesPersistent volume access modes[ReadWriteOnce]
persistence.annotationsPersistent volume annotations{}
resourcesCPU/Memory resource requests/limitsMemory: 128Mi, CPU: 100m
metrics.enabledStart a side-car prometheus exporterfalse
metrics.imageExporter imageprom/mysqld-exporter
metrics.imageTagExporter imagev0.10.0
metrics.imagePullPolicyExporter image pull policyIfNotPresent
metrics.resourcesExporter resource requests/limitSee values.yaml
metrics.livenessProbe.initialDelaySecondsDelay before metrics liveness probe is initiated15
metrics.livenessProbe.timeoutSecondsWhen the probe times out5
metrics.readinessProbe.initialDelaySecondsDelay before metrics readiness probe is initiated5
metrics.readinessProbe.timeoutSecondsWhen the probe times out1

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

Persistence

The MySQL image stores the MySQL data and configurations at the /var/lib/mysql path of the container.

By default persistence is enabled, and a PersistentVolumeClaim is created and mounted in that directory. As a result, a persistent volume will need to be defined:

# https://kubernetes.io/docs/user-guide/persistent-volumes/#azure-disk
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: fast
provisioner: kubernetes.io/azure-disk
parameters:
  skuName: Premium_LRS
  location: westus

In order to disable this functionality you can change the values.yaml to disable persistence and use an emptyDir instead.