2 # Copyright © 2019 Orange
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
18 UID of mariadb root password
20 {{- define "common.mariadb.secret.rootPassUID" -}}
21 {{- printf "db-root-password" }}
25 Name of mariadb secret
27 {{- define "common.mariadb.secret._secretName" -}}
28 {{- $global := .dot }}
29 {{- $chartName := tpl .chartName $global -}}
30 {{- include "common.secret.genName" (dict "global" $global "uid" (include .uidTemplate $global) "chartName" $chartName) }}
34 Name of mariadb root password secret
36 {{- define "common.mariadb.secret.rootPassSecretName" -}}
37 {{- include "common.mariadb.secret._secretName" (set . "uidTemplate" "common.mariadb.secret.rootPassUID") }}
41 UID of mariadb user credentials
43 {{- define "common.mariadb.secret.userCredentialsUID" -}}
44 {{- printf "db-user-credentials" }}
48 UID of mariadb backup credentials
50 {{- define "common.mariadb.secret.backupCredentialsUID" -}}
51 {{- printf "db-backup-credentials" }}
55 Name of mariadb user credentials secret
57 {{- define "common.mariadb.secret.userCredentialsSecretName" -}}
58 {{- include "common.mariadb.secret._secretName" (set . "uidTemplate" "common.mariadb.secret.userCredentialsUID") }}
62 Choose the name of the mariadb service to use.
64 {{- define "common.mariadbService" -}}
65 {{- if .Values.global.mariadbGalera.localCluster -}}
66 {{- index .Values "mariadb-galera" "nameOverride" -}}
68 {{- .Values.global.mariadbGalera.service -}}
73 Choose the value of mariadb port to use.
75 {{- define "common.mariadbPort" -}}
76 {{- if .Values.global.mariadbGalera.localCluster -}}
77 {{- index .Values "mariadb-galera" "service" "internalPort" -}}
79 {{- .Values.global.mariadbGalera.internalPort -}}
84 Choose the value of secret to retrieve user value.
86 {{- define "common.mariadbSecret" -}}
87 {{- if .Values.global.mariadbGalera.localCluster -}}
88 {{ printf "%s-%s-db-user-credentials" (include "common.fullname" .) (index .Values "mariadb-galera" "nameOverride") -}}
90 {{ printf "%s-%s-%s" ( include "common.release" .) (index .Values "mariadb-init" "nameOverride") (index .Values "mariadb-init" "config" "mysqlDatabase" ) -}}
95 Choose the value of secret param to retrieve user value.
97 {{- define "common.mariadbSecretParam" -}}
98 {{ printf "password" -}}