4.5.1-0.1.0 • Published 5 years ago

@helm-charts/bitnami-mysql v4.5.1-0.1.0

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

@helm-charts/bitnami-mysql

Chart to create a Highly available MySQL cluster

FieldValue
Repository Namebitnami
Chart Namemysql
Chart Version4.5.1
NPM Package Version0.1.0
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
# global:
#   imageRegistry: myRegistryName
#   imagePullSecrets:
#     - myRegistryKeySecretName

## Bitnami MySQL image
## ref: https://hub.docker.com/r/bitnami/mysql/tags/
##
image:
  registry: docker.io
  repository: bitnami/mysql
  tag: 5.7.25
  ## 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:
  #   - myRegistryKeySecretName

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

## Pod Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
##
securityContext:
  enabled: true
  fsGroup: 1001
  runAsUser: 1001

root:
  ## MySQL admin password
  ## ref: https://github.com/bitnami/bitnami-docker-mysql#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:
  ## MySQL username and password
  ## ref: https://github.com/bitnami/bitnami-docker-mysql#creating-a-database-user-on-first-run
  ## Note that this user should be different from the MySQL replication user (replication.user)
  ##
  user:
  password:
  ## Password is ignored if existingSecret is specified.
  ## Database to create
  ## ref: https://github.com/bitnami/bitnami-docker-mysql#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 MySQL. If false, only a
  ## master deployment would be created
  enabled: true
  ##
  ## MySQL replication user
  ## ref: https://github.com/bitnami/bitnami-docker-mysql#setting-up-a-replication-cluster
  ## Note that this user should be different from the MySQL user (db.user)
  ##
  user: replicator
  ## MySQL replication user password
  ## ref: https://github.com/bitnami/bitnami-docker-mysql#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
  ## updateStrategy for MySQL Master StatefulSet
  ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
  updateStrategy:
    type: RollingUpdate
  ## 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
    mountPath: /bitnami/mysql
    ## Enable persistence using an existing PVC
    ##
    # existingClaim:
    ## 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]
    default_authentication_plugin=mysql_native_password
    skip-name-resolve
    explicit_defaults_for_timestamp
    basedir=/opt/bitnami/mysql
    port=3306
    socket=/opt/bitnami/mysql/tmp/mysql.sock
    tmpdir=/opt/bitnami/mysql/tmp
    max_allowed_packet=16M
    bind-address=0.0.0.0
    pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
    log-error=/opt/bitnami/mysql/logs/mysqld.log
    character-set-server=UTF8
    collation-server=utf8_general_ci

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

    [manager]
    port=3306
    socket=/opt/bitnami/mysql/tmp/mysql.sock
    pid-file=/opt/bitnami/mysql/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
    ## Initializing the database could take some time
    initialDelaySeconds: 30
    ##
    ## Default Kubernetes values
    periodSeconds: 10
    timeoutSeconds: 1
    successThreshold: 1
    failureThreshold: 3

slave:
  replicas: 1
  antiAffinity: soft
  ## updateStrategy for MySQL Slave StatefulSet
  ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
  updateStrategy:
    type: RollingUpdate
  persistence:
    ## If true, use a Persistent Volume Claim, If false, use emptyDir
    ##
    enabled: true
    mountPath: /bitnami/mysql
    # 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]
    default_authentication_plugin=mysql_native_password
    skip-name-resolve
    explicit_defaults_for_timestamp
    basedir=/opt/bitnami/mysql
    port=3306
    socket=/opt/bitnami/mysql/tmp/mysql.sock
    tmpdir=/opt/bitnami/mysql/tmp
    max_allowed_packet=16M
    bind-address=0.0.0.0
    pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
    log-error=/opt/bitnami/mysql/logs/mysqld.log
    character-set-server=UTF8
    collation-server=utf8_general_ci

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

    [manager]
    port=3306
    socket=/opt/bitnami/mysql/tmp/mysql.sock
    pid-file=/opt/bitnami/mysql/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
    ## Initializing the database could take some time
    initialDelaySeconds: 30
    ##
    ## 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
    ## 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:
    #   - myRegistryKeySecretName
  resources: {}
  annotations:
    prometheus.io/scrape: 'true'
    prometheus.io/port: '9104'

MySQL

MySQL is a fast, reliable, scalable, and easy to use open-source relational database system. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.

TL;DR

$ helm install bitnami/mysql

Introduction

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

Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of Bitnami Kubernetes Production Runtime (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.

Prerequisites

  • Kubernetes 1.10+
  • 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/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.

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 MySQL chart and their default values.

ParameterDescriptionDefault
global.imageRegistryGlobal Docker image registrynil
global.imagePullSecretsGlobal Docker registry secret names as an array[] (does not add image pull secrets to deployed pods)
image.registryMySQL image registrydocker.io
image.repositoryMySQL Image namebitnami/mysql
image.tagMySQL Image tag{VERSION}
image.pullPolicyMySQL image pull policyAlways if imageTag is latest, else IfNotPresent
image.pullSecretsSpecify docker-registry secret names as an array[] (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 create (should be different from replication.user)nil
db.passwordPassword for the new userrandom 10 character alphanumeric string if db.user is defined
db.nameName for new database to createmy_database
securityContext.enabledEnable security contexttrue
securityContext.fsGroupGroup ID for the container1001
securityContext.runAsUserUser ID for the container1001
replication.enabledMySQL replication enabledtrue
replication.userMySQL replication user (should be different from db.user)replicator
replication.passwordMySQL replication user passwordrandom 10 character alphanumeric string
master.antiAffinityMaster pod anti-affinity policysoft
master.updateStrategy.typeMaster statefulset update strategy policyRollingUpdate
master.persistence.enabledEnable persistence using a PersistentVolumeClaimtrue
master.persistence.existingClaimProvide an existing PersistentVolumeClaimnil
master.persistence.mountPathConfigure PersistentVolumeClaim mount path/bitnami/mysql
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 MySQL 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)30
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.updateStrategy.typeSlave statefulset update strategy policyRollingUpdate
slave.persistence.enabledEnable persistence using a PersistentVolumeClaimtrue
slave.persistence.mountPathConfigure PersistentVolumeClaim mount path/bitnami/mysql
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 MySQL 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)30
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/mysql. For more information please refer to the bitnami/mysql 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/mysql

The above command sets the MySQL root account password to secretpassword. Additionally it creates a database named app_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/mysql

Tip: You can use the default values.yaml

Initialize a fresh instance

The Bitnami MySQL image allows you to use your custom scripts to initialize a fresh instance. In order to execute the scripts, they must be located inside the chart folder files/docker-entrypoint-initdb.d so they can be consumed as a ConfigMap.

The allowed extensions are .sh, .sql and .sql.gz.

Persistence

The Bitnami MySQL image stores the MySQL data and configurations at the /bitnami/mysql 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.

Upgrading

It's necessary to set the root.password parameter when upgrading for readiness/liveness probes to work properly. When you install this chart for the first time, some notes will be displayed providing the credentials you must use under the 'Administrator credentials' section. Please note down the password and run the command below to upgrade your chart:

$ helm upgrade my-release bitnami/mysql --set root.password=[ROOT_PASSWORD]

| Note: you need to substitue the placeholder ROOT_PASSWORD with the value obtained in the installation notes.

To 3.0.0

Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments. Use the workaround below to upgrade from versions previous to 3.0.0. The following example assumes that the release name is mysql:

$ kubectl delete statefulset mysql-master --cascade=false
$ kubectl delete statefulset mysql-slave --cascade=false
4.5.1-0.1.0

5 years ago

4.5.0-0.1.0

5 years ago

4.4.1-0.1.0

5 years ago

4.4.0-0.1.0

5 years ago

4.3.0-0.1.0

5 years ago

4.2.6-0.1.0

5 years ago

4.2.5-0.1.0

5 years ago

4.2.4-0.1.0

5 years ago

4.2.3-0.1.0

5 years ago

4.2.2-0.1.0

5 years ago

4.2.1-0.1.0

5 years ago

4.2.0-0.1.0

5 years ago

4.1.2-0.1.0

5 years ago

4.1.1-0.1.0

5 years ago

4.1.0-0.1.0

5 years ago

4.0.6-0.1.0

5 years ago

4.0.5-0.1.0

5 years ago

4.0.4-0.1.0

5 years ago

4.0.3-0.1.0

5 years ago

4.0.2-0.1.0

5 years ago

4.0.1-0.1.0

5 years ago

4.0.0-0.1.0

5 years ago

3.0.2-0.1.0

5 years ago

3.0.1-0.1.0

5 years ago

3.0.0-0.1.0

5 years ago

2.1.2-0.1.0

5 years ago

2.1.1-0.1.0

5 years ago

2.1.0-0.1.0

5 years ago

2.0.2-0.1.0

5 years ago

2.0.1-0.1.0

5 years ago

2.0.0-0.1.0

5 years ago

1.1.3-0.1.0

5 years ago

1.1.2-0.1.0

5 years ago

1.1.1-0.1.0

5 years ago

1.1.0-0.1.0

5 years ago

1.0.0-0.1.0

5 years ago

0.1.14-0.1.0

5 years ago

0.1.13-0.1.0

5 years ago

0.1.12-0.1.0

5 years ago

0.1.11-0.1.0

5 years ago