mysql
by KubeSphere
High Availability MySQL Cluster, Open Source.
About this chart
RadonDB MySQL
RadonDB MySQL is an open-source, cloud-native, High-Availability cluster solutions based on MySQL.
Github
https://github.com/radondb/radondb-mysql-kubernetes
Features
- High availability MySQL database
- Non-centralized automatic leader election
- Second level switch leader to follower
- Strongly consistent data for cluster switching
- Cluster management
- Monitoring and alerting
- Logs
- Account management
Introduction
This chart bootstraps a single leader and multiple followers 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
- Helm 2.11+ or Helm 3.0-beta3+
Installing the Chart
To install the chart with the release name my-release:
## For Helm v2
$ helm install . --name my-release
## For Helm v3
$ helm install --name my-release .
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:
$ helm delete my-release
To delete the pvc:
kubectl delete pvc data-my-release-radondb-mysql-0
kubectl delete pvc data-my-release-radondb-mysql-1
kubectl delete pvc data-my-release-radondb-mysql-2
The commands remove all the Kubernetes components associated with the chart and deletes the release completely.
Configuration
The following table lists the configurable parameters of the RadonDB MySQL chart and their default values.
| Parameter | Description | Default |
|---|---|---|
imagePullPolicy | Image pull policy | IfNotPresent |
fullnameOverride | Custom fullname override for the chart | |
nameOverride | Custom name override for the chart | |
replicaCount | The number of pods | 3 |
busybox.image | busybox image repository. | busybox |
busybox.tag | busybox image tag. | 1.32 |
mysql.image | mysql image repository. | xenondb/percona |
mysql.tag | mysql image tag. | 5.7.33 |
mysql.allowEmptyRootPassword | If set true, allow a empty root password. | true |
mysql.mysqlRootPassword | Password for the root user. | |
mysql.mysqlReplicationPassword | Password for the qc_repl user. | Repl_123, random 12 characters if not set |
mysql.mysqlUser | Username of new user to create. | qingcloud |
mysql.mysqlPassword | Password for the new user. | Qing@123, random 12 characters if not set |
mysql.mysqlDatabase | Name for new database to create. | qingcloud |
mysql.initTokudb | Install tokudb engine. | false |
mysql.args | Additional arguments to pass to the MySQL container. | [] |
mysqlconfigFiles.node.cnf | Mysql configuration file | See values.yaml |
mysql.livenessProbe.initialDelaySeconds | Delay before mysql liveness probe is initiated | 30 |
mysql.livenessProbe.periodSeconds | How often to perform the mysql probe | 10 |
mysql.livenessProbe.timeoutSeconds | When the mysql probe times out | 5 |
mysql.livenessProbe.successThreshold | Minimum consecutive successes for the mysql probe to be considered successful after having failed. | 1 |
mysql.livenessProbe.failureThreshold | Minimum consecutive failures for the mysql probe to be considered failed after having succeeded. | 3 |
mysql.readinessProbe.initialDelaySeconds | Delay before mysql readiness probe is initiated | 10 |
mysql.readinessProbe.periodSeconds | How often to perform the mysql probe | 10 |
mysql.readinessProbe.timeoutSeconds | When the mysql probe times out | 1 |
mysql.readinessProbe.successThreshold | Minimum consecutive successes for the mysql probe to be considered successful after having failed. | 1 |
mysql.readinessProbe.failureThreshold | Minimum consecutive failures for the mysql probe to be considered failed after having succeeded. | 3 |
mysql.extraEnvVars | Additional environment variables as a string to be passed to the tpl function | |
mysql.resources | CPU/Memory resource requests/limits for mysql. | Memory: 256Mi, CPU: 100m |
xenon.image | xenon image repository. | xenondb/xenon |
xenon.tag | xenon image tag. | 1.1.5-alpha |
xenon.args | Additional arguments to pass to the xenon container. | [] |
xenon.extraEnvVars | Additional environment variables as a string to be passed to the tpl function | |
xenon.livenessProbe.initialDelaySeconds | Delay before xenon liveness probe is initiated | 30 |
xenon.livenessProbe.periodSeconds | How often to perform the xenon probe | 10 |
xenon.livenessProbe.timeoutSeconds | When the xenon probe times out | 5 |
xenon.livenessProbe.successThreshold | Minimum consecutive successes for xenon probe to be considered successful after having failed. | 1 |
xenon.livenessProbe.failureThreshold | Minimum consecutive failures for the xenon probe to be considered failed after having succeeded. | 3 |
xenon.readinessProbe.initialDelaySeconds | Delay before xenon readiness probe is initiated | 10 |
xenon.readinessProbe.periodSeconds | How often to perform the xenon probe | 10 |
xenon.readinessProbe.timeoutSeconds | When the xenon probe times out | 1 |
xenon.readinessProbe.successThreshold | Minimum consecutive successes for xenon probe to be considered successful after having failed. | 1 |
xenon.readinessProbe.failureThreshold | Minimum consecutive failures for the xenon probe to be considered failed after having succeeded. | 3 |
xenon.resources | CPU/Memory resource requests/limits for xenon. | Memory: 128Mi, CPU: 50m |
metrics.enabled | Start a side-car prometheus exporter | true |
metrics.image | Exporter image | prom/mysqld-exporter |
metrics.tag | Exporter image | v0.12.1 |
metrics.annotations | Exporter annotations | {} |
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.serviceMonitor.enabled | Set this to true to create ServiceMonitor for Prometheus operator | true |
metrics.serviceMonitor.namespace | Optional namespace in which to create ServiceMonitor | nil |
metrics.serviceMonitor.interval | Scrape interval. If not set, the Prometheus default scrape interval is used | 10s |
metrics.serviceMonitor.scrapeTimeout | Scrape timeout. If not set, the Prometheus default scrape timeout is used | nil |
metrics.serviceMonitor.selector | Default to kube-prometheus install, but should be set according to Prometheus install | { prometheus: kube-prometheus } |
slowLogTail | If set to true runs a container to tail mysql-slow.log in the pod | true |
resources | Resource requests/limit | Memory: 32Mi, CPU: 10m |
service.annotations | Kubernetes annotations for service | {} |
service.type | Kubernetes service type | NodePort |
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.0.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