Jakub Latusek | d9c241b | 2020-10-21 13:36:30 +0200 | [diff] [blame^] | 1 | {{/* |
vaibhavjayas | 5ca5465 | 2018-07-31 09:23:16 +0000 | [diff] [blame] | 2 | # Copyright © 2018 Amdocs, Bell Canada |
Krzysztof Opasiak | 4a4703b | 2020-02-08 01:04:48 +0100 | [diff] [blame] | 3 | # Copyright © 2020 Samsung Electronics |
vaibhavjayas | 5ca5465 | 2018-07-31 09:23:16 +0000 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
Jakub Latusek | d9c241b | 2020-10-21 13:36:30 +0200 | [diff] [blame^] | 16 | */}} |
vaibhavjayas | 5ca5465 | 2018-07-31 09:23:16 +0000 | [diff] [blame] | 17 | |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 18 | apiVersion: batch/v1 |
| 19 | kind: Job |
| 20 | metadata: |
Julien Barbot | 8cd9447 | 2018-10-23 12:15:31 +0200 | [diff] [blame] | 21 | name: {{ include "common.fullname" . }}-galera-config |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 22 | namespace: {{ include "common.namespace" . }} |
| 23 | labels: |
Julien Barbot | 8cd9447 | 2018-10-23 12:15:31 +0200 | [diff] [blame] | 24 | app: {{ include "common.name" . }}-job |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 25 | release: {{ include "common.release" . }} |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 26 | spec: |
| 27 | template: |
| 28 | metadata: |
Hector Anapan-Lavalle | 3d8a6a1 | 2018-08-07 21:31:05 -0400 | [diff] [blame] | 29 | labels: |
Julien Barbot | 8cd9447 | 2018-10-23 12:15:31 +0200 | [diff] [blame] | 30 | app: {{ include "common.name" . }}-job |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 31 | release: {{ include "common.release" . }} |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 32 | spec: |
| 33 | initContainers: |
Mandeep Khinda | 561a91c | 2018-08-23 14:08:52 +0000 | [diff] [blame] | 34 | #This container checks that all galera instances are up before initializing it. |
Julien Barbot | 8cd9447 | 2018-10-23 12:15:31 +0200 | [diff] [blame] | 35 | - name: {{ include "common.name" . }}-readiness |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 36 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 37 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 38 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 39 | - /app/ready.py |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 40 | - --container-name |
Sylvain Desbureaux | 6383c44 | 2019-11-14 09:28:12 +0100 | [diff] [blame] | 41 | - {{ index .Values "mariadb-galera" "service" "name" }} |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 42 | env: |
| 43 | - name: NAMESPACE |
Mandeep Khinda | 561a91c | 2018-08-23 14:08:52 +0000 | [diff] [blame] | 44 | valueFrom: |
| 45 | fieldRef: |
| 46 | apiVersion: v1 |
| 47 | fieldPath: metadata.namespace |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 48 | containers: |
Julien Barbot | 8cd9447 | 2018-10-23 12:15:31 +0200 | [diff] [blame] | 49 | - name: {{ include "common.name" . }}-job |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 50 | image: {{ .Values.mariadb_image }} |
dkamdocs | 6ad3a1c | 2018-12-21 09:25:53 +0000 | [diff] [blame] | 51 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 52 | volumeMounts: |
Mandeep Khinda | 561a91c | 2018-08-23 14:08:52 +0000 | [diff] [blame] | 53 | - mountPath: /dbcmd-config/db_cmd.sh |
| 54 | name: {{ include "common.fullname" . }}-config |
| 55 | subPath: db_cmd.sh |
| 56 | - mountPath: /db-config/vid-pre-init.sql |
| 57 | name: {{ include "common.fullname" . }}-config |
| 58 | subPath: vid-pre-init.sql |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 59 | command: |
| 60 | - /bin/sh |
| 61 | args: |
| 62 | - -x |
| 63 | - /dbcmd-config/db_cmd.sh |
| 64 | env: |
| 65 | - name: MYSQL_PASSWORD |
Krzysztof Opasiak | e3519ef | 2020-03-24 03:25:05 +0100 | [diff] [blame] | 66 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "vid-db-user-secret" "key" "password") | indent 10 }} |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 67 | - name: MYSQL_HOST |
Sylvain Desbureaux | 6383c44 | 2019-11-14 09:28:12 +0100 | [diff] [blame] | 68 | value: {{ index .Values "mariadb-galera" "service" "name" }} |
Mandeep Khinda | 561a91c | 2018-08-23 14:08:52 +0000 | [diff] [blame] | 69 | - name: MYSQL_USER |
Krzysztof Opasiak | e3519ef | 2020-03-24 03:25:05 +0100 | [diff] [blame] | 70 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "vid-db-user-secret" "key" "login") | indent 10 }} |
Mandeep Khinda | 561a91c | 2018-08-23 14:08:52 +0000 | [diff] [blame] | 71 | - name: MYSQL_PORT |
Sylvain Desbureaux | 6383c44 | 2019-11-14 09:28:12 +0100 | [diff] [blame] | 72 | value: "{{ index .Values "mariadb-galera" "service" "internalPort" }}" |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 73 | restartPolicy: Never |
Mandeep Khinda | 561a91c | 2018-08-23 14:08:52 +0000 | [diff] [blame] | 74 | volumes: |
| 75 | - name: {{ include "common.fullname" . }}-config |
| 76 | configMap: |
| 77 | name: {{ include "common.fullname" . }} |
| 78 | items: |
| 79 | - key: db_cmd.sh |
| 80 | path: db_cmd.sh |
| 81 | - key: vid-pre-init.sql |
| 82 | path: vid-pre-init.sql |