mysql
by wirwolf
Fast, reliable, scalable, and easy to use open-source relational database system.
About this chart
⚠️ 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
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 node MySQL deployment on a Kubernetes cluster using the Helm package manager.
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:
$ helm install --name my-release stable/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.
By default a random password will be generated for the root user. If you'd like to set your own password change the mysqlRootPassword in the values.yaml.
You can retrieve your root password by running the following command. Make sure to replace [YOUR_RELEASE_NAME]:
printf $(printf '\%o' `kubectl get secret [YOUR_RELEASE_NAME]-mysql -o jsonpath="{.data.mysql-root-password[*]}"`)
Tip: List all releases using
helm list
Uninstalling the Chart
To uninstall/delete the my-release deployment:
$ helm delete --purge my-release
The command removes all the Kubernetes components associated with the chart and deletes the release completely.
Configuration
The following table lists the configurable parameters of the MySQL chart and their default values.
| Parameter | Description | Default |
|---|---|---|
args | Additional arguments to pass to the MySQL container. | [] |
initContainer.resources | initContainer resource requests/limits | Memory: 10Mi, CPU: 10m |
image | mysql image repository. | mysql |
imageTag | mysql image tag. | 5.7.30 |
busybox.image | busybox image repository. | busybox |
busybox.tag | busybox image tag. | 1.32 |
testFramework.enabled | test-framework switch. | true |
testFramework.image | test-framework image repository. | bats/bats |
testFramework.tag | test-framework image tag. | 1.2.1 |
testFramework.imagePullPolicy | test-framework image pull policy. | IfNotPresent |
testFramework.securityContext | test-framework securityContext | {} |
imagePullPolicy | Image pull policy | IfNotPresent |
existingSecret | Use Existing secret for Password details | nil |
extraVolumes | Additional volumes as a string to be passed to the tpl function | |
extraVolumeMounts | Additional volumeMounts as a string to be passed to the tpl function | |
extraInitContainers | Additional init containers as a string to be passed to the tpl function | |
extraEnvVars | Additional environment variables as a string to be passed to the tpl function | |
mysqlRootPassword | Password for the root user. Ignored if existing secret is provided | Random 10 characters |
mysqlUser | Username of new user to create. | nil |
mysqlPassword | Password for the new user. Ignored if existing secret is provided | Random 10 characters |
mysqlDatabase | Name for new database to create. | nil |
livenessProbe.initialDelaySeconds | Delay before liveness probe is initiated | 30 |
livenessProbe.periodSeconds | How often to perform the probe | 10 |
livenessProbe.timeoutSeconds | When the probe times out | 5 |
livenessProbe.successThreshold | Minimum consecutive successes for the probe to be considered successful after having failed. | 1 |
livenessProbe.failureThreshold | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 3 |
readinessProbe.initialDelaySeconds | Delay before readiness probe is initiated | 5 |
readinessProbe.periodSeconds | How often to perform the probe | 10 |
readinessProbe.timeoutSeconds | When the probe times out | 1 |
readinessProbe.successThreshold | Minimum consecutive successes for the probe to be considered successful after having failed. | 1 |
readinessProbe.failureThreshold | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 3 |
schedulerName | Name of the k8s scheduler (other than default) | nil |
mysqlx.port.enabled | Boolean to toggle a port for mysqlx 33060 protocol. | false |
persistence.enabled | Create a volume to store data | true |
persistence.size | Size of persistent volume claim | 8Gi RW |
persistence.storageClass | Type of persistent volume claim | nil |
persistence.accessMode | ReadWriteOnce or ReadOnly | ReadWriteOnce |
persistence.existingClaim | Name of existing persistent volume | nil |
persistence.subPath | Subdirectory of the volume to mount | nil |
persistence.annotations | Persistent Volume annotations | {} |
nodeSelector | Node labels for pod assignment | {} |
affinity | Affinity rules for pod assignment | {} |
tolerations | Pod taint tolerations for deployment | {} |
metrics.enabled | Start a side-car prometheus exporter | false |
metrics.image | Exporter image | prom/mysqld-exporter |
metrics.imageTag | Exporter image | v0.10.0 |
metrics.imagePullPolicy | Exporter image pull policy | IfNotPresent |
metrics.resources | Exporter resource requests/limit | nil |
metrics.livenessProbe.initialDelaySeconds | Delay before metrics liveness probe is initiated | 15 |
metrics.livenessProbe.timeoutSeconds | When the probe times out | 5 |
metrics.readinessProbe.initialDelaySeconds | Delay before metrics readiness probe is initiated | 5 |
metrics.readinessProbe.timeoutSeconds | When the probe times out | 1 |
metrics.flags | Additional flags for the mysql exporter to use | [] |
metrics.serviceMonitor.enabled | Set this to true to create ServiceMonitor for Prometheus operator | false |
metrics.serviceMonitor.additionalLabels | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | {} |
resources | CPU/Memory resource requests/limits | Memory: 256Mi, CPU: 100m |
configurationFiles | List of mysql configuration files | nil |
configurationFilesPath | Path of mysql configuration files | /etc/mysql/conf.d/ |
securityContext.enabled | Enable security context (mysql pod) |
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 v1.7.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