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
89 internalPort: &dbPort 3306
102 ## Pods Service Account
103 ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
106 nameOverride: mariadb-galera
110 ## Pod Security Context
111 ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
118 ## Database credentials for root (admin) user
121 ## MariaDB admin user
123 ## MariaDB admin password
124 ## Password is ignored if externalSecret is specified.
125 ## If not set, password will be "randomly" generated
126 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#setting-the-root-password-on-first-run
131 ## Custom db configuration
134 ## MariaDB username and password
135 ## Password is ignored if externalSecret is specified.
136 ## If not set, password will be "randomly" generated
137 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-user-on-first-run
142 ## Database to create
143 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-on-first-run
147 ## Galera configuration
150 ## Galera cluster name
154 ## Bootstraping options
155 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#bootstraping
157 ## Node to bootstrap from, you will need to change this parameter incase you want to bootstrap from other node
160 ## Force safe_to_bootstrap in grastate.date file.
161 ## This will set safe_to_bootstrap=1 in the node indicated by bootstrapFromNode.
162 forceSafeToBootstrap: false
164 ## Credentials to perform backups
167 ## MariaBackup username and password
168 ## Password is ignored if externalSecret is specified.
169 ## If not set, password will be "randomly" generated
170 ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#setting-up-a-multi-master-cluster
181 ## If true, use a Persistent Volume Claim, If false, use emptyDir
184 # Enable persistence using an existing PVC
186 ## selector can be used to match an existing PersistentVolume
191 ## Persistent Volume Storage Class
192 ## If defined, storageClassName: <storageClass>
193 ## If set to "-", storageClassName: "", which disables dynamic provisioning
194 ## If undefined (the default) or set to null, no storageClassName spec is
195 ## set, choosing the default provisioner. (gp2 on AWS, standard on
196 ## GKE, AWS & OpenStack)
199 ## Persistent Volume Claim annotations
202 ## Persistent Volume Access Mode
204 accessMode: ReadWriteOnce
205 ## Persistent Volume size
212 - '{{ include "common.name" . }}'
220 ## Name of the secret that contains the certificates
222 # certificatesSecret:
223 ## Certificate filename
226 ## Certificate Key filename
229 ## CA Certificate filename
233 ## Configure MariaDB with a custom my.cnf file
234 ## ref: https://mysql.com/kb/en/mysql/configuring-mysql-with-mycnf/#example-of-configuration-file
235 ## Alternatively, you can put your my.cnf under the files/ directory
237 mariadbConfiguration: |-
240 socket=/opt/bitnami/mariadb/tmp/mysql.sock
241 plugin_dir=/opt/bitnami/mariadb/plugin
244 lower_case_table_names = 1
245 default_storage_engine=InnoDB
246 basedir=/opt/bitnami/mariadb
247 datadir=/bitnami/mariadb/data
248 plugin_dir=/opt/bitnami/mariadb/plugin
249 tmpdir=/opt/bitnami/mariadb/tmp
250 socket=/opt/bitnami/mariadb/tmp/mysql.sock
251 pid_file=/opt/bitnami/mariadb/tmp/mysqld.pid
255 collation_server=utf8_unicode_ci
256 init_connect='SET NAMES utf8'
257 character_set_server=utf8
261 myisam_recover_options=FORCE,BACKUP
266 max_allowed_packet=16M
267 max_connect_errors=1000000
268 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
274 # Disabling for performance per http://severalnines.com/blog/9-tips-going-production-galera-cluster-mysql
276 # Required for Galera
281 max_heap_table_size=32M
282 # Re-enabling as now works with Maria 10.1.2
285 query_cache_size=256M
288 open_files_limit=65535
289 table_definition_cache=4096
290 table_open_cache=4096
295 # Mandatory per https://github.com/codership/documentation/issues/25
296 innodb_autoinc_lock_mode=2
297 # Per https://www.percona.com/blog/2006/08/04/innodb-double-write/
299 innodb_flush_method=O_DIRECT
300 innodb_log_files_in_group=2
301 innodb_log_file_size=128M
302 innodb_flush_log_at_trx_commit=1
303 innodb_file_per_table=1
304 # 80% Memory is default reco.
305 # Need to re-evaluate when DB size grows
306 innodb_buffer_pool_size=2G
307 innodb_file_format=Barracuda
310 log_error=/opt/bitnami/mariadb/logs/mysqld.log
311 slow_query_log_file=/opt/bitnami/mariadb/logs/mysqld.log
312 log_queries_not_using_indexes=1
316 ## Use extraVolumes and extraVolumeMounts to mount /certs filesystem
317 # ssl_ca=/certs/ca.pem
318 # ssl_cert=/certs/server-cert.pem
319 # ssl_key=/certs/server-key.pem
323 wsrep_provider=/opt/bitnami/mariadb/lib/libgalera_smm.so
324 wsrep_sst_method=mariabackup
325 wsrep_slave_threads=4
326 wsrep_cluster_address=gcomm://
327 wsrep_cluster_name=galera
328 wsrep_sst_auth="root:"
329 # Enabled for performance per https://mariadb.com/kb/en/innodb-system-variables/#innodb_flush_log_at_trx_commit
330 innodb_flush_log_at_trx_commit=2
331 # MYISAM REPLICATION SUPPORT #
332 wsrep_replicate_myisam=ON
334 default_storage_engine=InnoDB
335 innodb_autoinc_lock_mode=2
336 transaction-isolation=READ-COMMITTED
341 plugin_load_add=auth_pam
343 ## Data-at-Rest Encryption
344 ## Use extraVolumes and extraVolumeMounts to mount /encryption filesystem
345 # plugin_load_add=file_key_management
346 # file_key_management_filename=/encryption/keyfile.enc
347 # file_key_management_filekey=FILE:/encryption/keyfile.key
348 # file_key_management_encryption_algorithm=AES_CTR
350 # encrypt_tmp_files=ON
352 ## InnoDB/XtraDB Encryption
353 # innodb_encrypt_tables=ON
354 # innodb_encrypt_temporary_tables=ON
355 # innodb_encrypt_log=ON
356 # innodb_encryption_threads=4
357 # innodb_encryption_rotate_key_age=1
360 # aria_encrypt_tables=ON
361 # encrypt_tmp_disk_tables=ON
363 ## MariaDB additional command line flags
364 ## Can be used to specify command line flags, for example:
366 ## extraFlags: "--max-connect-errors=1000 --max_connections=155"
368 ## Desired number of cluster nodes
372 ## updateStrategy for MariaDB Master StatefulSet
373 ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
378 ## Additional pod annotations for MariaDB Galera pods
379 ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
383 ## Pod affinity preset
384 ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
385 ## Allowed values: soft, hard
387 podAffinityPreset: ""
389 ## Pod anti-affinity preset
390 ## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
391 ## Allowed values: soft, hard
393 podAntiAffinityPreset: soft
395 ## Node affinity preset
396 ## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
397 ## Allowed values: soft, hard
400 ## Node affinity type
401 ## Allowed values: soft, hard
403 ## Node label key to match
405 ## key: "kubernetes.io/e2e-az-name"
408 ## Node label values to match
416 ## Affinity for pod assignment. Evaluated as a template.
417 ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
418 ## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
422 ## Node labels for pod assignment. Evaluated as a template.
423 ## ref: https://kubernetes.io/docs/user-guide/node-selection/
427 ## Tolerations for pod assignment. Evaluated as a template.
428 ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
432 ## Enable persistence using Persistent Volume Claims
433 ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
436 ## If true, use a Persistent Volume Claim, If false, use emptyDir
439 # Enable persistence using an existing PVC
441 mountPath: /dockerdata-nfs
442 mountSubPath: "mariadb-galera/data"
443 ## selector can be used to match an existing PersistentVolume
448 ## Persistent Volume Storage Class
449 ## If defined, storageClassName: <storageClass>
450 ## If set to "-", storageClassName: "", which disables dynamic provisioning
451 ## If undefined (the default) or set to null, no storageClassName spec is
452 ## set, choosing the default provisioner. (gp2 on AWS, standard on
453 ## GKE, AWS & OpenStack)
456 ## Persistent Volume Claim annotations
459 ## Persistent Volume Access Mode
461 accessMode: ReadWriteOnce
462 ## Persistent Volume size
466 ## Additional pod labels
469 # extraLabel: extraValue
471 ## Priority Class Name
473 # priorityClassName: 'priorityClass'
475 ## MariaDB Galera containers' resource requests and limits
476 ## ref: http://kubernetes.io/docs/user-guide/compute-resources/
496 ## MariaDB Galera containers' liveness and readiness probes
497 ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
501 initialDelaySeconds: 1
508 initialDelaySeconds: 1
514 ## Initializing the database could take some time
517 initialDelaySeconds: 10
521 # will wait up for initialDelaySeconds + failureThreshold*periodSeconds before
522 # stating startup wasn't good (910s per default)
525 ## Pod disruption budget configuration
528 ## Specifies whether a Pod disruption budget should be created
534 ## Prometheus exporter configuration
537 ## Bitnami MySQL Prometheus exporter image
538 ## ref: https://hub.docker.com/r/bitnami/mysqld-exporter/tags/
540 image: bitnami/mysqld-exporter:0.12.1-debian-10-r264
542 ## MySQL exporter additional command line flags
543 ## Can be used to specify command line flags
546 ## - --collect.binlog_size
549 ## MySQL Prometheus exporter containers' resource requests and limits
550 ## ref: http://kubernetes.io/docs/user-guide/compute-resources/
553 # We usually recommend not to specify default resources and to leave this as a conscious
554 # choice for the user. This also increases chances charts run on environments with little
555 # resources, such as Minikube. If you do want to specify resources, uncomment the following
556 # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
563 ## MySQL Prometheus exporter service parameters
569 prometheus.io/scrape: "true"
570 prometheus.io/port: "9104"
572 ## Prometheus Operator ServiceMonitor configuration
576 ## Namespace in which Prometheus is running
578 # namespace: monitoring
580 ## Interval at which metrics should be scraped.
581 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
585 ## Timeout after which the scrape is ended
586 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
590 ## ServiceMonitor selector labels
591 ## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
594 prometheus: kube-prometheus
596 ## RelabelConfigs to apply to samples before scraping
597 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
598 ## Value is evalued as a template
602 ## MetricRelabelConfigs to apply to samples before ingestion
603 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
604 ## Value is evalued as a template
606 metricRelabelings: []
609 # targetLabel: "__name__"
612 # replacement: 'example_prefix_$1'
614 ## Prometheus Operator PrometheusRule configuration
619 ## Additional labels to add to the PrometheusRule so it is picked up by the operator.
620 ## 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'
622 app: prometheus-operator
627 # - alert: MariaDB-Down
629 # message: 'MariaDB instance {{ $labels.instance }} is down'
630 # summary: MariaDB instance is down
631 # expr: absent(up{job="mariadb-galera"} == 1)
634 # service: mariadb-galera