mysql
by KubeGems
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.
| Parameter | Description | Default |
|---|---|---|
global.imageRegistry | Global Docker image registry | nil |
global.imagePullSecrets | Global Docker registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
image.registry | MySQL image registry | docker.io |
image.repository | MySQL Image name | bitnami/mysql |
image.tag | MySQL Image tag | {VERSION} |
image.pullPolicy | MySQL image pull policy | Always if imageTag is latest, else IfNotPresent |
image.pullSecrets | Specify docker-registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
service.type | Kubernetes service type | ClusterIP |
service.port | MySQL service port | 3306 |
root.password | Password for the root user | random 10 character alphanumeric string |
db.user | Username of new user to create (should be different from replication.user) | nil |
db.password | Password for the new user | random 10 character alphanumeric string if db.user is defined |
db.name | Name for new database to create | my_database |
securityContext.enabled | Enable security context | true |
securityContext.fsGroup | Group ID for the container | 1001 |
securityContext.runAsUser | User ID for the container | 1001 |
replication.enabled | MySQL replication enabled | true |
replication.user | MySQL replication user (should be different from db.user) | replicator |
replication.password | MySQL replication user password | random 10 character alphanumeric string |
master.antiAffinity | Master pod anti-affinity policy | soft |
master.updateStrategy.type | Master statefulset update strategy policy | RollingUpdate |
master.persistence.enabled | Enable persistence using a PersistentVolumeClaim | true |
master.persistence.existingClaim | Provide an existing PersistentVolumeClaim | nil |
master.persistence.mountPath | Configure PersistentVolumeClaim mount path | /bitnami/mysql |
master.persistence.annotations | Persistent Volume Claim annotations | {} |
master.persistence.storageClass | Persistent Volume Storage Class | `` |
master.persistence.accessModes | Persistent Volume Access Modes | [ReadWriteOnce] |
master.persistence.size | Persistent Volume Size | 8Gi |
master.config | Config file for the MySQL Master server | _default values in the values.yaml file_ |
master.resources | CPU/Memory resource requests/limits for master node | {} |
master.livenessProbe.enabled | Turn on and off liveness probe (master) | true |
master.livenessProbe.initialDelaySeconds | Delay before liveness probe is initiated (master) | 120 |
master.livenessProbe.periodSeconds | How often to perform the probe (master) | 10 |
master.livenessProbe.timeoutSeconds | When the probe times out (master) | 1 |
master.livenessProbe.successThreshold | Minimum consecutive successes for the probe (master) | 1 |
master.livenessProbe.failureThreshold | Minimum consecutive failures for the probe (master) | 3 |
master.readinessProbe.enabled | Turn on and off readiness probe (master) | true |
master.readinessProbe.initialDelaySeconds | Delay before readiness probe is initiated (master) | 30 |
master.readinessProbe.periodSeconds | How often to perform the probe (master) | 10 |
master.readinessProbe.timeoutSeconds | When the probe times out (master) | 1 |
master.readinessProbe.successThreshold | Minimum consecutive successes for the probe (master) | 1 |
master.readinessProbe.failureThreshold | Minimum consecutive failures for the probe (master) | 3 |
slave.replicas | Desired number of slave replicas | 1 |
slave.antiAffinity | Slave pod anti-affinity policy | soft |
slave.updateStrategy.type | Slave statefulset update strategy policy | RollingUpdate |
slave.persistence.enabled | Enable persistence using a PersistentVolumeClaim | true |
slave.persistence.mountPath | Configure PersistentVolumeClaim mount path | /bitnami/mysql |
slave.persistence.annotations | Persistent Volume Claim annotations | {} |
slave.persistence.storageClass | Persistent Volume Storage Class | `` |
slave.persistence.accessModes | Persistent Volume Access Modes | [ReadWriteOnce] |
slave.persistence.size | Persistent Volume Size | 8Gi |
slave.config | Config file for the MySQL Slave replicas | _default values in the values.yaml file_ |
slave.resources | CPU/Memory resource requests/limits for slave node | {} |
slave.livenessProbe.enabled | Turn on and off liveness probe (slave) | true |
slave.livenessProbe.initialDelaySeconds | Delay before liveness probe is initiated (slave) | 120 |
slave.livenessProbe.periodSeconds | How often to perform the probe (slave) | 10 |
slave.livenessProbe.timeoutSeconds | When the probe times out (slave) | 1 |
slave.livenessProbe.successThreshold | Minimum consecutive successes for the probe (slave) | 1 |
slave.livenessProbe.failureThreshold | Minimum consecutive failures for the probe (slave) | 3 |
slave.readinessProbe.enabled | Turn on and off readiness probe (slave) | true |
slave.readinessProbe.initialDelaySeconds | Delay before readiness probe is initiated (slave) | 30 |
slave.readinessProbe.periodSeconds | How often to perform the probe (slave) | 10 |
slave.readinessProbe.timeoutSeconds | When 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartmysql is pinned at v4.5.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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