License Task for VID,AAF,CLI,SNIRO
[oom.git] / kubernetes / vid / templates / vid-galera-config-job.yaml
1 # Copyright © 2018 Amdocs, Bell Canada
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 apiVersion: batch/v1
16 kind: Job
17 metadata:
18   name: vid-config-galera
19   namespace: {{ include "common.namespace" . }}
20   labels:
21     app: vid-config-galera
22     release: {{ .Release.Name }}
23 spec:
24   template:
25     metadata:
26       name: vid-galera-init
27     spec:
28       initContainers:
29 #dd775k:  This container checks that all galera instances are up before initializing it.
30       - name: vid-init-galera-readiness
31         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
32         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
33 #        - /bin/sh
34 #        args:
35 #        - "-c"
36 #        - "sleep 1000000000m"
37         command:
38         - python
39         args:
40         - /root/vid_ready.py
41         - --container-name
42         - {{ include "common.fullname" . }}-mariadb-galera-0
43         env:
44         - name: NAMESPACE
45           value: {{ include "common.namespace" . }}
46         volumeMounts:
47         - name: init-config
48           mountPath: /root/
49       containers:
50       - name: vid-config-galeradb
51         image: {{ .Values.mariadb_image }}
52         imagePullPolicy: "{{ .Values.pullPolicy }}"
53         volumeMounts:
54         - name: vid-db-config
55           mountPath: /db-config
56         - name: dbcmd-config
57           mountPath: /dbcmd-config
58         command:
59         - /bin/sh
60         args:
61         - -x
62         - /dbcmd-config/db_cmd.sh
63         env:
64         - name: MYSQL_PASSWORD
65           value: "{{ .Values.config.vidmysqlpassword }}"
66 #          valueFrom:
67 #            secretKeyRef:
68 #              name: {{ template "common.fullname" . }}
69 #              key: vid-password
70         - name: MYSQL_HOST
71           value: "{{ .Values.config.vidmysqlhost }}"
72       volumes:
73         - name: vid-db-config
74           configMap:
75             name: {{ include "common.fullname" . }}-galera-sql-configmap
76         - name: dbcmd-config
77           configMap:
78             name: {{ include "common.fullname" . }}-dbcmd-configmap
79         - name: init-config
80           configMap:
81             name: {{ include "common.fullname" . }}-cluster-ready-configmap
82       restartPolicy: Never
83
84