diff options
Diffstat (limited to 'kubernetes/common/mariadb-init/templates')
-rw-r--r-- | kubernetes/common/mariadb-init/templates/_mariadb.tpl | 2 | ||||
-rw-r--r-- | kubernetes/common/mariadb-init/templates/job.yaml | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/kubernetes/common/mariadb-init/templates/_mariadb.tpl b/kubernetes/common/mariadb-init/templates/_mariadb.tpl index 4f111a5f40..fb3f7974b9 100644 --- a/kubernetes/common/mariadb-init/templates/_mariadb.tpl +++ b/kubernetes/common/mariadb-init/templates/_mariadb.tpl @@ -19,7 +19,7 @@ */}} {{- define "mariadbInit.mariadbClusterSecret" -}} {{- if (eq "default" .Values.global.mariadbGalera.userRootSecret) -}} - {{- printf "%s-mariadb-galera-%s" (include "common.release" .) .Values.global.mariadbGalera.nameOverride -}} + {{- printf "%s-mariadb-galera-%s-db-root-password" (include "common.release" .) .Values.global.mariadbGalera.nameOverride -}} {{- else -}} {{- .Values.global.mariadbGalera.userRootSecret -}} {{- end -}} diff --git a/kubernetes/common/mariadb-init/templates/job.yaml b/kubernetes/common/mariadb-init/templates/job.yaml index 679c10c9a3..f3ff9934ab 100644 --- a/kubernetes/common/mariadb-init/templates/job.yaml +++ b/kubernetes/common/mariadb-init/templates/job.yaml @@ -1,4 +1,5 @@ # Copyright © 2019 Orange +# Copyright © 2020 Samsung Electronics # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -63,13 +64,17 @@ spec: secretKeyRef: name: {{ include "mariadbInit.mariadbClusterSecret" . }} key: {{ .Values.global.mariadbGalera.userRootSecretKey }} - - name: MYSQL_PASSWORD + - name: {{ printf "MYSQL_USER_%s" .Values.config.mysqlDatabase | upper }} + value: "{{ .Values.config.userName }}" + - name: {{ printf "MYSQL_PASSWORD_%s" .Values.config.mysqlDatabase | upper }} valueFrom: secretKeyRef: name: {{ template "common.fullname" . }} key: db-user-password {{- $root := . }} -{{ range $db, $_value := .Values.config.mysqlAdditionalDatabases }} +{{ range $db, $dbInfos := .Values.config.mysqlAdditionalDatabases }} + - name: {{ printf "MYSQL_USER_%s" $db | upper }} + value: {{ $dbInfos.user }} - name: {{ printf "MYSQL_PASSWORD_%s" $db | upper }} valueFrom: secretKeyRef: |