Jakub Latusek | d71d26c | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 2 | # Copyright © 2018 Amdocs, Bell Canada |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 3 | # Modifications Copyright © 2020 AT&T Intellectual Property |
waynedunican | 368aced | 2022-02-15 08:27:57 +0000 | [diff] [blame] | 4 | # Modifications Copyright (C) 2022 Nordix Foundation. |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 5 | # |
| 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 |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 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. |
Jakub Latusek | d71d26c | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 17 | */}} |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 18 | |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 19 | {{ if not .Values.global.postgres.localCluster }} |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 20 | apiVersion: batch/v1 |
| 21 | kind: Job |
| 22 | metadata: |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 23 | name: {{ include "common.fullname" . }}-galera-init |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 24 | namespace: {{ include "common.namespace" . }} |
| 25 | labels: |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 26 | app: {{ include "common.name" . }}-galera-init |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 27 | release: {{ include "common.release" . }} |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 28 | spec: |
| 29 | template: |
| 30 | metadata: |
| 31 | labels: |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 32 | app: {{ include "common.name" . }}-galera-init |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 33 | release: {{ include "common.release" . }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 34 | name: {{ include "common.name" . }}-galera-init |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 35 | spec: |
andreas-geissler | 7d85f3f | 2021-07-19 17:53:22 +0200 | [diff] [blame] | 36 | imagePullSecrets: |
| 37 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 38 | initContainers: |
waynedunican | 368aced | 2022-02-15 08:27:57 +0000 | [diff] [blame] | 39 | - name: {{ include "common.name" . }}-mariadb-readiness |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 40 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 41 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 42 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 43 | - /app/ready.py |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 44 | - --container-name |
| 45 | - {{ index .Values "mariadb-galera" "service" "name" }} |
| 46 | env: |
| 47 | - name: NAMESPACE |
| 48 | valueFrom: |
| 49 | fieldRef: |
| 50 | apiVersion: v1 |
| 51 | fieldPath: metadata.namespace |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 52 | containers: |
| 53 | - name: {{ include "common.name" . }}-galera-config |
Andreas Geissler | a427599 | 2023-01-25 09:27:30 +0100 | [diff] [blame] | 54 | image: {{ include "repositoryGenerator.image.mariadb" . }} |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 55 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 56 | volumeMounts: |
| 57 | - mountPath: /dbcmd-config/db.sh |
| 58 | name: {{ include "common.fullname" . }}-config |
| 59 | subPath: db.sh |
| 60 | command: |
| 61 | - /bin/sh |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 62 | - -cx |
| 63 | - | |
Andreas Geissler | c50f089 | 2023-06-14 14:21:31 +0200 | [diff] [blame] | 64 | {{- if include "common.onServiceMesh" . }} |
| 65 | echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 66 | /dbcmd-config/db.sh |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 67 | env: |
| 68 | - name: MYSQL_ROOT_PASSWORD |
Krzysztof Opasiak | 98a79cc | 2020-04-01 22:33:58 +0200 | [diff] [blame] | 69 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 10 }} |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 70 | - name: MYSQL_HOST |
| 71 | value: "{{ index .Values "mariadb-galera" "service" "name" }}" |
| 72 | - name: MYSQL_USER |
Krzysztof Opasiak | 98a79cc | 2020-04-01 22:33:58 +0200 | [diff] [blame] | 73 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 74 | - name: MYSQL_PORT |
| 75 | value: "{{ index .Values "mariadb-galera" "service" "internalPort" }}" |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 76 | resources: {{ include "common.resources" . | nindent 10 }} |
Andreas Geissler | c50f089 | 2023-06-14 14:21:31 +0200 | [diff] [blame] | 77 | {{- if (include "common.onServiceMesh" .) }} |
| 78 | - name: policy-service-mesh-wait-for-job-container |
| 79 | image: {{ include "repositoryGenerator.image.quitQuit" . }} |
| 80 | imagePullPolicy: Always |
| 81 | command: |
| 82 | - /bin/sh |
| 83 | - "-c" |
| 84 | args: |
| 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; |
| 87 | env: |
| 88 | - name: NAMESPACE |
| 89 | valueFrom: |
| 90 | fieldRef: |
| 91 | apiVersion: v1 |
| 92 | fieldPath: metadata.namespace |
| 93 | {{- end }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 94 | restartPolicy: Never |
| 95 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
| 96 | volumes: |
| 97 | - name: {{ include "common.fullname" . }}-config |
| 98 | configMap: |
| 99 | name: {{ include "common.fullname" . }}-db-configmap |
| 100 | defaultMode: 0755 |
| 101 | items: |
| 102 | - key: db.sh |
| 103 | path: db.sh |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 104 | {{ end }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 105 | |
| 106 | {{ if .Values.global.postgres.localCluster }} |
| 107 | --- |
| 108 | apiVersion: batch/v1 |
| 109 | kind: Job |
| 110 | metadata: |
| 111 | name: {{ include "common.fullname" . }}-pg-init |
| 112 | namespace: {{ include "common.namespace" . }} |
| 113 | labels: |
| 114 | app: {{ include "common.name" . }}-pg-init |
| 115 | release: {{ include "common.release" . }} |
| 116 | spec: |
| 117 | template: |
| 118 | metadata: |
| 119 | labels: |
| 120 | app: {{ include "common.name" . }}-pg-init |
| 121 | release: {{ include "common.release" . }} |
| 122 | name: {{ include "common.name" . }}-pg-init |
| 123 | spec: |
| 124 | imagePullSecrets: |
| 125 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
| 126 | initContainers: {{ if .Values.global.postgres.localCluster }}{{ include "common.readinessCheck.waitFor" . | nindent 6 }}{{ end }} |
| 127 | containers: |
| 128 | - name: {{ include "common.name" . }}-pg-config |
Andreas Geissler | 6128f5f | 2023-01-25 09:18:56 +0100 | [diff] [blame] | 129 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.postgresImage }} |
waynedunican | 368aced | 2022-02-15 08:27:57 +0000 | [diff] [blame] | 130 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 131 | volumeMounts: |
| 132 | - mountPath: /docker-entrypoint-initdb.d/db-pg.sh |
| 133 | name: {{ include "common.fullname" . }}-config |
| 134 | subPath: db-pg.sh |
| 135 | command: |
| 136 | - /bin/sh |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 137 | - -cx |
| 138 | - | |
Andreas Geissler | c50f089 | 2023-06-14 14:21:31 +0200 | [diff] [blame] | 139 | {{- if include "common.onServiceMesh" . }} |
| 140 | echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 141 | /docker-entrypoint-initdb.d/db-pg.sh |
waynedunican | 368aced | 2022-02-15 08:27:57 +0000 | [diff] [blame] | 142 | env: |
| 143 | - name: PG_ADMIN_PASSWORD |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 144 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }} |
waynedunican | 368aced | 2022-02-15 08:27:57 +0000 | [diff] [blame] | 145 | - name: PG_HOST |
| 146 | value: "{{ .Values.postgres.service.name2 }}" |
| 147 | - name: PG_USER |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 148 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }} |
waynedunican | 368aced | 2022-02-15 08:27:57 +0000 | [diff] [blame] | 149 | - name: PG_USER_PASSWORD |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 150 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }} |
waynedunican | 368aced | 2022-02-15 08:27:57 +0000 | [diff] [blame] | 151 | - name: PG_PORT |
| 152 | value: "{{ .Values.postgres.service.internalPort }}" |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 153 | resources: {{ include "common.resources" . | nindent 10 }} |
Andreas Geissler | c50f089 | 2023-06-14 14:21:31 +0200 | [diff] [blame] | 154 | {{- if (include "common.onServiceMesh" .) }} |
| 155 | - name: policy-service-mesh-wait-for-job-container |
| 156 | image: {{ include "repositoryGenerator.image.quitQuit" . }} |
| 157 | imagePullPolicy: Always |
| 158 | command: |
| 159 | - /bin/sh |
| 160 | - "-c" |
| 161 | args: |
| 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; |
| 164 | env: |
| 165 | - name: NAMESPACE |
| 166 | valueFrom: |
| 167 | fieldRef: |
| 168 | apiVersion: v1 |
| 169 | fieldPath: metadata.namespace |
| 170 | {{- end }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 171 | restartPolicy: Never |
| 172 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
| 173 | volumes: |
| 174 | - name: {{ include "common.fullname" . }}-config |
| 175 | configMap: |
| 176 | name: {{ include "common.fullname" . }}-db-configmap |
| 177 | defaultMode: 0755 |
| 178 | items: |
| 179 | - key: db-pg.sh |
| 180 | path: db-pg.sh |
| 181 | {{ end }} |
| 182 | |
| 183 | --- |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 184 | {{ if not .Values.global.postgres.localCluster }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 185 | apiVersion: batch/v1 |
| 186 | kind: Job |
| 187 | metadata: |
| 188 | name: {{ include "common.fullname" . }}-galera-config |
| 189 | namespace: {{ include "common.namespace" . }} |
| 190 | labels: |
| 191 | app: {{ include "common.name" . }}-galera-config |
| 192 | release: {{ include "common.release" . }} |
| 193 | spec: |
| 194 | template: |
| 195 | metadata: |
| 196 | labels: |
| 197 | app: {{ include "common.name" . }}-galera-config |
| 198 | release: {{ include "common.release" . }} |
| 199 | name: {{ include "common.name" . }}-galera-config |
| 200 | spec: |
| 201 | imagePullSecrets: |
| 202 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
| 203 | initContainers: |
| 204 | - name: {{ include "common.name" . }}-init-readiness |
| 205 | image: {{ include "repositoryGenerator.image.readiness" . }} |
| 206 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 207 | command: |
| 208 | - /app/ready.py |
| 209 | args: |
| 210 | - --job-name |
| 211 | - {{ include "common.fullname" . }}-galera-init |
| 212 | env: |
| 213 | - name: NAMESPACE |
| 214 | valueFrom: |
| 215 | fieldRef: |
| 216 | apiVersion: v1 |
| 217 | fieldPath: metadata.namespace |
jhh | d74fe9f | 2021-04-15 11:04:39 -0500 | [diff] [blame] | 218 | containers: |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 219 | - name: {{ include "common.name" . }}-galera-db-migrator |
Andreas Geissler | 8d704ba | 2022-01-07 17:49:22 +0000 | [diff] [blame] | 220 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.dbmigrator.image }} |
jhh | d74fe9f | 2021-04-15 11:04:39 -0500 | [diff] [blame] | 221 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 222 | volumeMounts: |
| 223 | - mountPath: /dbcmd-config/db_migrator_policy_init.sh |
| 224 | name: {{ include "common.fullname" . }}-config |
| 225 | subPath: db_migrator_policy_init.sh |
| 226 | command: |
| 227 | - /bin/sh |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 228 | - -cx |
| 229 | - | |
Andreas Geissler | c50f089 | 2023-06-14 14:21:31 +0200 | [diff] [blame] | 230 | {{- if include "common.onServiceMesh" . }} |
| 231 | echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 232 | /dbcmd-config/db_migrator_policy_init.sh |
jhh | d74fe9f | 2021-04-15 11:04:39 -0500 | [diff] [blame] | 233 | env: |
| 234 | - name: SQL_HOST |
| 235 | value: "{{ index .Values "mariadb-galera" "service" "name" }}" |
| 236 | - name: SQL_USER |
| 237 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} |
| 238 | - name: SQL_PASSWORD |
| 239 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }} |
| 240 | - name: SQL_DB |
| 241 | value: {{ .Values.dbmigrator.schema }} |
| 242 | - name: POLICY_HOME |
| 243 | value: {{ .Values.dbmigrator.policy_home }} |
waynedunican | 368aced | 2022-02-15 08:27:57 +0000 | [diff] [blame] | 244 | - name: SCRIPT_DIRECTORY |
| 245 | value: "sql" |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 246 | resources: {{ include "common.resources" . | nindent 10 }} |
Andreas Geissler | c50f089 | 2023-06-14 14:21:31 +0200 | [diff] [blame] | 247 | {{- if (include "common.onServiceMesh" .) }} |
| 248 | - name: policy-service-mesh-wait-for-job-container |
| 249 | image: {{ include "repositoryGenerator.image.quitQuit" . }} |
| 250 | imagePullPolicy: Always |
| 251 | command: |
| 252 | - /bin/sh |
| 253 | - "-c" |
| 254 | args: |
| 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; |
| 257 | env: |
| 258 | - name: NAMESPACE |
| 259 | valueFrom: |
| 260 | fieldRef: |
| 261 | apiVersion: v1 |
| 262 | fieldPath: metadata.namespace |
| 263 | {{- end }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 264 | restartPolicy: Never |
| 265 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
| 266 | volumes: |
| 267 | - name: {{ include "common.fullname" . }}-config |
| 268 | configMap: |
| 269 | name: {{ include "common.fullname" . }}-db-configmap |
| 270 | defaultMode: 0755 |
| 271 | items: |
| 272 | - key: db_migrator_policy_init.sh |
| 273 | path: db_migrator_policy_init.sh |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 274 | {{ end }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 275 | {{ if .Values.global.postgres.localCluster }} |
| 276 | --- |
| 277 | apiVersion: batch/v1 |
| 278 | kind: Job |
| 279 | metadata: |
| 280 | name: {{ include "common.fullname" . }}-pg-config |
| 281 | namespace: {{ include "common.namespace" . }} |
| 282 | labels: |
| 283 | app: {{ include "common.name" . }}-pg-config |
| 284 | release: {{ include "common.release" . }} |
| 285 | spec: |
| 286 | template: |
| 287 | metadata: |
| 288 | labels: |
| 289 | app: {{ include "common.name" . }}-pg-config |
| 290 | release: {{ include "common.release" . }} |
| 291 | name: {{ include "common.name" . }}-pg-config |
| 292 | spec: |
| 293 | imagePullSecrets: |
| 294 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
| 295 | initContainers: |
| 296 | - name: {{ include "common.name" . }}-init-readiness |
| 297 | image: {{ include "repositoryGenerator.image.readiness" . }} |
| 298 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 299 | command: |
| 300 | - /app/ready.py |
| 301 | args: |
| 302 | - --job-name |
| 303 | - {{ include "common.fullname" . }}-pg-init |
| 304 | env: |
| 305 | - name: NAMESPACE |
| 306 | valueFrom: |
| 307 | fieldRef: |
| 308 | apiVersion: v1 |
| 309 | fieldPath: metadata.namespace |
| 310 | containers: |
| 311 | - name: {{ include "common.name" . }}-pg-db-migrator |
waynedunican | 368aced | 2022-02-15 08:27:57 +0000 | [diff] [blame] | 312 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.dbmigrator.image }} |
| 313 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 314 | volumeMounts: |
| 315 | - mountPath: /dbcmd-config/db_migrator_pg_policy_init.sh |
| 316 | name: {{ include "common.fullname" . }}-config |
| 317 | subPath: db_migrator_pg_policy_init.sh |
| 318 | command: |
| 319 | - /bin/sh |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 320 | - -cx |
| 321 | - | |
Andreas Geissler | c50f089 | 2023-06-14 14:21:31 +0200 | [diff] [blame] | 322 | {{- if include "common.onServiceMesh" . }} |
| 323 | echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 324 | /dbcmd-config/db_migrator_pg_policy_init.sh |
waynedunican | 368aced | 2022-02-15 08:27:57 +0000 | [diff] [blame] | 325 | env: |
| 326 | - name: SQL_HOST |
| 327 | value: "{{ .Values.postgres.service.name2 }}" |
| 328 | - name: SQL_USER |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 329 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} |
waynedunican | 368aced | 2022-02-15 08:27:57 +0000 | [diff] [blame] | 330 | - name: SQL_PASSWORD |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 331 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }} |
waynedunican | 368aced | 2022-02-15 08:27:57 +0000 | [diff] [blame] | 332 | - name: SQL_DB |
| 333 | value: {{ .Values.dbmigrator.schema }} |
| 334 | - name: POLICY_HOME |
| 335 | value: {{ .Values.dbmigrator.policy_home }} |
| 336 | - name: SCRIPT_DIRECTORY |
| 337 | value: "postgres" |
| 338 | - name: PGPASSWORD |
saul.gill | ef208b0 | 2023-04-26 16:16:05 +0100 | [diff] [blame] | 339 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }} |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 340 | resources: {{ include "common.resources" . | nindent 10 }} |
Andreas Geissler | c50f089 | 2023-06-14 14:21:31 +0200 | [diff] [blame] | 341 | {{- if (include "common.onServiceMesh" .) }} |
| 342 | - name: policy-service-mesh-wait-for-job-container |
| 343 | image: {{ include "repositoryGenerator.image.quitQuit" . }} |
| 344 | imagePullPolicy: Always |
| 345 | command: |
| 346 | - /bin/sh |
| 347 | - "-c" |
| 348 | args: |
| 349 | - echo "waiting 10s for istio side cars to be up"; sleep 10s; |
| 350 | /app/ready.py --service-mesh-check {{ include "common.name" . }}-pg-db-migrator -t 45; |
| 351 | env: |
| 352 | - name: NAMESPACE |
| 353 | valueFrom: |
| 354 | fieldRef: |
| 355 | apiVersion: v1 |
| 356 | fieldPath: metadata.namespace |
| 357 | {{- end }} |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 358 | restartPolicy: Never |
farida azmy | c117837 | 2021-04-11 12:55:33 +0200 | [diff] [blame] | 359 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 360 | volumes: |
| 361 | - name: {{ include "common.fullname" . }}-config |
| 362 | configMap: |
| 363 | name: {{ include "common.fullname" . }}-db-configmap |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 364 | defaultMode: 0755 |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 365 | items: |
waynedunican | 368aced | 2022-02-15 08:27:57 +0000 | [diff] [blame] | 366 | - key: db_migrator_pg_policy_init.sh |
| 367 | path: db_migrator_pg_policy_init.sh |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 368 | {{ end }} |