[SDC] Add missing dependency to cassandra chart
[oom.git] / kubernetes / sdc / components / sdc-cs / templates / job.yaml
1 {{/*
2 # Copyright © 2017 Amdocs, AT&T, Bell Canada
3 # Modifications Copyright © 2018  ZTE
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.
16 */}}
17
18 apiVersion: batch/v1
19 kind: Job
20 metadata:
21   name: {{ include "common.fullname" . }}-config-cassandra
22   namespace: {{ include "common.namespace" . }}
23   labels:
24     app: {{ include "common.name" . }}-job
25     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
26     release: {{ include "common.release" . }}
27     heritage: {{ .Release.Service }}
28 spec:
29   backoffLimit: 20
30   template:
31     metadata:
32       labels:
33         app: {{ include "common.name" . }}-job
34         release: {{ include "common.release" . }}
35     spec:
36       restartPolicy: Never
37       initContainers:
38       - name: {{ include "common.name" . }}-init-readiness
39         image: {{ include "repositoryGenerator.image.readiness" . }}
40         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
41         command:
42         - /app/ready.py
43         args:
44         - --container-name
45         {{- if .Values.global.sdc_cassandra.localCluster }}
46         - sdc-cs
47         {{- else }}
48         - cassandra
49         {{- end }}
50         - "-t"
51         - "15"
52         env:
53         - name: NAMESPACE
54           valueFrom:
55             fieldRef:
56               apiVersion: v1
57               fieldPath: metadata.namespace
58         resources:
59           limits:
60             cpu: 100m
61             memory: 100Mi
62           requests:
63             cpu: 3m
64             memory: 20Mi
65       containers:
66       - name: {{ include "common.name" . }}-job
67         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.cassandraInitImage }}
68         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
69         volumeMounts:
70         - name: {{ include "common.fullname" . }}-environments
71           mountPath: /home/sdc/chef-solo/environments/
72         - name: {{ include "common.fullname" . }}-chef-cache
73           mountPath: /home/sdc/chef-solo/cache
74         env:
75         - name: ENVNAME
76           value: {{ .Values.env.name }}
77         - name: RELEASE
78           value: {{ .Values.config.release }}
79         - name: SDC_USER
80           valueFrom:
81             secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
82         - name: SDC_PASSWORD
83           valueFrom:
84             secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
85         - name: CS_PASSWORD
86           valueFrom:
87             secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: cs_password}
88         - name: HOST_IP
89           valueFrom:
90             fieldRef:
91               fieldPath: status.podIP
92         resources:
93           limits:
94             cpu: 800m
95             memory: 1024Mi
96           requests:
97             cpu: 200m
98             memory: 300Mi
99       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
100       volumes:
101       - name: {{ include "common.fullname" . }}-environments
102         configMap:
103           name: {{ include "common.release" . }}-sdc-environments-configmap
104           defaultMode: 0755
105       - name: {{ include "common.fullname" . }}-chef-cache
106         emptyDir: {}
107       imagePullSecrets:
108       - name: "{{ include "common.namespace" . }}-docker-registry-key"
109       restartPolicy: Never