mysql

by KubeGems

Helm chartv4.5.2App 5.7.26

Chart to create a Highly available MySQL cluster

About this chart

MySQL

MySQL is a fast, reliable, scalable, and easy to use open-source relational database system. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.

TL;DR

$ helm install bitnami/mysql

Introduction

This chart bootstraps a MySQL replication cluster deployment on a Kubernetes cluster using the Helm package manager.

Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of Bitnami Kubernetes Production Runtime (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.

Prerequisites

  • Kubernetes 1.10+
  • PV provisioner support in the underlying infrastructure

Installing the Chart

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

$ helm install --name my-release bitnami/mysql

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

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

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

ParameterDescriptionDefault
global.imageRegistryGlobal Docker image registrynil
global.imagePullSecretsGlobal Docker registry secret names as an array[] (does not add image pull secrets to deployed pods)
image.registryMySQL image registrydocker.io
image.repositoryMySQL Image namebitnami/mysql
image.tagMySQL Image tag{VERSION}
image.pullPolicyMySQL image pull policyAlways if imageTag is latest, else IfNotPresent
image.pullSecretsSpecify docker-registry secret names as an array[] (does not add image pull secrets to deployed pods)
service.typeKubernetes service typeClusterIP
service.portMySQL service port3306
root.passwordPassword for the root userrandom 10 character alphanumeric string
db.userUsername of new user to create (should be different from replication.user)nil
db.passwordPassword for the new userrandom 10 character alphanumeric string if db.user is defined
db.nameName for new database to createmy_database
securityContext.enabledEnable security contexttrue
securityContext.fsGroupGroup ID for the container1001
securityContext.runAsUserUser ID for the container1001
replication.enabledMySQL replication enabledtrue
replication.userMySQL replication user (should be different from db.user)replicator
replication.passwordMySQL replication user passwordrandom 10 character alphanumeric string
master.antiAffinityMaster pod anti-affinity policysoft
master.updateStrategy.typeMaster statefulset update strategy policyRollingUpdate
master.persistence.enabledEnable persistence using a PersistentVolumeClaimtrue
master.persistence.existingClaimProvide an existing PersistentVolumeClaimnil
master.persistence.mountPathConfigure PersistentVolumeClaim mount path/bitnami/mysql
master.persistence.annotationsPersistent Volume Claim annotations{}
master.persistence.storageClassPersistent Volume Storage Class``
master.persistence.accessModesPersistent Volume Access Modes[ReadWriteOnce]
master.persistence.sizePersistent Volume Size8Gi
master.configConfig file for the MySQL Master server_default values in the values.yaml file_
master.resourcesCPU/Memory resource requests/limits for master node{}
master.livenessProbe.enabledTurn on and off liveness probe (master)true
master.livenessProbe.initialDelaySecondsDelay before liveness probe is initiated (master)120
master.livenessProbe.periodSecondsHow often to perform the probe (master)10
master.livenessProbe.timeoutSecondsWhen the probe times out (master)1
master.livenessProbe.successThresholdMinimum consecutive successes for the probe (master)1
master.livenessProbe.failureThresholdMinimum consecutive failures for the probe (master)3
master.readinessProbe.enabledTurn on and off readiness probe (master)true
master.readinessProbe.initialDelaySecondsDelay before readiness probe is initiated (master)30
master.readinessProbe.periodSecondsHow often to perform the probe (master)10
master.readinessProbe.timeoutSecondsWhen the probe times out (master)1
master.readinessProbe.successThresholdMinimum consecutive successes for the probe (master)1
master.readinessProbe.failureThresholdMinimum consecutive failures for the probe (master)3
slave.replicasDesired number of slave replicas1
slave.antiAffinitySlave pod anti-affinity policysoft
slave.updateStrategy.typeSlave statefulset update strategy policyRollingUpdate
slave.persistence.enabledEnable persistence using a PersistentVolumeClaimtrue
slave.persistence.mountPathConfigure PersistentVolumeClaim mount path/bitnami/mysql
slave.persistence.annotationsPersistent Volume Claim annotations{}
slave.persistence.storageClassPersistent Volume Storage Class``
slave.persistence.accessModesPersistent Volume Access Modes[ReadWriteOnce]
slave.persistence.sizePersistent Volume Size8Gi
slave.configConfig file for the MySQL Slave replicas_default values in the values.yaml file_
slave.resourcesCPU/Memory resource requests/limits for slave node{}
slave.livenessProbe.enabledTurn on and off liveness probe (slave)true
slave.livenessProbe.initialDelaySecondsDelay before liveness probe is initiated (slave)120
slave.livenessProbe.periodSecondsHow often to perform the probe (slave)10
slave.livenessProbe.timeoutSecondsWhen the probe times out (slave)1
slave.livenessProbe.successThresholdMinimum consecutive successes for the probe (slave)1
slave.livenessProbe.failureThresholdMinimum consecutive failures for the probe (slave)3
slave.readinessProbe.enabledTurn on and off readiness probe (slave)true
slave.readinessProbe.initialDelaySecondsDelay before readiness probe is initiated (slave)30
slave.readinessProbe.periodSecondsHow often to perform the probe (slave)10
slave.readinessProbe.timeoutSecondsWhen the probe times out (slave)

Deploy mysql with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mysql on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmysql is pinned at v4.5.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply