blob: 936c7c41b5250226078444430cd6e71943f7cdf2 [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 "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000025 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
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010032 release: {{ include "common.release" . }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000033 spec:
34 restartPolicy: Never
35 initContainers:
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000036 - name: {{ include "common.name" . }}-job-completion
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020037 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000038 imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
39 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020040 - /app/ready.py
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000041 args:
42 - --job-name
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010043 - {{ include "common.release" . }}-sdc-cs-config-cassandra
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000044 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
MichaelMorrisb137f7e2020-03-15 17:44:48 +000056 mountPath: /home/sdc/chef-solo/environments/
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000057 env:
58 - name: ENVNAME
ChrisC742a7b22020-09-04 11:29:57 +020059 value: {{ .Values.env.name }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000060 - name: HOST_IP
61 valueFrom:
62 fieldRef:
63 fieldPath: status.podIP
64 - name: SDC_USER
65 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010066 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000067 - name: SDC_PASSWORD
68 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010069 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000070 - name: CS_PASSWORD
71 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010072 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: cs_password}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000073 - name: CS_HOST_IP
Mahendra Raghuwanshi35f83f52019-03-20 10:42:49 +000074 value: "{{ .Values.global.cassandra.serviceName }}"
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000075 volumes:
76 - name: {{ include "common.fullname" . }}-environments
77 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010078 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000079 defaultMode: 0755
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000080 imagePullSecrets:
81 - name: "{{ include "common.namespace" . }}-docker-registry-key"
82 restartPolicy: Never