Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 1 | apiVersion: batch/v1 |
| 2 | kind: Job |
| 3 | metadata: |
| 4 | name: vid-config-galera |
| 5 | namespace: {{ include "common.namespace" . }} |
| 6 | labels: |
| 7 | app: vid-config-galera |
| 8 | release: {{ .Release.Name }} |
| 9 | spec: |
| 10 | template: |
| 11 | metadata: |
| 12 | name: vid-galera-init |
| 13 | spec: |
| 14 | initContainers: |
| 15 | #dd775k: This container checks that all galera instances are up before initializing it. |
| 16 | - name: vid-init-galera-readiness |
| 17 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 18 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 19 | # - /bin/sh |
| 20 | # args: |
| 21 | # - "-c" |
| 22 | # - "sleep 1000000000m" |
| 23 | command: |
| 24 | - python |
| 25 | args: |
| 26 | - /root/vid_ready.py |
| 27 | - --container-name |
| 28 | - {{ include "common.fullname" . }}-mariadb-galera-0 |
| 29 | env: |
| 30 | - name: NAMESPACE |
| 31 | value: {{ include "common.namespace" . }} |
| 32 | volumeMounts: |
| 33 | - name: init-config |
| 34 | mountPath: /root/ |
| 35 | containers: |
| 36 | - name: vid-config-galeradb |
| 37 | image: {{ .Values.mariadb_image }} |
| 38 | imagePullPolicy: "{{ .Values.pullPolicy }}" |
| 39 | volumeMounts: |
| 40 | - name: vid-db-config |
| 41 | mountPath: /db-config |
| 42 | - name: dbcmd-config |
| 43 | mountPath: /dbcmd-config |
| 44 | command: |
| 45 | - /bin/sh |
| 46 | args: |
| 47 | - -x |
| 48 | - /dbcmd-config/db_cmd.sh |
| 49 | env: |
| 50 | - name: MYSQL_PASSWORD |
| 51 | value: "{{ .Values.config.vidmysqlpassword }}" |
| 52 | # valueFrom: |
| 53 | # secretKeyRef: |
| 54 | # name: {{ template "common.fullname" . }} |
| 55 | # key: vid-password |
| 56 | - name: MYSQL_HOST |
| 57 | value: "{{ .Values.config.vidmysqlhost }}" |
| 58 | volumes: |
| 59 | - name: vid-db-config |
| 60 | configMap: |
| 61 | name: {{ include "common.fullname" . }}-galera-sql-configmap |
| 62 | - name: dbcmd-config |
| 63 | configMap: |
| 64 | name: {{ include "common.fullname" . }}-dbcmd-configmap |
| 65 | - name: init-config |
| 66 | configMap: |
| 67 | name: {{ include "common.fullname" . }}-cluster-ready-configmap |
| 68 | restartPolicy: Never |
| 69 | |
| 70 | |