blob: 4e4aad46fc6d10f186a8649463404e895d3a12b1 [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 "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000025 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
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010032 release: {{ include "common.release" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000033 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
Mahendra Raghuwanshi35f83f52019-03-20 10:42:49 +000043 {{- if .Values.global.cassandra.localCluster }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000044 - sdc-cs
Mahendra Raghuwanshi35f83f52019-03-20 10:42:49 +000045 {{- else }}
46 - cassandra
47 {{- end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000048 env:
49 - name: NAMESPACE
50 valueFrom:
51 fieldRef:
52 apiVersion: v1
53 fieldPath: metadata.namespace
54 containers:
55 - name: {{ include "common.name" . }}-job
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000056 image: "{{ include "common.repository" . }}/{{ .Values.cassandraInitImage }}"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000057 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
58 volumeMounts:
59 - name: {{ include "common.fullname" . }}-environments
MichaelMorrisb137f7e2020-03-15 17:44:48 +000060 mountPath: /home/sdc/chef-solo/environments/
Mandeep Khinda403c1c12018-04-19 23:15:43 +000061 - name: {{ include "common.fullname" . }}-chef-cache
MichaelMorrisb137f7e2020-03-15 17:44:48 +000062 mountPath: /home/sdc/chef-solo/cache
Mandeep Khindaa1047f42018-03-22 02:12:15 +000063 env:
64 - name: ENVNAME
65 value: {{ .Values.global.env.name }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000066 - name: RELEASE
67 value: {{ .Values.config.release }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000068 - name: SDC_USER
69 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010070 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000071 - name: SDC_PASSWORD
72 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010073 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000074 - name: CS_PASSWORD
75 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010076 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: cs_password}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000077 - name: HOST_IP
78 valueFrom:
79 fieldRef:
80 fieldPath: status.podIP
Mandeep Khindaa1047f42018-03-22 02:12:15 +000081 volumes:
Mandeep Khinda403c1c12018-04-19 23:15:43 +000082 - name: {{ include "common.fullname" . }}-environments
83 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010084 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khinda403c1c12018-04-19 23:15:43 +000085 defaultMode: 0755
Mandeep Khinda403c1c12018-04-19 23:15:43 +000086 - name: {{ include "common.fullname" . }}-chef-cache
87 emptyDir: {}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000088 imagePullSecrets:
89 - name: "{{ include "common.namespace" . }}-docker-registry-key"
90 restartPolicy: Never