mysql
by Helm
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 repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release 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.12+
- Helm 3.1.0
- PV provisioner support in the underlying infrastructure
Installing the Chart
To install the chart with the release name my-release:
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/mysql
These commands deploy MySQL on the Kubernetes cluster in the default configuration. The Parameters 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.
Parameters
The following table 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) |
global.storageClass | Global storage class for dynamic provisioning | nil |
Common parameters
| Parameter | Description | Default |
|---|---|---|
nameOverride | String to partially override common.names.fullname | nil |
fullnameOverride | String to fully override common.names.fullname | nil |
clusterDomain | Default Kubernetes cluster domain | cluster.local |
commonLabels | Labels to add to all deployed objects | nil |
commonAnnotations | Annotations to add to all deployed objects | [] |
schedulerName | Name of the scheduler (other than default) to dispatch pods | nil |
extraDeploy | Array of extra objects to deploy with the release (evaluated as a template) | nil |
priorityClassName | Name of priority class | nil |
MySQL common parameters
| Parameter | Description | Default |
|---|---|---|
image.registry | MySQL image registry | docker.io |
image.repository | MySQL image name | bitnami/mysql |
image.tag | MySQL image tag | {TAG_NAME} |
image.pullPolicy | MySQL image pull policy | IfNotPresent |
image.pullSecrets | Specify docker-registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
image.debug | Specify if debug logs should be enabled | false |
architecture | MySQL architecture (standalone or replication) | standalone |
auth.rootPassword | Password for the root user. Ignored if existing secret is provided. | random 10 character alphanumeric string |
auth.database | Name for a custom database to create | my_database |
auth.username | Name for a custom user to create | "" |
auth.password | Password for the new user. Ignored if existing secret is provided | random 10 character long alphanumeric string |
auth.replicationUser | MySQL replication user | nil |
auth.replicationPassword | MySQL replication user password. Ignored if existing secret is provided | random 10 character long alphanumeric string |
auth.forcePassword | Force users to specify required passwords | false |
auth.usePasswordFiles | Mount credentials as a files instead of using an environment variable | false |
auth.customPasswordFiles | Use custom password files when auth.usePasswordFiles is set to true. Define path for keys root and user, also define replicator if architecture is set to replication | {} |
auth.existingSecret | Use existing secret for password details (auth.rootPassword, auth.password, auth.replicationPassword will be ignored and picked up from this secret). The secret has to contain the keys mysql-root-password, mysql-replication-password and mysql-password | nil |
initdbScripts | Dictionary of initdb scripts | nil |
initdbScriptsConfigMap | ConfigMap with the initdb scripts (Note: Overrides initdbScripts) | nil |
MySQL Primary parameters
| Parameter | Description | Default |
|---|---|---|
primary.command | Override default container command on MySQL Primary container(s) (useful when using custom images) | nil |
primary.args | Override default container args on MySQL Primary container(s) (useful when using custom images) | nil |
primary.configuration | MySQL Primary configuration to be injected as ConfigMap | Check values.yaml file |
primary.existingConfigmap | Name of existing ConfigMap with MySQL Primary configuration | nil |
primary.updateStrategy | Update strategy type for the MySQL primary statefulset | RollingUpdate |
primary.podAnnotations | Additional pod annotations for MySQL primary pods | {} (evaluated as a template) |
primary.hostAliases | Add deployment host aliases | [] |
primary.podLabels | Additional pod labels for MySQL primary pods | {} (evaluated as a template) |
primary.podAffinityPreset | MySQL primary pod affinity preset. Ignored if primary.affinity is set. Allowed values: soft or hard | "" |
primary.podAntiAffinityPreset | MySQL primary pod anti-affinity preset. Ignored if primary.affinity is set. Allowed values: soft or hard | soft |
primary.nodeAffinityPreset.type | MySQL primary node affinity preset type. Ignored if primary.affinity is set. Allowed values: soft or hard | "" |
primary.nodeAffinityPreset.key | MySQL primary node label key to match Ignored if primary.affinity is set. | "" |
| `primary.nodeAff |
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 v8.5.1 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