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
36 - name: "{{ include "common.namespace" . }}-docker-registry-key"
38 - name: {{ include "common.name" . }}-mariadb-readiness
39 image: {{ include "repositoryGenerator.image.readiness" . }}
40 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
44 - {{ index .Values "mariadb-galera" "service" "name" }}
50 fieldPath: metadata.namespace
52 - name: {{ include "common.name" . }}-galera-config
53 image: {{ include "repositoryGenerator.image.mariadb" . }}
54 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
56 - mountPath: /dbcmd-config/db.sh
57 name: {{ include "common.fullname" . }}-config
63 {{- if include "common.onServiceMesh" . }}
64 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
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 }}
76 {{- if (include "common.onServiceMesh" .) }}
77 - name: policy-service-mesh-wait-for-job-container
78 image: {{ include "repositoryGenerator.image.quitQuit" . }}
79 imagePullPolicy: Always
84 - echo "waiting 10s for istio side cars to be up"; sleep 10s;
85 /app/ready.py --service-mesh-check {{ include "common.name" . }}-galera-config -t 45;
91 fieldPath: metadata.namespace
94 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
96 - name: {{ include "common.fullname" . }}-config
98 name: {{ include "common.fullname" . }}-db-configmap
104 {{ if .Values.global.postgres.localCluster }}
109 name: {{ include "common.fullname" . }}-pg-init
110 namespace: {{ include "common.namespace" . }}
112 app: {{ include "common.name" . }}-pg-init
113 release: {{ include "common.release" . }}
118 app: {{ include "common.name" . }}-pg-init
119 release: {{ include "common.release" . }}
120 name: {{ include "common.name" . }}-pg-init
123 - name: "{{ include "common.namespace" . }}-docker-registry-key"
124 initContainers: {{ if .Values.global.postgres.localCluster }}{{ include "common.readinessCheck.waitFor" . | nindent 6 }}{{ end }}
126 - name: {{ include "common.name" . }}-pg-config
127 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.postgresImage }}
128 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
130 - mountPath: /docker-entrypoint-initdb.d/db-pg.sh
131 name: {{ include "common.fullname" . }}-config
137 {{- if include "common.onServiceMesh" . }}
138 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
139 /docker-entrypoint-initdb.d/db-pg.sh
141 - name: PG_ADMIN_PASSWORD
142 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-root-pass" "key" "password") | indent 12 }}
144 value: "{{ .Values.postgres.service.name2 }}"
146 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 12 }}
147 - name: PG_USER_PASSWORD
148 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 12 }}
150 value: "{{ .Values.postgres.service.internalPort }}"
151 resources: {{ include "common.resources" . | nindent 10 }}
152 {{- if (include "common.onServiceMesh" .) }}
153 - name: policy-service-mesh-wait-for-job-container
154 image: {{ include "repositoryGenerator.image.quitQuit" . }}
155 imagePullPolicy: Always
160 - echo "waiting 10s for istio side cars to be up"; sleep 10s;
161 /app/ready.py --service-mesh-check {{ include "common.name" . }}-pg-config -t 45;
167 fieldPath: metadata.namespace
170 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
172 - name: {{ include "common.fullname" . }}-config
174 name: {{ include "common.fullname" . }}-db-configmap
185 name: {{ include "common.fullname" . }}-galera-config
186 namespace: {{ include "common.namespace" . }}
188 app: {{ include "common.name" . }}-galera-config
189 release: {{ include "common.release" . }}
194 app: {{ include "common.name" . }}-galera-config
195 release: {{ include "common.release" . }}
196 name: {{ include "common.name" . }}-galera-config
199 - name: "{{ include "common.namespace" . }}-docker-registry-key"
201 - name: {{ include "common.name" . }}-init-readiness
202 image: {{ include "repositoryGenerator.image.readiness" . }}
203 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
208 - {{ include "common.fullname" . }}-galera-init
214 fieldPath: metadata.namespace
216 - name: {{ include "common.name" . }}-galera-db-migrator
217 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.dbmigrator.image }}
218 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
220 - mountPath: /dbcmd-config/db_migrator_policy_init.sh
221 name: {{ include "common.fullname" . }}-config
222 subPath: db_migrator_policy_init.sh
227 {{- if include "common.onServiceMesh" . }}
228 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
229 /dbcmd-config/db_migrator_policy_init.sh
232 value: "{{ index .Values "mariadb-galera" "service" "name" }}"
234 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
236 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
238 value: {{ .Values.dbmigrator.schema }}
240 value: {{ .Values.dbmigrator.policy_home }}
241 - name: SCRIPT_DIRECTORY
243 resources: {{ include "common.resources" . | nindent 10 }}
244 {{- if (include "common.onServiceMesh" .) }}
245 - name: policy-service-mesh-wait-for-job-container
246 image: {{ include "repositoryGenerator.image.quitQuit" . }}
247 imagePullPolicy: Always
252 - echo "waiting 10s for istio side cars to be up"; sleep 10s;
253 /app/ready.py --service-mesh-check {{ include "common.name" . }}-galera-db-migrator -t 45;
259 fieldPath: metadata.namespace
262 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
264 - name: {{ include "common.fullname" . }}-config
266 name: {{ include "common.fullname" . }}-db-configmap
269 - key: db_migrator_policy_init.sh
270 path: db_migrator_policy_init.sh
272 {{ if .Values.global.postgres.localCluster }}
277 name: {{ include "common.fullname" . }}-pg-config
278 namespace: {{ include "common.namespace" . }}
280 app: {{ include "common.name" . }}-pg-config
281 release: {{ include "common.release" . }}
286 app: {{ include "common.name" . }}-pg-config
287 release: {{ include "common.release" . }}
288 name: {{ include "common.name" . }}-pg-config
291 - name: "{{ include "common.namespace" . }}-docker-registry-key"
293 - name: {{ include "common.name" . }}-init-readiness
294 image: {{ include "repositoryGenerator.image.readiness" . }}
295 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
300 - {{ include "common.fullname" . }}-pg-init
306 fieldPath: metadata.namespace
308 - name: {{ include "common.name" . }}-pg-db-migrator
309 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.dbmigrator.image }}
310 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
312 - mountPath: /dbcmd-config/db_migrator_pg_policy_init.sh
313 name: {{ include "common.fullname" . }}-config
314 subPath: db_migrator_pg_policy_init.sh
319 {{- if include "common.onServiceMesh" . }}
320 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
321 /dbcmd-config/db_migrator_pg_policy_init.sh
324 value: "{{ .Values.postgres.service.name2 }}"
326 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }}
328 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
330 value: {{ .Values.dbmigrator.schema }}
332 value: {{ .Values.dbmigrator.policy_home }}
333 - name: SCRIPT_DIRECTORY
336 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
337 resources: {{ include "common.resources" . | nindent 10 }}
338 {{- if (include "common.onServiceMesh" .) }}
339 - name: policy-service-mesh-wait-for-job-container
340 image: {{ include "repositoryGenerator.image.quitQuit" . }}
341 imagePullPolicy: Always
346 - echo "waiting 10s for istio side cars to be up"; sleep 10s;
347 /app/ready.py --service-mesh-check {{ include "common.name" . }}-pg-db-migrator -t 45;
353 fieldPath: metadata.namespace
356 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
358 - name: {{ include "common.fullname" . }}-config
360 name: {{ include "common.fullname" . }}-db-configmap
363 - key: db_migrator_pg_policy_init.sh
364 path: db_migrator_pg_policy_init.sh