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.
19 {{ if not .Values.global.postgres.localCluster }}
23 name: {{ include "common.fullname" . }}-galera-init
24 namespace: {{ include "common.namespace" . }}
26 app: {{ include "common.name" . }}-galera-init
27 release: {{ include "common.release" . }}
32 app: {{ include "common.name" . }}-galera-init
33 release: {{ include "common.release" . }}
34 name: {{ include "common.name" . }}-galera-init
37 - name: "{{ include "common.namespace" . }}-docker-registry-key"
39 - name: {{ include "common.name" . }}-mariadb-readiness
40 image: {{ include "repositoryGenerator.image.readiness" . }}
41 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
45 - {{ index .Values "mariadb-galera" "service" "name" }}
51 fieldPath: metadata.namespace
60 - name: {{ include "common.name" . }}-galera-config
61 image: {{ include "repositoryGenerator.image.mariadb" . }}
62 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
64 - mountPath: /dbcmd-config/db.sh
65 name: {{ include "common.fullname" . }}-config
71 {{- if include "common.onServiceMesh" . }}
72 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
75 - name: MYSQL_ROOT_PASSWORD
76 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 10 }}
78 value: "{{ index .Values "mariadb-galera" "service" "name" }}"
80 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
82 value: "{{ index .Values "mariadb-galera" "service" "internalPort" }}"
83 resources: {{ include "common.resources" . | nindent 10 }}
84 {{- if (include "common.onServiceMesh" .) }}
85 - name: policy-service-mesh-wait-for-job-container
86 image: {{ include "repositoryGenerator.image.quitQuit" . }}
87 imagePullPolicy: Always
92 - echo "waiting 10s for istio side cars to be up"; sleep 10s;
93 /app/ready.py --service-mesh-check {{ include "common.name" . }}-galera-config -t 45;
99 fieldPath: metadata.namespace
102 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
104 - name: {{ include "common.fullname" . }}-config
106 name: {{ include "common.fullname" . }}-db-configmap
113 {{ if .Values.global.postgres.localCluster }}
118 name: {{ include "common.fullname" . }}-pg-init
119 namespace: {{ include "common.namespace" . }}
121 app: {{ include "common.name" . }}-pg-init
122 release: {{ include "common.release" . }}
127 app: {{ include "common.name" . }}-pg-init
128 release: {{ include "common.release" . }}
129 name: {{ include "common.name" . }}-pg-init
132 - name: "{{ include "common.namespace" . }}-docker-registry-key"
133 initContainers: {{ if .Values.global.postgres.localCluster }}{{ include "common.readinessCheck.waitFor" . | nindent 6 }}{{ end }}
135 - name: {{ include "common.name" . }}-pg-config
136 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.postgresImage }}
137 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
139 - mountPath: /docker-entrypoint-initdb.d/db-pg.sh
140 name: {{ include "common.fullname" . }}-config
146 {{- if include "common.onServiceMesh" . }}
147 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
148 /docker-entrypoint-initdb.d/db-pg.sh
150 - name: PG_ADMIN_PASSWORD
151 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
153 value: "{{ .Values.postgres.service.name2 }}"
155 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
156 - name: PG_USER_PASSWORD
157 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
159 value: "{{ .Values.postgres.service.internalPort }}"
160 resources: {{ include "common.resources" . | nindent 10 }}
161 {{- if (include "common.onServiceMesh" .) }}
162 - name: policy-service-mesh-wait-for-job-container
163 image: {{ include "repositoryGenerator.image.quitQuit" . }}
164 imagePullPolicy: Always
169 - echo "waiting 10s for istio side cars to be up"; sleep 10s;
170 /app/ready.py --service-mesh-check {{ include "common.name" . }}-pg-config -t 45;
176 fieldPath: metadata.namespace
179 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
181 - name: {{ include "common.fullname" . }}-config
183 name: {{ include "common.fullname" . }}-db-configmap
191 {{ if not .Values.global.postgres.localCluster }}
195 name: {{ include "common.fullname" . }}-galera-config
196 namespace: {{ include "common.namespace" . }}
198 app: {{ include "common.name" . }}-galera-config
199 release: {{ include "common.release" . }}
204 app: {{ include "common.name" . }}-galera-config
205 release: {{ include "common.release" . }}
206 name: {{ include "common.name" . }}-galera-config
209 - name: "{{ include "common.namespace" . }}-docker-registry-key"
211 - name: {{ include "common.name" . }}-init-readiness
212 image: {{ include "repositoryGenerator.image.readiness" . }}
213 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
218 - {{ include "common.fullname" . }}-galera-init
224 fieldPath: metadata.namespace
233 - name: {{ include "common.name" . }}-galera-db-migrator
234 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.dbmigrator.image }}
235 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
237 - mountPath: /dbcmd-config/db_migrator_policy_init.sh
238 name: {{ include "common.fullname" . }}-config
239 subPath: db_migrator_policy_init.sh
244 {{- if include "common.onServiceMesh" . }}
245 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
246 /dbcmd-config/db_migrator_policy_init.sh
249 value: "{{ index .Values "mariadb-galera" "service" "name" }}"
251 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
253 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
255 value: {{ .Values.dbmigrator.schema }}
257 value: {{ .Values.dbmigrator.policy_home }}
258 - name: SCRIPT_DIRECTORY
260 resources: {{ include "common.resources" . | nindent 10 }}
261 {{- if (include "common.onServiceMesh" .) }}
262 - name: policy-service-mesh-wait-for-job-container
263 image: {{ include "repositoryGenerator.image.quitQuit" . }}
264 imagePullPolicy: Always
269 - echo "waiting 10s for istio side cars to be up"; sleep 10s;
270 /app/ready.py --service-mesh-check {{ include "common.name" . }}-galera-db-migrator -t 45;
276 fieldPath: metadata.namespace
279 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
281 - name: {{ include "common.fullname" . }}-config
283 name: {{ include "common.fullname" . }}-db-configmap
286 - key: db_migrator_policy_init.sh
287 path: db_migrator_policy_init.sh
289 {{ if .Values.global.postgres.localCluster }}
294 name: {{ include "common.fullname" . }}-pg-config
295 namespace: {{ include "common.namespace" . }}
297 app: {{ include "common.name" . }}-pg-config
298 release: {{ include "common.release" . }}
303 app: {{ include "common.name" . }}-pg-config
304 release: {{ include "common.release" . }}
305 name: {{ include "common.name" . }}-pg-config
308 - name: "{{ include "common.namespace" . }}-docker-registry-key"
310 - name: {{ include "common.name" . }}-init-readiness
311 image: {{ include "repositoryGenerator.image.readiness" . }}
312 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
317 - {{ include "common.fullname" . }}-pg-init
323 fieldPath: metadata.namespace
332 - name: {{ include "common.name" . }}-pg-db-migrator
333 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.dbmigrator.image }}
334 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
336 - mountPath: /dbcmd-config/db_migrator_pg_policy_init.sh
337 name: {{ include "common.fullname" . }}-config
338 subPath: db_migrator_pg_policy_init.sh
343 {{- if include "common.onServiceMesh" . }}
344 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
345 /dbcmd-config/db_migrator_pg_policy_init.sh
348 value: "{{ .Values.postgres.service.name2 }}"
350 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
352 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
354 value: {{ .Values.dbmigrator.schema }}
356 value: {{ .Values.dbmigrator.policy_home }}
357 - name: SCRIPT_DIRECTORY
360 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
361 resources: {{ include "common.resources" . | nindent 10 }}
362 {{- if (include "common.onServiceMesh" .) }}
363 - name: policy-service-mesh-wait-for-job-container
364 image: {{ include "repositoryGenerator.image.quitQuit" . }}
365 imagePullPolicy: Always
370 - echo "waiting 10s for istio side cars to be up"; sleep 10s;
371 /app/ready.py --service-mesh-check {{ include "common.name" . }}-pg-db-migrator -t 45;
377 fieldPath: metadata.namespace
380 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
382 - name: {{ include "common.fullname" . }}-config
384 name: {{ include "common.fullname" . }}-db-configmap
387 - key: db_migrator_pg_policy_init.sh
388 path: db_migrator_pg_policy_init.sh