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.dockerHubRepository" . }}/{{ .Values.mariadb.image }}
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" }}"
76 {{ include "common.resources" . }}
77 {{- if (include "common.onServiceMesh" .) }}
78 - name: policy-service-mesh-wait-for-job-container
79 image: nexus3.onap.org:10001/onap/oom/readiness:4.1.0
80 imagePullPolicy: Always
85 - echo "waiting 10s for istio side cars to be up"; sleep 10s;
86 /app/ready.py --service-mesh-check {{ include "common.name" . }}-galera-config -t 45;
92 fieldPath: metadata.namespace
95 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
97 - name: {{ include "common.fullname" . }}-config
99 name: {{ include "common.fullname" . }}-db-configmap
105 {{ if .Values.global.postgres.localCluster }}
110 name: {{ include "common.fullname" . }}-pg-init
111 namespace: {{ include "common.namespace" . }}
113 app: {{ include "common.name" . }}-pg-init
114 release: {{ include "common.release" . }}
119 app: {{ include "common.name" . }}-pg-init
120 release: {{ include "common.release" . }}
121 name: {{ include "common.name" . }}-pg-init
124 - name: "{{ include "common.namespace" . }}-docker-registry-key"
125 initContainers: {{ if .Values.global.postgres.localCluster }}{{ include "common.readinessCheck.waitFor" . | nindent 6 }}{{ end }}
127 - name: {{ include "common.name" . }}-pg-config
128 image: {{ .Values.repository }}/{{ .Values.postgresImage }}
129 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
131 - mountPath: /docker-entrypoint-initdb.d/db-pg.sh
132 name: {{ include "common.fullname" . }}-config
138 {{- if include "common.onServiceMesh" . }}
139 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
140 /docker-entrypoint-initdb.d/db-pg.sh
142 - name: PG_ADMIN_PASSWORD
143 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-root-pass" "key" "password") | indent 12 }}
145 value: "{{ .Values.postgres.service.name2 }}"
147 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 12 }}
148 - name: PG_USER_PASSWORD
149 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 12 }}
151 value: "{{ .Values.postgres.service.internalPort }}"
153 {{ include "common.resources" . }}
154 {{- if (include "common.onServiceMesh" .) }}
155 - name: policy-service-mesh-wait-for-job-container
156 image: nexus3.onap.org:10001/onap/oom/readiness:4.1.0
157 imagePullPolicy: Always
162 - echo "waiting 10s for istio side cars to be up"; sleep 10s;
163 /app/ready.py --service-mesh-check {{ include "common.name" . }}-pg-config -t 45;
169 fieldPath: metadata.namespace
172 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
174 - name: {{ include "common.fullname" . }}-config
176 name: {{ include "common.fullname" . }}-db-configmap
187 name: {{ include "common.fullname" . }}-galera-config
188 namespace: {{ include "common.namespace" . }}
190 app: {{ include "common.name" . }}-galera-config
191 release: {{ include "common.release" . }}
196 app: {{ include "common.name" . }}-galera-config
197 release: {{ include "common.release" . }}
198 name: {{ include "common.name" . }}-galera-config
201 - name: "{{ include "common.namespace" . }}-docker-registry-key"
203 - name: {{ include "common.name" . }}-init-readiness
204 image: {{ include "repositoryGenerator.image.readiness" . }}
205 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
210 - {{ include "common.fullname" . }}-galera-init
216 fieldPath: metadata.namespace
218 - name: {{ include "common.name" . }}-galera-db-migrator
219 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.dbmigrator.image }}
220 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
222 - mountPath: /dbcmd-config/db_migrator_policy_init.sh
223 name: {{ include "common.fullname" . }}-config
224 subPath: db_migrator_policy_init.sh
229 {{- if include "common.onServiceMesh" . }}
230 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
231 /dbcmd-config/db_migrator_policy_init.sh
234 value: "{{ index .Values "mariadb-galera" "service" "name" }}"
236 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
238 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
240 value: {{ .Values.dbmigrator.schema }}
242 value: {{ .Values.dbmigrator.policy_home }}
243 - name: SCRIPT_DIRECTORY
246 {{ include "common.resources" . }}
247 {{- if (include "common.onServiceMesh" .) }}
248 - name: policy-service-mesh-wait-for-job-container
249 image: nexus3.onap.org:10001/onap/oom/readiness:4.1.0
250 imagePullPolicy: Always
255 - echo "waiting 10s for istio side cars to be up"; sleep 10s;
256 /app/ready.py --service-mesh-check {{ include "common.name" . }}-galera-db-migrator -t 45;
262 fieldPath: metadata.namespace
265 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
267 - name: {{ include "common.fullname" . }}-config
269 name: {{ include "common.fullname" . }}-db-configmap
272 - key: db_migrator_policy_init.sh
273 path: db_migrator_policy_init.sh
275 {{ if .Values.global.postgres.localCluster }}
280 name: {{ include "common.fullname" . }}-pg-config
281 namespace: {{ include "common.namespace" . }}
283 app: {{ include "common.name" . }}-pg-config
284 release: {{ include "common.release" . }}
289 app: {{ include "common.name" . }}-pg-config
290 release: {{ include "common.release" . }}
291 name: {{ include "common.name" . }}-pg-config
294 - name: "{{ include "common.namespace" . }}-docker-registry-key"
296 - name: {{ include "common.name" . }}-init-readiness
297 image: {{ include "repositoryGenerator.image.readiness" . }}
298 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
303 - {{ include "common.fullname" . }}-pg-init
309 fieldPath: metadata.namespace
311 - name: {{ include "common.name" . }}-pg-db-migrator
312 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.dbmigrator.image }}
313 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
315 - mountPath: /dbcmd-config/db_migrator_pg_policy_init.sh
316 name: {{ include "common.fullname" . }}-config
317 subPath: db_migrator_pg_policy_init.sh
322 {{- if include "common.onServiceMesh" . }}
323 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
324 /dbcmd-config/db_migrator_pg_policy_init.sh
327 value: "{{ .Values.postgres.service.name2 }}"
329 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }}
331 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
333 value: {{ .Values.dbmigrator.schema }}
335 value: {{ .Values.dbmigrator.policy_home }}
336 - name: SCRIPT_DIRECTORY
339 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
341 {{ include "common.resources" . }}
342 {{- if (include "common.onServiceMesh" .) }}
343 - name: policy-service-mesh-wait-for-job-container
344 image: nexus3.onap.org:10001/onap/oom/readiness:4.1.0
345 imagePullPolicy: Always
350 - echo "waiting 10s for istio side cars to be up"; sleep 10s;
351 /app/ready.py --service-mesh-check {{ include "common.name" . }}-pg-db-migrator -t 45;
357 fieldPath: metadata.namespace
360 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
362 - name: {{ include "common.fullname" . }}-config
364 name: {{ include "common.fullname" . }}-db-configmap
367 - key: db_migrator_pg_policy_init.sh
368 path: db_migrator_pg_policy_init.sh