1.0.1-0.1.0 • Published 5 years ago

@helm-charts/bitnami-mariadb-cluster v1.0.1-0.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

@helm-charts/bitnami-mariadb-cluster

Chart to create a Highly available MariaDB cluster

FieldValue
Repository Namebitnami
Chart Namemariadb-cluster
Chart Version1.0.1
NPM Package Version0.1.0
## Bitnami MariaDB image
## ref: https://hub.docker.com/r/bitnami/mariadb/tags/
##
image:
  registry: docker.io
  repository: bitnami/mariadb
  tag: 10.2.14
  ## Specify a imagePullPolicy
  ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
  ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
  ##
  pullPolicy: Always
  ## Optionally specify an array of imagePullSecrets.
  ## Secrets must be manually created in the namespace.
  ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
  ##
  # pullSecrets:
  #   - myRegistrKeySecretName

service:
  ## Kubernetes service type
  type: ClusterIP
  port: 3306

root:
  ## MariaDB admin password
  ## ref: https://github.com/bitnami/bitnami-docker-mariadb#setting-the-root-password-on-first-run
  ##
  password:
  ## Use existing secret (ignores root, db and replication passwords)
  # existingSecret:
  ##
  ## Option to force users to specify a password. That is required for 'helm upgrade' to work properly.
  ## If it is not force, a random password will be generated.
  forcePassword: false

db:
  ## MariaDB username and password
  ## ref: https://github.com/bitnami/bitnami-docker-mariadb#creating-a-database-user-on-first-run
  ##
  user:
  password:
  ## Password is ignored if existingSecret is specified.
  ## Database to create
  ## ref: https://github.com/bitnami/bitnami-docker-mariadb#creating-a-database-on-first-run
  ##
  name: my_database
  ## Option to force users to specify a password. That is required for 'helm upgrade' to work properly.
  ## If it is not force, a random password will be generated.
  forcePassword: false

replication:
  ## Enable replication. This enables the creation of replicas of MariaDB. If false, only a
  ## master deployment would be created
  enabled: true
  ##
  ## MariaDB replication user
  ## ref: https://github.com/bitnami/bitnami-docker-mariadb#setting-up-a-replication-cluster
  ##
  user: replicator
  ## MariaDB replication user password
  ## ref: https://github.com/bitnami/bitnami-docker-mariadb#setting-up-a-replication-cluster
  ##
  password:
  ## Password is ignored if existingSecret is specified.
  ##
  ## Option to force users to specify a password. That is required for 'helm upgrade' to work properly.
  ## If it is not force, a random password will be generated.
  forcePassword: false

master:
  antiAffinity: soft
  ## Enable persistence using Persistent Volume Claims
  ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
  ##
  persistence:
    ## If true, use a Persistent Volume Claim, If false, use emptyDir
    ##
    enabled: true
    ## Persistent Volume Storage Class
    ## If defined, storageClassName: <storageClass>
    ## If set to "-", storageClassName: "", which disables dynamic provisioning
    ## If undefined (the default) or set to null, no storageClassName spec is
    ##   set, choosing the default provisioner.  (gp2 on AWS, standard on
    ##   GKE, AWS & OpenStack)
    ##
    # storageClass: "-"
    ## Persistent Volume Claim annotations
    ##
    annotations:
    ## Persistent Volume Access Mode
    ##
    accessModes:
      - ReadWriteOnce
    ## Persistent Volume size
    ##
    size: 8Gi
    ##

  ## Configure MySQL with a custom my.cnf file
  ## ref: https://mysql.com/kb/en/mysql/configuring-mysql-with-mycnf/#example-of-configuration-file
  ##
  config: |-
    [mysqld]
    skip-name-resolve
    explicit_defaults_for_timestamp
    basedir=/opt/bitnami/mariadb
    port=3306
    socket=/opt/bitnami/mariadb/tmp/mysql.sock
    tmpdir=/opt/bitnami/mariadb/tmp
    max_allowed_packet=16M
    bind-address=0.0.0.0
    pid-file=/opt/bitnami/mariadb/tmp/mysqld.pid
    log-error=/opt/bitnami/mariadb/logs/mysqld.log
    character-set-server=UTF8
    collation-server=utf8_general_ci

    [client]
    port=3306
    socket=/opt/bitnami/mariadb/tmp/mysql.sock
    default-character-set=UTF8

    [manager]
    port=3306
    socket=/opt/bitnami/mariadb/tmp/mysql.sock
    pid-file=/opt/bitnami/mariadb/tmp/mysqld.pid

  ## Configure master resource requests and limits
  ## ref: http://kubernetes.io/docs/user-guide/compute-resources/
  ##
  resources: {}
  livenessProbe:
    enabled: true
    ##
    ## Initializing the database could take some time
    initialDelaySeconds: 120
    ##
    ## Default Kubernetes values
    periodSeconds: 10
    timeoutSeconds: 1
    successThreshold: 1
    failureThreshold: 3
  readinessProbe:
    enabled: true
    initialDelaySeconds: 15
    ##
    ## Default Kubernetes values
    periodSeconds: 10
    timeoutSeconds: 1
    successThreshold: 1
    failureThreshold: 3

slave:
  replicas: 1
  antiAffinity: soft
  persistence:
    ## If true, use a Persistent Volume Claim, If false, use emptyDir
    ##
    enabled: true
    # storageClass: "-"
    annotations:
    accessModes:
      - ReadWriteOnce
    ## Persistent Volume size
    ##
    size: 8Gi
    ##

  ## Configure MySQL slave with a custom my.cnf file
  ## ref: https://mysql.com/kb/en/mysql/configuring-mysql-with-mycnf/#example-of-configuration-file
  ##
  config: |-
    [mysqld]
    skip-name-resolve
    explicit_defaults_for_timestamp
    basedir=/opt/bitnami/mariadb
    port=3306
    socket=/opt/bitnami/mariadb/tmp/mysql.sock
    tmpdir=/opt/bitnami/mariadb/tmp
    max_allowed_packet=16M
    bind-address=0.0.0.0
    pid-file=/opt/bitnami/mariadb/tmp/mysqld.pid
    log-error=/opt/bitnami/mariadb/logs/mysqld.log
    character-set-server=UTF8
    collation-server=utf8_general_ci

    [client]
    port=3306
    socket=/opt/bitnami/mariadb/tmp/mysql.sock
    default-character-set=UTF8

    [manager]
    port=3306
    socket=/opt/bitnami/mariadb/tmp/mysql.sock
    pid-file=/opt/bitnami/mariadb/tmp/mysqld.pid

  ##
  ## Configure slave resource requests and limits
  ## ref: http://kubernetes.io/docs/user-guide/compute-resources/
  ##
  resources: {}
  livenessProbe:
    enabled: true
    ##
    ## Initializing the database could take some time
    initialDelaySeconds: 120
    ##
    ## Default Kubernetes values
    periodSeconds: 10
    timeoutSeconds: 1
    successThreshold: 1
    failureThreshold: 3
  readinessProbe:
    enabled: true
    initialDelaySeconds: 15
    ##
    ## Default Kubernetes values
    periodSeconds: 10
    timeoutSeconds: 1
    successThreshold: 1
    failureThreshold: 3

metrics:
  enabled: false
  image:
    registry: docker.io
    repository: prom/mysqld-exporter
    tag: v0.10.0
    pullPolicy: IfNotPresent
  resources: {}
  annotations:
    prometheus.io/scrape: 'true'
    prometheus.io/port: '9104'

MariaDB Cluster

MariaDB is one of the most popular database servers in the world. It’s made by the original developers of MySQL and guaranteed to stay open source. Notable users include Wikipedia, Facebook and Google.

MariaDB is developed as open source software and as a relational database it provides an SQL interface for accessing data. The latest versions of MariaDB also include GIS and JSON features.

TL;DR

$ helm install bitnami/mariadb-cluster

Introduction

This chart bootstraps a MariaDB replication cluster deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.4+ 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 bitnami/mariadb-cluster

The command deploys MariaDB on the Kubernetes cluster in the default configuration. The configuration 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.

Configuration

The following tables lists the configurable parameters of the MariaDB chart and their default values.

ParameterDescriptionDefault
image.registryMariaDB image registrydocker.io
image.repositoryMariaDB Image namebitnami/mariadb
image.tagMariaDB Image tag{VERSION}
image.pullPolicyMariaDB image pull policyAlways if imageTag is latest, else IfNotPresent
image.pullSecretsSpecify image pull secretsnil (does not add image pull secrets to deployed pods)
service.typeKubernetes service typeClusterIP
service.portMySQL service port3306
root.passwordPassword for the root userrandom 10 character alphanumeric string
db.userUsername of new user to createnil
db.passwordPassword for the new userrandom 10 character alphanumeric string if db.user is defined
db.nameName for new database to createmy_database
replication.enabledMariaDB replication enabledtrue
replication.userMariaDB replication userreplicator
replication.passwordMariaDB replication user passwordrandom 10 character alphanumeric string
master.antiAffinityMaster pod anti-affinity policysoft
master.persistence.enabledEnable persistence using a PersistentVolumeClaimtrue
master.persistence.annotationsPersistent Volume Claim annotations{}
master.persistence.storageClassPersistent Volume Storage Class
master.persistence.accessModesPersistent Volume Access Modes[ReadWriteOnce]
master.persistence.sizePersistent Volume Size8Gi
master.configConfig file for the MariaDB Master server_default values in the values.yaml file_
master.resourcesCPU/Memory resource requests/limits for master node{}
master.livenessProbe.enabledTurn on and off liveness probe (master)true
master.livenessProbe.initialDelaySecondsDelay before liveness probe is initiated (master)120
master.livenessProbe.periodSecondsHow often to perform the probe (master)10
master.livenessProbe.timeoutSecondsWhen the probe times out (master)1
master.livenessProbe.successThresholdMinimum consecutive successes for the probe (master)1
master.livenessProbe.failureThresholdMinimum consecutive failures for the probe (master)3
master.readinessProbe.enabledTurn on and off readiness probe (master)true
master.readinessProbe.initialDelaySecondsDelay before readiness probe is initiated (master)15
master.readinessProbe.periodSecondsHow often to perform the probe (master)10
master.readinessProbe.timeoutSecondsWhen the probe times out (master)1
master.readinessProbe.successThresholdMinimum consecutive successes for the probe (master)1
master.readinessProbe.failureThresholdMinimum consecutive failures for the probe (master)3
slave.replicasDesired number of slave replicas1
slave.antiAffinitySlave pod anti-affinity policysoft
slave.persistence.enabledEnable persistence using a PersistentVolumeClaimtrue
slave.persistence.annotationsPersistent Volume Claim annotations{}
slave.persistence.storageClassPersistent Volume Storage Class
slave.persistence.accessModesPersistent Volume Access Modes[ReadWriteOnce]
slave.persistence.sizePersistent Volume Size8Gi
slave.configConfig file for the MariaDB Slave replicas_default values in the values.yaml file_
slave.resourcesCPU/Memory resource requests/limits for slave node{}
slave.livenessProbe.enabledTurn on and off liveness probe (slave)true
slave.livenessProbe.initialDelaySecondsDelay before liveness probe is initiated (slave)120
slave.livenessProbe.periodSecondsHow often to perform the probe (slave)10
slave.livenessProbe.timeoutSecondsWhen the probe times out (slave)1
slave.livenessProbe.successThresholdMinimum consecutive successes for the probe (slave)1
slave.livenessProbe.failureThresholdMinimum consecutive failures for the probe (slave)3
slave.readinessProbe.enabledTurn on and off readiness probe (slave)true
slave.readinessProbe.initialDelaySecondsDelay before readiness probe is initiated (slave)15
slave.readinessProbe.periodSecondsHow often to perform the probe (slave)10
slave.readinessProbe.timeoutSecondsWhen the probe times out (slave)1
slave.readinessProbe.successThresholdMinimum consecutive successes for the probe (slave)1
slave.readinessProbe.failureThresholdMinimum consecutive failures for the probe (slave)3
metrics.enabledStart a side-car prometheus exporterfalse
metrics.imageExporter image nameprom/mysqld-exporter
metrics.imageTagExporter image tagv0.10.0
metrics.imagePullPolicyExporter image pull policyIfNotPresent
metrics.resourcesExporter resource requests/limitnil

The above parameters map to the env variables defined in bitnami/mariadb. For more information please refer to the bitnami/mariadb image documentation.

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

$ helm install --name my-release \
  --set root.password=secretpassword,user.database=app_database \
    bitnami/mariadb-cluster

The above command sets the MariaDB root account password to secretpassword. Additionally it creates a database named my_database.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

$ helm install --name my-release -f values.yaml bitnami/mariadb-cluster

Tip: You can use the default values.yaml

Persistence

The Bitnami MariaDB image stores the MariaDB data and configurations at the /bitnami/mariadb path of the container.

The chart mounts a Persistent Volume volume at this location. The volume is created using dynamic volume provisioning, by default. An existing PersistentVolumeClaim can be defined.