blob: 75e9a11a03e965c6cd2c81054c9b1299f2eb67fb [file] [log] [blame]
Mandeep Khindab1f9efe2018-03-28 19:01:55 +00001# Copyright © 2017 Amdocs, AT&T, Bell Canada
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00002# Modifications Copyright © 2018 ZTE
Mandeep Khindab1f9efe2018-03-28 19:01:55 +00003#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
Mandeep Khindaa1047f42018-03-22 02:12:15 +000016apiVersion: batch/v1
17kind: Job
18metadata:
19 name: {{ include "common.fullname" . }}-config-cassandra
20 namespace: {{ include "common.namespace" . }}
21 labels:
22 app: {{ include "common.name" . }}-job
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24 release: {{ .Release.Name }}
25 heritage: {{ .Release.Service }}
26spec:
Mike Elliott6482f502018-04-30 15:02:43 -040027 backoffLimit: 20
Mandeep Khindaa1047f42018-03-22 02:12:15 +000028 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}-job
32 release: {{ .Release.Name }}
33 spec:
34 restartPolicy: Never
35 initContainers:
36 - name: {{ include "common.name" . }}-init-readiness
37 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
38 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
39 command:
40 - /root/ready.py
41 args:
42 - --container-name
43 - sdc-cs
44 env:
45 - name: NAMESPACE
46 valueFrom:
47 fieldRef:
48 apiVersion: v1
49 fieldPath: metadata.namespace
50 containers:
51 - name: {{ include "common.name" . }}-job
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000052 image: "{{ include "common.repository" . }}/{{ .Values.cassandraInitImage }}"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000053 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54 volumeMounts:
55 - name: {{ include "common.fullname" . }}-environments
56 mountPath: /root/chef-solo/environments/
Mandeep Khinda403c1c12018-04-19 23:15:43 +000057 - name: {{ include "common.fullname" . }}-data
58 mountPath: /var/lib/cassandra/
59 - name: {{ include "common.fullname" . }}-chef-cache
60 mountPath: /root/chef-solo/cache
Mandeep Khindaa1047f42018-03-22 02:12:15 +000061 env:
62 - name: ENVNAME
63 value: {{ .Values.global.env.name }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000064 - name: RELEASE
65 value: {{ .Values.config.release }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000066 - name: SDC_USER
67 valueFrom:
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000068 secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: sdc_user}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000069 - name: SDC_PASSWORD
70 valueFrom:
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000071 secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: sdc_password}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000072 - name: CS_PASSWORD
73 valueFrom:
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000074 secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: cs_password}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000075 - name: HOST_IP
76 valueFrom:
77 fieldRef:
78 fieldPath: status.podIP
Mandeep Khindaa1047f42018-03-22 02:12:15 +000079 volumes:
Mandeep Khinda403c1c12018-04-19 23:15:43 +000080 - name: {{ include "common.fullname" . }}-environments
81 configMap:
82 name: {{ .Release.Name }}-sdc-environments-configmap
83 defaultMode: 0755
84 - name: {{ include "common.fullname" . }}-data
85 {{- if .Values.persistence.enabled }}
86 persistentVolumeClaim:
87 claimName: {{ include "common.fullname" . }}
88 {{- else }}
89 emptyDir: {}
90 {{- end }}
91 - name: {{ include "common.fullname" . }}-chef-cache
92 emptyDir: {}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000093 imagePullSecrets:
94 - name: "{{ include "common.namespace" . }}-docker-registry-key"
95 restartPolicy: Never