2 # Copyright © 2018 Amdocs, Bell Canada
3 # Modifications Copyright © 2020 AT&T Intellectual Property
4 # Modifications Copyright (C) 2022 Nordix Foundation.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
22 name: {{ include "common.fullname" . }}-galera-init
23 namespace: {{ include "common.namespace" . }}
25 app: {{ include "common.name" . }}-galera-init
26 release: {{ include "common.release" . }}
31 app: {{ include "common.name" . }}-galera-init
32 release: {{ include "common.release" . }}
33 name: {{ include "common.name" . }}-galera-init
35 sidecar.istio.io/inject: "false"
38 - name: "{{ include "common.namespace" . }}-docker-registry-key"
40 - name: {{ include "common.name" . }}-mariadb-readiness
41 image: {{ include "repositoryGenerator.image.readiness" . }}
42 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46 - {{ index .Values "mariadb-galera" "service" "name" }}
52 fieldPath: metadata.namespace
54 - name: {{ include "common.name" . }}-galera-config
55 image: {{ include "repositoryGenerator.image.mariadb" . }}
56 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
58 - mountPath: /dbcmd-config/db.sh
59 name: {{ include "common.fullname" . }}-config
67 - name: MYSQL_ROOT_PASSWORD
68 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 10 }}
70 value: "{{ index .Values "mariadb-galera" "service" "name" }}"
72 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
74 value: "{{ index .Values "mariadb-galera" "service" "internalPort" }}"
75 resources: {{ include "common.resources" . | nindent 10 }}
77 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
79 - name: {{ include "common.fullname" . }}-config
81 name: {{ include "common.fullname" . }}-db-configmap
87 {{ if .Values.global.postgres.localCluster }}
92 name: {{ include "common.fullname" . }}-pg-init
93 namespace: {{ include "common.namespace" . }}
95 app: {{ include "common.name" . }}-pg-init
96 release: {{ include "common.release" . }}
101 app: {{ include "common.name" . }}-pg-init
102 release: {{ include "common.release" . }}
103 name: {{ include "common.name" . }}-pg-init
105 sidecar.istio.io/inject: "false"
108 - name: "{{ include "common.namespace" . }}-docker-registry-key"
109 initContainers: {{ if .Values.global.postgres.localCluster }}{{ include "common.readinessCheck.waitFor" . | nindent 6 }}{{ end }}
111 - name: {{ include "common.name" . }}-pg-config
112 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.postgresImage }}
113 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
115 - mountPath: /docker-entrypoint-initdb.d/db-pg.sh
116 name: {{ include "common.fullname" . }}-config
122 /docker-entrypoint-initdb.d/db-pg.sh
124 - name: PG_ADMIN_PASSWORD
125 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-root-pass" "key" "password") | indent 12 }}
127 value: "{{ .Values.postgres.service.name2 }}"
129 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 12 }}
130 - name: PG_USER_PASSWORD
131 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 12 }}
133 value: "{{ .Values.postgres.service.internalPort }}"
134 resources: {{ include "common.resources" . | nindent 10 }}
136 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
138 - name: {{ include "common.fullname" . }}-config
140 name: {{ include "common.fullname" . }}-db-configmap
151 name: {{ include "common.fullname" . }}-galera-config
152 namespace: {{ include "common.namespace" . }}
154 app: {{ include "common.name" . }}-galera-config
155 release: {{ include "common.release" . }}
160 app: {{ include "common.name" . }}-galera-config
161 release: {{ include "common.release" . }}
162 name: {{ include "common.name" . }}-galera-config
164 sidecar.istio.io/inject: "false"
167 - name: "{{ include "common.namespace" . }}-docker-registry-key"
169 - name: {{ include "common.name" . }}-init-readiness
170 image: {{ include "repositoryGenerator.image.readiness" . }}
171 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
176 - {{ include "common.fullname" . }}-galera-init
182 fieldPath: metadata.namespace
184 - name: {{ include "common.name" . }}-galera-db-migrator
185 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.dbmigrator.image }}
186 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
188 - mountPath: /dbcmd-config/db_migrator_policy_init.sh
189 name: {{ include "common.fullname" . }}-config
190 subPath: db_migrator_policy_init.sh
195 /dbcmd-config/db_migrator_policy_init.sh
198 value: "{{ index .Values "mariadb-galera" "service" "name" }}"
200 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
202 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
204 value: {{ .Values.dbmigrator.schema }}
206 value: {{ .Values.dbmigrator.policy_home }}
207 - name: SCRIPT_DIRECTORY
209 resources: {{ include "common.resources" . | nindent 10 }}
211 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
213 - name: {{ include "common.fullname" . }}-config
215 name: {{ include "common.fullname" . }}-db-configmap
218 - key: db_migrator_policy_init.sh
219 path: db_migrator_policy_init.sh
221 {{ if .Values.global.postgres.localCluster }}
226 name: {{ include "common.fullname" . }}-pg-config
227 namespace: {{ include "common.namespace" . }}
229 app: {{ include "common.name" . }}-pg-config
230 release: {{ include "common.release" . }}
235 app: {{ include "common.name" . }}-pg-config
236 release: {{ include "common.release" . }}
237 name: {{ include "common.name" . }}-pg-config
239 sidecar.istio.io/inject: "false"
242 - name: "{{ include "common.namespace" . }}-docker-registry-key"
244 - name: {{ include "common.name" . }}-init-readiness
245 image: {{ include "repositoryGenerator.image.readiness" . }}
246 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
251 - {{ include "common.fullname" . }}-pg-init
257 fieldPath: metadata.namespace
259 - name: {{ include "common.name" . }}-pg-db-migrator
260 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.dbmigrator.image }}
261 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
263 - mountPath: /dbcmd-config/db_migrator_pg_policy_init.sh
264 name: {{ include "common.fullname" . }}-config
265 subPath: db_migrator_pg_policy_init.sh
270 /dbcmd-config/db_migrator_pg_policy_init.sh
273 value: "{{ .Values.postgres.service.name2 }}"
275 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }}
277 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
279 value: {{ .Values.dbmigrator.schema }}
281 value: {{ .Values.dbmigrator.policy_home }}
282 - name: SCRIPT_DIRECTORY
285 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
286 resources: {{ include "common.resources" . | nindent 10 }}
288 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
290 - name: {{ include "common.fullname" . }}-config
292 name: {{ include "common.fullname" . }}-db-configmap
295 - key: db_migrator_pg_policy_init.sh
296 path: db_migrator_pg_policy_init.sh