mariadb

by salman294

Helm chartv0.3.14App 10.6.15Verified publisher

A Helm chart for MariaDB on Kubernetes

About this chart

MariaDB

Changelog

see RELEASENOTES.md

A Helm chart for MariaDB on Kubernetes

TL;DR

helm repo add groundhog2k https://groundhog2k.github.io/helm-charts/
helm install my-release groundhog2k/mariadb

Introduction

This chart uses the original MariaDB image from Docker Hub to deploy a stateful MariaDB instance in a Kubernetes cluster.

It fully supports deployment of the multi-architecture docker image.

Prerequisites

  • Kubernetes 1.12+
  • Helm 3.x
  • PV provisioner support in the underlying infrastructure

Installing the Chart

To install the chart with the release name my-release:

helm install my-release groundhog2k/mariadb

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm uninstall my-release

Common parameters

KeyTypeDefaultDescription
fullnameOverridestring""Fully override the deployment name
nameOverridestring""Partially override the deployment name

Deployment parameters

KeyTypeDefaultDescription
image.pullPolicystring"IfNotPresent"Image pull policy
image.registrystring"docker.io"Image registry
image.repositorystring"mariadb"Image name
image.tagstring""Image tag
imagePullSecretslist[]Image pull secrets
extraInitContainerslist[]Extra init containers
extaContainerslist[]Extra containers for usage as sidecars
startupProbeobjectsee values.yamlStartup probe configuration
livenessProbeobjectsee values.yamlLiveness probe configuration
readinessProbeobjectsee values.yamlReadiness probe configuration
customStartupProbeobject{}Custom startup probe (overwrites default startup probe configuration)
customLivenessProbeobject{}Custom liveness probe (overwrites default liveness probe configuration)
customReadinessProbeobject{}Custom readiness probe (overwrites default readiness probe configuration)
resourcesobject{}Resource limits and requests
initResourcesobject{}Resource limits and requests for the default init container
nodeSelectorobject{}Deployment node selector
podAnnotationsobject{}Additional pod annotations
podSecurityContextobjectsee values.yamlPod security context
securityContextobjectsee values.yamlContainer security context
envlist[]Additional container environmment variables
serviceAccount.annotationsobject{}Additional service account annotations
serviceAccount.createboolfalseEnable service account creation
serviceAccount.namestring""Name of the service account
affinityobject{}Affinity for pod assignment
tolerationslist[]Tolerations for pod assignment
podManagementPolicystring"OrderedReady"Pod management policy
updateStrategyTypestring"RollingUpdate"Pod update strategy
revisionHistoryLimitintnilMaximum number of revisions maintained in revision history

Service paramters

KeyTypeDefaultDescription
service.typestring"ClusterIP"Service type
service.portint3306MariaDB service port
service.nodePortintnilThe node port (only relevant for type LoadBalancer or NodePort)
service.clusterIPstringnilThe cluster ip address (only relevant for type LoadBalancer or NodePort)
service.loadBalancerIPstringnilThe load balancer ip address (only relevant for type LoadBalancer)
service.annotationsobject{}Additional service annotations

Storage parameters

KeyTypeDefaultDescription
storage.accessModes[0]string"ReadWriteOnce"Storage access mode
storage.persistentVolumeClaimNamestringnilPVC name when existing storage volume should be used
storage.volumeNamestring"db-volume"Internal volume name and prefix of a created PVC
storage.requestedSizestringnilSize for new PVC, when no existing PVC is used
storage.classNamestringnilStorage class name
storage.keepPvcboolfalseKeep a created Persistent volume claim when uninstalling the helm chart (only for option useDeployment: true)

MariaDB parameters

KeyTypeDefaultDescription
useDeploymentboolfalseUse Kubernetes Deployment instead of StatefulSet
userDatabaseobject{}Optional MariaDB user database
userDatabase.namestring""Name of the user database
userDatabase.userstring""User name with full access to user database
userDatabase.passwordstring""Password of created user
settings.rootPasswordstringnilMariaDB root password
settings.allowEmptyRootPasswordboolfalseSet true to allow an empty root password
settings.skipTZInfoboolfalseSet true to skip loading timezone data during init
settings.argumentslist[]Additional arguments for mysqld (entrypoint process)
customConfigstringnilAdditional MariaDB custom configuration mounted as /etc/mysql/custom.cnf
extraEnvSecretslist[]A list of existing secrets that will be mounted into the container as environment variables
extraSecretConfigsstringnilAn existing secret with files that will be mounted into the container as custom MariaDB configuration files (*.cnf) in /etc/mysql/conf.d
customScriptsobjectnilOptional custom scripts that can be defined inline and will be mounted as files in /docker-entrypoint-initdb.d
extraScriptsstringnilAn existing configMap with files that will be mounted into the container as script files (*.sql, *.sh) in /docker-entrypoint-initdb.d
extraSecretslist[]A list of additional existing secrets that will be mounted into the container
extraSecrets[].namestringnilName of the existing K8s secret
extraSecrets[].mountPathstringnilMount path where the secret should be mounted into the container (f.e. /mysecretfolder)

Deploy mariadb with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mariadb 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmariadb is pinned at v0.3.14 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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