summaryrefslogtreecommitdiffstats
path: root/kubernetes/common/mariadb-init/templates/job.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/common/mariadb-init/templates/job.yaml')
-rw-r--r--kubernetes/common/mariadb-init/templates/job.yaml25
1 files changed, 8 insertions, 17 deletions
diff --git a/kubernetes/common/mariadb-init/templates/job.yaml b/kubernetes/common/mariadb-init/templates/job.yaml
index f3ff9934ab..5202d572a2 100644
--- a/kubernetes/common/mariadb-init/templates/job.yaml
+++ b/kubernetes/common/mariadb-init/templates/job.yaml
@@ -21,7 +21,7 @@ metadata:
labels:
app: {{ include "common.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
spec:
backoffLimit: 20
@@ -29,7 +29,7 @@ spec:
metadata:
labels:
app: {{ include "common.name" . }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
name: {{ include "common.name" . }}
spec:
initContainers:
@@ -60,26 +60,17 @@ spec:
- name: DB_PORT
value: "{{ .Values.global.mariadbGalera.servicePort }}"
- name: MYSQL_ROOT_PASSWORD
- valueFrom:
- secretKeyRef:
- name: {{ include "mariadbInit.mariadbClusterSecret" . }}
- key: {{ .Values.global.mariadbGalera.userRootSecretKey }}
+ {{- include "common.secret.envFromSecret" (dict "global" . "uid" "root-password" "key" (default "password" .Values.global.mariadbGalera.userRootSecretKey)) | indent 10 }}
- name: {{ printf "MYSQL_USER_%s" .Values.config.mysqlDatabase | upper }}
- value: "{{ .Values.config.userName }}"
+ {{- include "common.secret.envFromSecret" (dict "global" . "uid" .Values.config.mysqlDatabase "key" "login") | indent 10 }}
- name: {{ printf "MYSQL_PASSWORD_%s" .Values.config.mysqlDatabase | upper }}
- valueFrom:
- secretKeyRef:
- name: {{ template "common.fullname" . }}
- key: db-user-password
+ {{- include "common.secret.envFromSecret" (dict "global" . "uid" .Values.config.mysqlDatabase "key" "password") | indent 10 }}
{{- $root := . }}
-{{ range $db, $dbInfos := .Values.config.mysqlAdditionalDatabases }}
+{{ range $db, $_values := .Values.config.mysqlAdditionalDatabases }}
- name: {{ printf "MYSQL_USER_%s" $db | upper }}
- value: {{ $dbInfos.user }}
+ {{- include "common.secret.envFromSecret" (dict "global" $root "uid" $db "key" "login") | indent 10 }}
- name: {{ printf "MYSQL_PASSWORD_%s" $db | upper }}
- valueFrom:
- secretKeyRef:
- name: {{ template "common.fullname" $root }}-secret
- key: {{ printf "db-%s-user-password" $db }}
+ {{- include "common.secret.envFromSecret" (dict "global" $root "uid" $db "key" "password") | indent 10 }}
{{ end }}
volumeMounts:
- mountPath: /etc/localtime