blob: 320918507f4b15e146c1e98f6e951c8eb55117da [file] [log] [blame]
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +00001# Copyright © 2017 Amdocs, AT&T, Bell Canada
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00002# Modifications Copyright © 2018 ZTE
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +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
16apiVersion: batch/v1
17kind: Job
18metadata:
19 name: {{ include "common.fullname" . }}-cassandra-init
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 Khinda51a8b1b2018-04-24 20:05:32 +000028 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}-job
32 release: {{ .Release.Name }}
33 spec:
34 restartPolicy: Never
35 initContainers:
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000036 - name: {{ include "common.name" . }}-job-completion
37 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
38 imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
39 command:
40 - /root/job_complete.py
41 args:
42 - --job-name
43 - {{ .Release.Name }}-sdc-cs-config-cassandra
44 env:
45 - name: NAMESPACE
46 valueFrom:
47 fieldRef:
48 apiVersion: v1
49 fieldPath: metadata.namespace
50 containers:
51 - name: {{ include "common.name" . }}-job
52 image: "{{ include "common.repository" . }}/{{ .Values.onboardingInitImage }}"
53 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54 volumeMounts:
55 - name: {{ include "common.fullname" . }}-environments
56 mountPath: /root/chef-solo/environments/
57 - name: {{ include "common.fullname" . }}-data
58 mountPath: /var/lib/cassandra/
59 env:
60 - name: ENVNAME
61 value: {{ .Values.global.env.name }}
62 - name: HOST_IP
63 valueFrom:
64 fieldRef:
65 fieldPath: status.podIP
66 - name: SDC_USER
67 valueFrom:
68 secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: sdc_user}
69 - name: SDC_PASSWORD
70 valueFrom:
71 secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: sdc_password}
72 - name: CS_PASSWORD
73 valueFrom:
74 secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: cs_password}
75 - name: CS_HOST_IP
76 value: "sdc-cs"
77 volumes:
78 - name: {{ include "common.fullname" . }}-environments
79 configMap:
80 name: {{ .Release.Name }}-sdc-environments-configmap
81 defaultMode: 0755
82 - name: {{ include "common.fullname" . }}-data
83 {{- if .Values.persistence.enabled }}
84 persistentVolumeClaim:
85 claimName: {{ include "common.fullname" . }}
86 {{- else }}
87 emptyDir: {}
88 {{- end }}
89 imagePullSecrets:
90 - name: "{{ include "common.namespace" . }}-docker-registry-key"
91 restartPolicy: Never