blob: 19dd11281f61fbaee85214f7bff989f1d36889e3 [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
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020037 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000038 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
39 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020040 - /app/ready.py
Mandeep Khindaa1047f42018-03-22 02:12:15 +000041 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 }}
ChrisC32172342020-10-02 16:39:13 +020048 - "-t"
49 - "15"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000050 env:
51 - name: NAMESPACE
52 valueFrom:
53 fieldRef:
54 apiVersion: v1
55 fieldPath: metadata.namespace
ChrisC32172342020-10-02 16:39:13 +020056 resources:
57 limits:
58 cpu: 100m
59 memory: 100Mi
60 requests:
61 cpu: 3m
62 memory: 20Mi
Mandeep Khindaa1047f42018-03-22 02:12:15 +000063 containers:
64 - name: {{ include "common.name" . }}-job
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000065 image: "{{ include "common.repository" . }}/{{ .Values.cassandraInitImage }}"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000066 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
67 volumeMounts:
68 - name: {{ include "common.fullname" . }}-environments
MichaelMorrisb137f7e2020-03-15 17:44:48 +000069 mountPath: /home/sdc/chef-solo/environments/
Mandeep Khinda403c1c12018-04-19 23:15:43 +000070 - name: {{ include "common.fullname" . }}-chef-cache
MichaelMorrisb137f7e2020-03-15 17:44:48 +000071 mountPath: /home/sdc/chef-solo/cache
Mandeep Khindaa1047f42018-03-22 02:12:15 +000072 env:
73 - name: ENVNAME
ChrisC742a7b22020-09-04 11:29:57 +020074 value: {{ .Values.env.name }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000075 - name: RELEASE
76 value: {{ .Values.config.release }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000077 - name: SDC_USER
78 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010079 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000080 - name: SDC_PASSWORD
81 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010082 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000083 - name: CS_PASSWORD
84 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010085 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: cs_password}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000086 - name: HOST_IP
87 valueFrom:
88 fieldRef:
89 fieldPath: status.podIP
ChrisC32172342020-10-02 16:39:13 +020090 resources:
91 limits:
92 cpu: 800m
93 memory: 1024Mi
94 requests:
95 cpu: 200m
96 memory: 300Mi
Mandeep Khindaa1047f42018-03-22 02:12:15 +000097 volumes:
Mandeep Khinda403c1c12018-04-19 23:15:43 +000098 - name: {{ include "common.fullname" . }}-environments
99 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100100 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000101 defaultMode: 0755
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000102 - name: {{ include "common.fullname" . }}-chef-cache
103 emptyDir: {}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000104 imagePullSecrets:
105 - name: "{{ include "common.namespace" . }}-docker-registry-key"
106 restartPolicy: Never