1 # Copyright © 2018 Amdocs
2 # Copyright © 2018,2021 Bell Canada
3 # Copyright © 2019 Samsung Electronics
4 # Copyright © 2020 Bitnami, Orange
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 #################################################################
19 # Global configuration defaults.
20 #################################################################
24 mountPath: /dockerdata-nfs
26 mountPath: /dockerdata-nfs/backup
27 clusterDomain: cluster.local
30 # flag to enable the DB creation via mariadb-operator
32 # if useOperator set to "true", set "enableServiceAccount to "false"
33 # as the SA is created by the Operator
34 enableServiceAccount: false
35 nameOverride: mariadb-galera
36 service: mariadb-galera
38 #################################################################
40 #################################################################
42 - uid: '{{ include "common.mariadb.secret.rootPassUID" . }}'
44 externalSecret: '{{ tpl (default "" .Values.rootUser.externalSecret) . }}'
45 password: '{{ .Values.rootUser.password }}'
46 - uid: '{{ include "common.mariadb.secret.userCredentialsUID" . }}'
48 externalSecret: '{{ tpl (default "" .Values.db.externalSecret) . }}'
49 login: '{{ .Values.db.user }}'
50 password: '{{ .Values.db.password }}'
51 - uid: '{{ include "common.mariadb.secret.backupCredentialsUID" . }}'
53 externalSecret: '{{ tpl (default "" .Values.galera.mariabackup.externalSecret) . }}'
54 login: '{{ .Values.galera.mariabackup.user }}'
55 password: '{{ .Values.galera.mariabackup.password }}'
62 agentImage: mariadb-operator/agent
64 initImage: mariadb-operator/init
67 ## String to partially override common.names.fullname template (will maintain the release name)
69 nameOverride: mariadb-galera
71 ## Custom db configuration
74 ## MariaDB username and password
75 ## Password is ignored if externalSecret is specified.
76 ## If not set, password will be "randomly" generated
77 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-user-on-first-run
83 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-on-first-run
87 ## Desired number of cluster nodes
91 ## Additional pod annotations for MariaDB Galera pods
92 ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
93 ## -> here required to enable mariadb-galera in istio
96 # sidecar.istio.io/inject: "false"
97 traffic.sidecar.istio.io/excludeInboundPorts: "4444,4567,4568"
98 traffic.sidecar.istio.io/includeInboundPorts: '*'
99 traffic.sidecar.istio.io/excludeOutboundPorts: "4444,4567,4568"
101 mariadbOpConfiguration: |-
103 max_allowed_packet=256M
104 lower_case_table_names = 1
107 collation_server=utf8_unicode_ci
108 init_connect='SET NAMES utf8'
109 character_set_server=utf8
113 myisam_recover_options=FORCE,BACKUP
118 max_allowed_packet=16M
119 max_connect_errors=1000000
120 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
125 max_heap_table_size=32M
126 # Re-enabling as now works with Maria 10.1.2
129 query_cache_size=256M
132 open_files_limit=65535
133 table_definition_cache=4096
134 table_open_cache=4096
139 # Mandatory per https://github.com/codership/documentation/issues/25
140 innodb_autoinc_lock_mode=2
141 # Per https://www.percona.com/blog/2006/08/04/innodb-double-write/
143 innodb_flush_method=O_DIRECT
144 innodb_log_files_in_group=2
145 innodb_log_file_size=128M
146 innodb_flush_log_at_trx_commit=1
147 innodb_file_per_table=1
148 # 80% Memory is default reco.
149 # Need to re-evaluate when DB size grows
150 innodb_buffer_pool_size=2G
151 innodb_file_format=Barracuda
153 ##########################################################################################
154 # !!! the following configuration entries are ignored, when mariadbOperator is enabled !!!
155 ##########################################################################################
156 # bitnami image doesn't support well single quote in password
157 passwordStrengthOverride: basic
159 image: bitnami/mariadb-galera:10.5.8
160 ## Specify a imagePullPolicy
161 ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
162 ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
166 ## Set to true if you would like to see extra information on logs
167 ## It turns BASH debugging in minideb-extras-base
171 ## Sometimes, especially when a lot of pods are created at the same time,
172 ## actions performed on the databases are tried to be done before actual start.
175 ## Use an alternate scheduler, e.g. "stork".
176 ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
180 ## StatefulSet controller supports relax its ordering guarantees while preserving its uniqueness and identity guarantees. There are two valid pod management policies: OrderedReady and Parallel
181 ## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#pod-management-policy
183 podManagementPolicy: OrderedReady
185 ## MariaDB Gallera K8s svc properties
188 ## Kubernetes service type and port number
192 internalPort: &dbPort 3306
205 ## Pods Service Account
206 ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
209 nameOverride: mariadb-galera
213 ## Pod Security Context
214 ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
221 ## Database credentials for root (admin) user
224 ## MariaDB admin user
226 ## MariaDB admin password
227 ## Password is ignored if externalSecret is specified.
228 ## If not set, password will be "randomly" generated
229 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#setting-the-root-password-on-first-run
234 ## Galera configuration
237 ## Galera cluster name
241 ## Bootstraping options
242 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#bootstraping
244 ## Node to bootstrap from, you will need to change this parameter incase you want to bootstrap from other node
247 ## Force safe_to_bootstrap in grastate.date file.
248 ## This will set safe_to_bootstrap=1 in the node indicated by bootstrapFromNode.
249 forceSafeToBootstrap: false
251 ## Credentials to perform backups
254 ## MariaBackup username and password
255 ## Password is ignored if externalSecret is specified.
256 ## If not set, password will be "randomly" generated
257 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#setting-up-a-multi-master-cluster
263 ## The backup job will mount the mariadb data pvc in order to run mariabackup.
264 ## For this reason the db data pvc needs to have accessMode: ReadWriteMany.
270 ## If true, use a Persistent Volume Claim, If false, use emptyDir
273 # Enable persistence using an existing PVC
275 ## selector can be used to match an existing PersistentVolume
280 ## Persistent Volume Storage Class
281 ## If defined, storageClassName: <storageClass>
282 ## If set to "-", storageClassName: "", which disables dynamic provisioning
283 ## If undefined (the default) or set to null, no storageClassName spec is
284 ## set, choosing the default provisioner. (gp2 on AWS, standard on
285 ## GKE, AWS & OpenStack)
288 ## Persistent Volume Claim annotations
291 ## Persistent Volume Access Mode
293 accessMode: ReadWriteOnce
294 ## Persistent Volume size
302 - '{{ include "common.name" . }}'
310 ## Name of the secret that contains the certificates
312 # certificatesSecret:
313 ## Certificate filename
316 ## Certificate Key filename
319 ## CA Certificate filename
323 ## Configure MariaDB with a custom my.cnf file
324 ## ref: https://mysql.com/kb/en/mysql/configuring-mysql-with-mycnf/#example-of-configuration-file
325 ## Alternatively, you can put your my.cnf under the files/ directory
327 mariadbConfiguration: |-
330 socket=/opt/bitnami/mariadb/tmp/mysql.sock
331 plugin_dir=/opt/bitnami/mariadb/plugin
334 lower_case_table_names = 1
335 default_storage_engine=InnoDB
336 basedir=/opt/bitnami/mariadb
337 datadir=/bitnami/mariadb/data
338 plugin_dir=/opt/bitnami/mariadb/plugin
339 tmpdir=/opt/bitnami/mariadb/tmp
340 socket=/opt/bitnami/mariadb/tmp/mysql.sock
341 pid_file=/opt/bitnami/mariadb/tmp/mysqld.pid
345 collation_server=utf8_unicode_ci
346 init_connect='SET NAMES utf8'
347 character_set_server=utf8
351 myisam_recover_options=FORCE,BACKUP
356 max_allowed_packet=16M
357 max_connect_errors=1000000
358 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
364 # Disabling for performance per http://severalnines.com/blog/9-tips-going-production-galera-cluster-mysql
366 # Required for Galera
371 max_heap_table_size=32M
372 # Re-enabling as now works with Maria 10.1.2
375 query_cache_size=256M
378 open_files_limit=65535
379 table_definition_cache=4096
380 table_open_cache=4096
385 # Mandatory per https://github.com/codership/documentation/issues/25
386 innodb_autoinc_lock_mode=2
387 # Per https://www.percona.com/blog/2006/08/04/innodb-double-write/
389 innodb_flush_method=O_DIRECT
390 innodb_log_files_in_group=2
391 innodb_log_file_size=128M
392 innodb_flush_log_at_trx_commit=1
393 innodb_file_per_table=1
394 # 80% Memory is default reco.
395 # Need to re-evaluate when DB size grows
396 innodb_buffer_pool_size=2G
397 innodb_file_format=Barracuda
400 log_error=/opt/bitnami/mariadb/logs/mysqld.log
401 slow_query_log_file=/opt/bitnami/mariadb/logs/mysqld.log
402 log_queries_not_using_indexes=1
406 ## Use extraVolumes and extraVolumeMounts to mount /certs filesystem
407 # ssl_ca=/certs/ca.pem
408 # ssl_cert=/certs/server-cert.pem
409 # ssl_key=/certs/server-key.pem
413 wsrep_provider=/opt/bitnami/mariadb/lib/libgalera_smm.so
414 wsrep_sst_method=mariabackup
415 wsrep_slave_threads=4
416 wsrep_cluster_address=gcomm://
417 wsrep_cluster_name=galera
418 wsrep_sst_auth="root:"
419 # Enabled for performance per https://mariadb.com/kb/en/innodb-system-variables/#innodb_flush_log_at_trx_commit
420 innodb_flush_log_at_trx_commit=2
421 # MYISAM REPLICATION SUPPORT #
422 wsrep_replicate_myisam=ON
424 default_storage_engine=InnoDB
425 innodb_autoinc_lock_mode=2
426 transaction-isolation=READ-COMMITTED
431 plugin_load_add=auth_pam
433 ## Data-at-Rest Encryption
434 ## Use extraVolumes and extraVolumeMounts to mount /encryption filesystem
435 # plugin_load_add=file_key_management
436 # file_key_management_filename=/encryption/keyfile.enc
437 # file_key_management_filekey=FILE:/encryption/keyfile.key
438 # file_key_management_encryption_algorithm=AES_CTR
440 # encrypt_tmp_files=ON
442 ## InnoDB/XtraDB Encryption
443 # innodb_encrypt_tables=ON
444 # innodb_encrypt_temporary_tables=ON
445 # innodb_encrypt_log=ON
446 # innodb_encryption_threads=4
447 # innodb_encryption_rotate_key_age=1
450 # aria_encrypt_tables=ON
451 # encrypt_tmp_disk_tables=ON
453 ## MariaDB additional command line flags
454 ## Can be used to specify command line flags, for example:
456 ## extraFlags: "--max-connect-errors=1000 --max_connections=155"
458 ## updateStrategy for MariaDB Master StatefulSet
459 ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
464 ## Pod affinity preset
465 ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
466 ## Allowed values: soft, hard
468 podAffinityPreset: ""
470 ## Pod anti-affinity preset
471 ## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
472 ## Allowed values: soft, hard
474 podAntiAffinityPreset: soft
476 ## Node affinity preset
477 ## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
478 ## Allowed values: soft, hard
481 ## Node affinity type
482 ## Allowed values: soft, hard
484 ## Node label key to match
486 ## key: "kubernetes.io/e2e-az-name"
489 ## Node label values to match
497 ## Affinity for pod assignment. Evaluated as a template.
498 ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
499 ## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
503 ## Node labels for pod assignment. Evaluated as a template.
504 ## ref: https://kubernetes.io/docs/user-guide/node-selection/
508 ## Tolerations for pod assignment. Evaluated as a template.
509 ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
513 ## Enable persistence using Persistent Volume Claims
514 ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
517 ## If true, use a Persistent Volume Claim, If false, use emptyDir
520 # Enable persistence using an existing PVC
522 mountPath: /dockerdata-nfs
523 mountSubPath: "mariadb-galera/data"
524 ## selector can be used to match an existing PersistentVolume
529 ## Persistent Volume Storage Class
530 ## If defined, storageClassName: <storageClass>
531 ## If set to "-", storageClassName: "", which disables dynamic provisioning
532 ## If undefined (the default) or set to null, no storageClassName spec is
533 ## set, choosing the default provisioner. (gp2 on AWS, standard on
534 ## GKE, AWS & OpenStack)
537 ## Persistent Volume Claim annotations
540 ## Persistent Volume Access Mode
541 ## Use ReadWriteMany if backup is enabled, see backup section.
543 accessMode: ReadWriteOnce
544 ## Persistent Volume size
548 ## Additional pod labels
551 # extraLabel: extraValue
553 ## Priority Class Name
555 # priorityClassName: 'priorityClass'
557 ## MariaDB Galera containers' resource requests and limits
558 ## ref: http://kubernetes.io/docs/user-guide/compute-resources/
578 ## MariaDB Galera containers' liveness and readiness probes
579 ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
583 initialDelaySeconds: 1
590 initialDelaySeconds: 1
596 ## Initializing the database could take some time
599 initialDelaySeconds: 10
603 # will wait up for initialDelaySeconds + failureThreshold*periodSeconds before
604 # stating startup wasn't good (910s per default)
607 ## Pod disruption budget configuration
610 ## Specifies whether a Pod disruption budget should be created
616 ## Prometheus exporter configuration
619 ## Bitnami MySQL Prometheus exporter image
620 ## ref: https://hub.docker.com/r/bitnami/mysqld-exporter/tags/
622 image: bitnami/mysqld-exporter:0.12.1-debian-10-r264
624 ## MySQL exporter additional command line flags
625 ## Can be used to specify command line flags
628 ## - --collect.binlog_size
631 ## MySQL Prometheus exporter containers' resource requests and limits
632 ## ref: http://kubernetes.io/docs/user-guide/compute-resources/
635 # We usually recommend not to specify default resources and to leave this as a conscious
636 # choice for the user. This also increases chances charts run on environments with little
637 # resources, such as Minikube. If you do want to specify resources, uncomment the following
638 # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
645 ## MariaDB Galera metrics container's liveness and readiness probes
646 ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
650 initialDelaySeconds: 30
657 initialDelaySeconds: 5
662 ## MySQL Prometheus exporter service parameters
668 prometheus.io/scrape: "true"
669 prometheus.io/port: "9104"
671 ## Prometheus Operator ServiceMonitor configuration
675 ## Namespace in which Prometheus is running
677 # namespace: monitoring
679 ## Interval at which metrics should be scraped.
680 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
684 ## Timeout after which the scrape is ended
685 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
689 ## ServiceMonitor selector labels
690 ## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
693 # prometheus: kube-prometheus
695 ## RelabelConfigs to apply to samples before scraping
696 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
697 ## Value is evalued as a template
701 ## MetricRelabelConfigs to apply to samples before ingestion
702 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
703 ## Value is evalued as a template
705 metricRelabelings: []
708 # targetLabel: "__name__"
711 # replacement: 'example_prefix_$1'
713 ## Prometheus Operator PrometheusRule configuration
718 ## Additional labels to add to the PrometheusRule so it is picked up by the operator.
719 ## 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'
721 app: prometheus-operator
726 # - alert: MariaDB-Down
728 # message: 'MariaDB instance {{ $labels.instance }} is down'
729 # summary: MariaDB instance is down
730 # expr: absent(up{job="mariadb-galera"} == 1)
733 # service: mariadb-galera