2 # Copyright © 2019 Orange
3 # Copyright © 2020 Samsung Electronics
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 {{ include "mariadbInit._updateSecrets" . -}}
23 name: {{ include "common.fullname" . }}-config-job
24 namespace: {{ include "common.namespace" . }}
26 app: {{ include "common.name" . }}
27 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
28 release: {{ include "common.release" . }}
29 heritage: {{ .Release.Service }}
35 app: {{ include "common.name" . }}
36 release: {{ include "common.release" . }}
37 name: {{ include "common.name" . }}
40 - name: {{ include "common.name" . }}-readiness
45 - {{ default .Values.global.mariadbGalera.nameOverride .Values.mariadbGalera.containerName }}
51 fieldPath: metadata.namespace
52 image: {{ include "repositoryGenerator.image.readiness" . }}
53 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
62 - name: {{ include "common.name" . }}
63 image: {{ include "repositoryGenerator.image.mariadb" . }}
64 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
69 {{- if include "common.onServiceMesh" . }}
70 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
71 /db_init/db_init.sh {{ if or .Values.dbScriptConfigMap .Values.dbScript }} &&
72 /db_config/db_cmd.sh{{ end }}
75 value: {{ include "common.mariadbService" . }}
77 value: {{ include "common.mariadbPort" . | quote }}
78 - name: MYSQL_ROOT_PASSWORD
79 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "root-password" "key" (default "password" .Values.global.mariadbGalera.userRootSecretKey)) | indent 10 }}
80 - name: {{ printf "MYSQL_USER_%s" .Values.config.mysqlDatabase | upper }}
81 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" .Values.config.mysqlDatabase "key" "login") | indent 10 }}
82 - name: {{ printf "MYSQL_PASSWORD_%s" .Values.config.mysqlDatabase | upper }}
83 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" .Values.config.mysqlDatabase "key" "password") | indent 10 }}
85 {{ range $db, $_values := .Values.config.mysqlAdditionalDatabases }}
86 - name: {{ printf "MYSQL_USER_%s" $db | upper }}
87 {{- include "common.secret.envFromSecretFast" (dict "global" $root "uid" $db "key" "login") | indent 10 }}
88 - name: {{ printf "MYSQL_PASSWORD_%s" $db | upper }}
89 {{- include "common.secret.envFromSecretFast" (dict "global" $root "uid" $db "key" "password") | indent 10 }}
92 - mountPath: /etc/localtime
97 {{- if or .Values.dbScriptConfigMap .Values.dbScript }}
99 mountPath: /db_config/
101 resources: {{ include "common.resources" . | nindent 10 }}
102 {{ include "common.waitForJobContainer" . | indent 6 | trim }}
103 {{- if .Values.nodeSelector }}
105 {{ toYaml .Values.nodeSelector | indent 10 }}
107 {{- if .Values.affinity }}
109 {{ toYaml .Values.affinity | indent 10 }}
111 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
116 {{- if or .Values.dbScriptConfigMap .Values.dbScript }}
119 {{- if .Values.dbScriptConfigMap }}
120 name: {{ tpl .Values.dbScriptConfigMap . }}
122 name: {{ include "common.fullname" . }}-dbscript
128 name: {{ include "mariadbInit.configMap" . }}
132 - name: "{{ include "common.namespace" . }}-docker-registry-key"