1 # Copyright © 2018 Amdocs, Bell Canada
2 # Copyright © 2019 Samsung Electronics
3 # Copyright © 2020 Bitnami, Orange
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
18 #################################################################
20 #################################################################
22 - uid: '{{ include "common.mariadb.secret.rootPassUID" . }}'
24 externalSecret: '{{ tpl (default "" .Values.rootUser.externalSecret) . }}'
25 password: '{{ .Values.rootUser.password }}'
26 - uid: '{{ include "common.mariadb.secret.userCredentialsUID" . }}'
28 externalSecret: '{{ tpl (default "" .Values.db.externalSecret) . }}'
29 login: '{{ .Values.db.user }}'
30 password: '{{ .Values.db.password }}'
31 - uid: '{{ include "common.mariadb.secret.backupCredentialsUID" . }}'
33 externalSecret: '{{ tpl (default "" .Values.galera.mariabackup.externalSecret) . }}'
34 login: '{{ .Values.galera.mariabackup.user }}'
35 password: '{{ .Values.galera.mariabackup.password }}'
37 # bitnami image doesn't support well single quote in password
38 passwordStrengthOverride: basic
40 #################################################################
41 # Global configuration defaults.
42 #################################################################
46 mountPath: /dockerdata-nfs
48 mountPath: /dockerdata-nfs/backup
49 clusterDomain: cluster.local
52 image: bitnami/mariadb-galera:10.5.8
53 ## Specify a imagePullPolicy
54 ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
55 ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
59 ## Set to true if you would like to see extra information on logs
60 ## It turns BASH debugging in minideb-extras-base
64 ## Sometimes, especially when a lot of pods are created at the same time,
65 ## actions performed on the databases are tried to be done before actual start.
68 ## String to partially override common.names.fullname template (will maintain the release name)
70 nameOverride: mariadb-galera
72 ## Use an alternate scheduler, e.g. "stork".
73 ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
77 ## StatefulSet controller supports relax its ordering guarantees while preserving its uniqueness and identity guarantees. There are two valid pod management policies: OrderedReady and Parallel
78 ## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#pod-management-policy
80 podManagementPolicy: OrderedReady
82 ## MariaDB Gallera K8s svc properties
85 ## Kubernetes service type and port number
101 ## Pods Service Account
102 ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
105 nameOverride: mariadb-galera
109 ## Pod Security Context
110 ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
117 ## Database credentials for root (admin) user
120 ## MariaDB admin user
122 ## MariaDB admin password
123 ## Password is ignored if externalSecret is specified.
124 ## If not set, password will be "randomly" generated
125 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#setting-the-root-password-on-first-run
130 ## Custom db configuration
133 ## MariaDB username and password
134 ## Password is ignored if externalSecret is specified.
135 ## If not set, password will be "randomly" generated
136 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-user-on-first-run
141 ## Database to create
142 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-on-first-run
146 ## Galera configuration
149 ## Galera cluster name
153 ## Bootstraping options
154 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#bootstraping
156 ## Node to bootstrap from, you will need to change this parameter incase you want to bootstrap from other node
159 ## Force safe_to_bootstrap in grastate.date file.
160 ## This will set safe_to_bootstrap=1 in the node indicated by bootstrapFromNode.
161 forceSafeToBootstrap: false
163 ## Credentials to perform backups
166 ## MariaBackup username and password
167 ## Password is ignored if externalSecret is specified.
168 ## If not set, password will be "randomly" generated
169 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#setting-up-a-multi-master-cluster
180 ## If true, use a Persistent Volume Claim, If false, use emptyDir
183 # Enable persistence using an existing PVC
185 ## selector can be used to match an existing PersistentVolume
190 ## Persistent Volume Storage Class
191 ## If defined, storageClassName: <storageClass>
192 ## If set to "-", storageClassName: "", which disables dynamic provisioning
193 ## If undefined (the default) or set to null, no storageClassName spec is
194 ## set, choosing the default provisioner. (gp2 on AWS, standard on
195 ## GKE, AWS & OpenStack)
198 ## Persistent Volume Claim annotations
201 ## Persistent Volume Access Mode
203 accessMode: ReadWriteOnce
204 ## Persistent Volume size
211 - '{{ include "common.name" . }}'
219 ## Name of the secret that contains the certificates
221 # certificatesSecret:
222 ## Certificate filename
225 ## Certificate Key filename
228 ## CA Certificate filename
232 ## Configure MariaDB with a custom my.cnf file
233 ## ref: https://mysql.com/kb/en/mysql/configuring-mysql-with-mycnf/#example-of-configuration-file
234 ## Alternatively, you can put your my.cnf under the files/ directory
236 mariadbConfiguration: |-
239 socket=/opt/bitnami/mariadb/tmp/mysql.sock
240 plugin_dir=/opt/bitnami/mariadb/plugin
243 lower_case_table_names = 1
244 default_storage_engine=InnoDB
245 basedir=/opt/bitnami/mariadb
246 datadir=/bitnami/mariadb/data
247 plugin_dir=/opt/bitnami/mariadb/plugin
248 tmpdir=/opt/bitnami/mariadb/tmp
249 socket=/opt/bitnami/mariadb/tmp/mysql.sock
250 pid_file=/opt/bitnami/mariadb/tmp/mysqld.pid
254 collation_server=utf8_unicode_ci
255 init_connect='SET NAMES utf8'
256 character_set_server=utf8
260 myisam_recover_options=FORCE,BACKUP
265 max_allowed_packet=16M
266 max_connect_errors=1000000
267 sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY
273 # Disabling for performance per http://severalnines.com/blog/9-tips-going-production-galera-cluster-mysql
275 # Required for Galera
280 max_heap_table_size=32M
281 # Re-enabling as now works with Maria 10.1.2
284 query_cache_size=256M
287 open_files_limit=65535
288 table_definition_cache=4096
289 table_open_cache=4096
294 # Mandatory per https://github.com/codership/documentation/issues/25
295 innodb_autoinc_lock_mode=2
296 # Per https://www.percona.com/blog/2006/08/04/innodb-double-write/
298 innodb_flush_method=O_DIRECT
299 innodb_log_files_in_group=2
300 innodb_log_file_size=128M
301 innodb_flush_log_at_trx_commit=1
302 innodb_file_per_table=1
303 # 80% Memory is default reco.
304 # Need to re-evaluate when DB size grows
305 innodb_buffer_pool_size=2G
306 innodb_file_format=Barracuda
309 log_error=/opt/bitnami/mariadb/logs/mysqld.log
310 slow_query_log_file=/opt/bitnami/mariadb/logs/mysqld.log
311 log_queries_not_using_indexes=1
315 ## Use extraVolumes and extraVolumeMounts to mount /certs filesystem
316 # ssl_ca=/certs/ca.pem
317 # ssl_cert=/certs/server-cert.pem
318 # ssl_key=/certs/server-key.pem
322 wsrep_provider=/opt/bitnami/mariadb/lib/libgalera_smm.so
323 wsrep_sst_method=mariabackup
324 wsrep_slave_threads=4
325 wsrep_cluster_address=gcomm://
326 wsrep_cluster_name=galera
327 wsrep_sst_auth="root:"
328 # Enabled for performance per https://mariadb.com/kb/en/innodb-system-variables/#innodb_flush_log_at_trx_commit
329 innodb_flush_log_at_trx_commit=2
330 # MYISAM REPLICATION SUPPORT #
331 wsrep_replicate_myisam=ON
334 plugin_load_add=auth_pam
336 ## Data-at-Rest Encryption
337 ## Use extraVolumes and extraVolumeMounts to mount /encryption filesystem
338 # plugin_load_add=file_key_management
339 # file_key_management_filename=/encryption/keyfile.enc
340 # file_key_management_filekey=FILE:/encryption/keyfile.key
341 # file_key_management_encryption_algorithm=AES_CTR
343 # encrypt_tmp_files=ON
345 ## InnoDB/XtraDB Encryption
346 # innodb_encrypt_tables=ON
347 # innodb_encrypt_temporary_tables=ON
348 # innodb_encrypt_log=ON
349 # innodb_encryption_threads=4
350 # innodb_encryption_rotate_key_age=1
353 # aria_encrypt_tables=ON
354 # encrypt_tmp_disk_tables=ON
356 ## MariaDB additional command line flags
357 ## Can be used to specify command line flags, for example:
359 ## extraFlags: "--max-connect-errors=1000 --max_connections=155"
361 ## Desired number of cluster nodes
365 ## updateStrategy for MariaDB Master StatefulSet
366 ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
371 ## Additional pod annotations for MariaDB Galera pods
372 ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
376 ## Pod affinity preset
377 ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
378 ## Allowed values: soft, hard
380 podAffinityPreset: ""
382 ## Pod anti-affinity preset
383 ## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
384 ## Allowed values: soft, hard
386 podAntiAffinityPreset: soft
388 ## Node affinity preset
389 ## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
390 ## Allowed values: soft, hard
393 ## Node affinity type
394 ## Allowed values: soft, hard
396 ## Node label key to match
398 ## key: "kubernetes.io/e2e-az-name"
401 ## Node label values to match
409 ## Affinity for pod assignment. Evaluated as a template.
410 ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
411 ## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
415 ## Node labels for pod assignment. Evaluated as a template.
416 ## ref: https://kubernetes.io/docs/user-guide/node-selection/
420 ## Tolerations for pod assignment. Evaluated as a template.
421 ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
425 ## Enable persistence using Persistent Volume Claims
426 ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
429 ## If true, use a Persistent Volume Claim, If false, use emptyDir
432 # Enable persistence using an existing PVC
434 mountPath: /dockerdata-nfs
435 mountSubPath: "mariadb-galera/data"
436 ## selector can be used to match an existing PersistentVolume
441 ## Persistent Volume Storage Class
442 ## If defined, storageClassName: <storageClass>
443 ## If set to "-", storageClassName: "", which disables dynamic provisioning
444 ## If undefined (the default) or set to null, no storageClassName spec is
445 ## set, choosing the default provisioner. (gp2 on AWS, standard on
446 ## GKE, AWS & OpenStack)
449 ## Persistent Volume Claim annotations
452 ## Persistent Volume Access Mode
454 accessMode: ReadWriteOnce
455 ## Persistent Volume size
459 ## Additional pod labels
462 # extraLabel: extraValue
464 ## Priority Class Name
466 # priorityClassName: 'priorityClass'
468 ## MariaDB Galera containers' resource requests and limits
469 ## ref: http://kubernetes.io/docs/user-guide/compute-resources/
489 ## MariaDB Galera containers' liveness and readiness probes
490 ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
494 ## Initializing the database could take some time
496 initialDelaySeconds: 150
503 initialDelaySeconds: 60
509 ## Pod disruption budget configuration
512 ## Specifies whether a Pod disruption budget should be created
518 ## Prometheus exporter configuration
521 ## Bitnami MySQL Prometheus exporter image
522 ## ref: https://hub.docker.com/r/bitnami/mysqld-exporter/tags/
524 image: bitnami/mysqld-exporter:0.12.1-debian-10-r264
526 ## MySQL exporter additional command line flags
527 ## Can be used to specify command line flags
530 ## - --collect.binlog_size
533 ## MySQL Prometheus exporter containers' resource requests and limits
534 ## ref: http://kubernetes.io/docs/user-guide/compute-resources/
537 # We usually recommend not to specify default resources and to leave this as a conscious
538 # choice for the user. This also increases chances charts run on environments with little
539 # resources, such as Minikube. If you do want to specify resources, uncomment the following
540 # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
547 ## MySQL Prometheus exporter service parameters
553 prometheus.io/scrape: "true"
554 prometheus.io/port: "9104"
556 ## Prometheus Operator ServiceMonitor configuration
560 ## Namespace in which Prometheus is running
562 # namespace: monitoring
564 ## Interval at which metrics should be scraped.
565 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
569 ## Timeout after which the scrape is ended
570 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
574 ## ServiceMonitor selector labels
575 ## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
578 prometheus: kube-prometheus
580 ## RelabelConfigs to apply to samples before scraping
581 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
582 ## Value is evalued as a template
586 ## MetricRelabelConfigs to apply to samples before ingestion
587 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
588 ## Value is evalued as a template
590 metricRelabelings: []
593 # targetLabel: "__name__"
596 # replacement: 'example_prefix_$1'
598 ## Prometheus Operator PrometheusRule configuration
603 ## Additional labels to add to the PrometheusRule so it is picked up by the operator.
604 ## If using the [Helm Chart](https://github.com/helm/charts/tree/master/stable/prometheus-operator) this is the name of the Helm release and 'app: prometheus-operator'
606 app: prometheus-operator
611 # - alert: MariaDB-Down
613 # message: 'MariaDB instance {{ $labels.instance }} is down'
614 # summary: MariaDB instance is down
615 # expr: absent(up{job="mariadb-galera"} == 1)
618 # service: mariadb-galera