mariadb-galera
by [riftbit]
MariaDB Galera is a multi-master database cluster solution for synchronous replication and high availability.
About this chart
MariaDB Galera
MariaDB Galera is a multi-master database cluster solution for synchronous replication and high availability.
TL;DR
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/mariadb-galera
Introduction
This chart bootstraps a MariaDB Galera cluster on Kubernetes using the Helm package manager.
Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters. This chart has been tested to work with fluentd and Prometheus on top of BKPR.
Prerequisites
- Kubernetes 1.10+
- Helm 3.1.0
- PV provisioner support in the underlying infrastructure
Installing the Chart
Add the bitnami charts repo to Helm:
$ helm repo add bitnami https://charts.bitnami.com/bitnami
To install the chart with the release name my-release:
$ helm install my-release bitnami/mariadb-galera
The command deploys MariaDB Galera 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
For a graceful termination, set the replica count of the Pods in the mariadb-galera StatefulSet to 0:
$ kubectl scale sts my-release-mariadb-galera --replicas=0
To uninstall/delete the my-release release:
$ helm delete --purge my-release
The command removes all the Kubernetes components associated with the chart and deletes the release.
Parameters
Global parameters
| Name | Description | Value |
|---|---|---|
global.imageRegistry | Global Docker image registry | "" |
global.imagePullSecrets | Global Docker registry secret names as an array | [] |
global.storageClass | Global StorageClass for Persistent Volume(s) | "" |
Common parameters
| Name | Description | Value |
|---|---|---|
nameOverride | String to partially override common.names.fullname template with a string (will prepend the release name) | "" |
fullnameOverride | String to fully override common.names.fullname template with a string | "" |
schedulerName | Name of the Kubernetes scheduler (other than default) | "" |
clusterDomain | Kubernetes DNS Domain name to use | cluster.local |
extraDeploy | Array of extra objects to deploy with the release (evaluated as a template) | [] |
diagnosticMode.enabled | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | false |
diagnosticMode.command | Command to override all containers in the deployment | [] |
diagnosticMode.args | Args to override all containers in the deployment | [] |
MariaDB Galera parameters
| Name | Description | Value |
|---|---|---|
image.registry | MariaDB Galera image registry | docker.io |
image.repository | MariaDB Galera image repository | bitnami/mariadb-galera |
image.tag | MariaDB Galera image tag (immutable tags are recommended) | 10.5.12-debian-10-r29 |
image.pullPolicy | MariaDB Galera image pull policy | IfNotPresent |
image.pullSecrets | Specify docker-registry secret names as an array | [] |
image.debug | Specify if debug logs should be enabled | false |
podManagementPolicy | StatefulSet controller supports relax its ordering guarantees while preserving its uniqueness and identity guarantees. There are two valid pod management policies: OrderedReady and Parallel | OrderedReady |
hostAliases | Add deployment host aliases | [] |
service.type | Kubernetes service type | ClusterIP |
service.port | MariaDB service port | 3306 |
service.clusterIP | Specific cluster IP when service type is cluster IP. Use None for headless service | "" |
service.nodePort | Specify the nodePort value for the LoadBalancer and NodePort service types. | "" |
service.externalIPs | External IP list to use with ClusterIP service type | [] |
service.loadBalancerIP | loadBalancerIP if service type is LoadBalancer | "" |
service.loadBalancerSourceRanges | Addresses that are allowed when svc is LoadBalancer | [] |
service.annotations | Additional annotations for MariaDB Galera service | {} |
service.headless.annotations | Annotations for the headless service. May be useful for setting service.alpha.kubernetes.io/tolerate-unready-endpoints="true" when using peer-finder. | {} |
serviceAccount.create | Specify whether a ServiceAccount should be created | false |
serviceAccount.name | The name of the ServiceAccount to create | "" |
extraEnvVars | Array containing extra env vars to configure MariaDB Galera replicas | [] |
extraEnvVarsCM | ConfigMap containing extra env vars to configure MariaDB Galera replicas | "" |
extraEnvVarsSecret | Secret containing extra env vars to configure MariaDB Galera replicas | "" |
rbac.create | Specify whether RBAC resources should be created and used | false |
securityContext.enabled | Enable security context | true |
securityContext.fsGroup | Group ID for the container filesystem | 1001 |
securityContext.runAsUser | User ID for the container | 1001 |
rootUser.user | Username for the admin user. | root |
rootUser.password | Password for the admin user. Ignored if existing secret is provided. | "" |
rootUser.forcePassword | Option to force users to specify a password. That is required for 'helm upgrade' to work properly. | false |
existingSecret | Use existing secret for password details (rootUser.password, db.password, galera.mariabackup.password will be ignored and picked up from this secret) | "" |
usePasswordFiles | Mount credentials as a files instead of using an environment variable. | false |
customPasswordFiles | Use custom password files when usePasswordFiles is set to true. Define path for keys root, user, and mariabackup. | {} |
db.user | Username of new user to create | "" |
db.password | Password for the new user. Ignored if existing secret is provided. | "" |
db.name | Name for new database to create | my_database |
db.forcePassword | Option to force users to specify a password. That is required for 'helm upgrade' to work properly. | false |
Deploy mariadb-galera with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mariadb-galera 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 chartmariadb-galera is pinned at v5.13.5 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