blob: 0eeeff52dac30a625be00ee35f91ea714f256b12 [file] [log] [blame]
Jakub Latusekd8eaff62020-10-21 13:36:29 +02001{{/*
Mandeep Khindab1f9efe2018-03-28 19:01:55 +00002# Copyright © 2017 Amdocs, AT&T, Bell Canada
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00003# Modifications Copyright © 2018 ZTE
Mandeep Khindab1f9efe2018-03-28 19:01:55 +00004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Jakub Latusekd8eaff62020-10-21 13:36:29 +020016*/}}
Mandeep Khindab1f9efe2018-03-28 19:01:55 +000017
Mandeep Khindaa1047f42018-03-22 02:12:15 +000018apiVersion: batch/v1
19kind: Job
20metadata:
21 name: {{ include "common.fullname" . }}-config-cassandra
22 namespace: {{ include "common.namespace" . }}
23 labels:
24 app: {{ include "common.name" . }}-job
25 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010026 release: {{ include "common.release" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000027 heritage: {{ .Release.Service }}
28spec:
Mike Elliott6482f502018-04-30 15:02:43 -040029 backoffLimit: 20
Mandeep Khindaa1047f42018-03-22 02:12:15 +000030 template:
31 metadata:
32 labels:
33 app: {{ include "common.name" . }}-job
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010034 release: {{ include "common.release" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000035 spec:
36 restartPolicy: Never
37 initContainers:
38 - name: {{ include "common.name" . }}-init-readiness
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010039 image: {{ include "repositoryGenerator.image.readiness" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000040 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
41 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020042 - /app/ready.py
Mandeep Khindaa1047f42018-03-22 02:12:15 +000043 args:
44 - --container-name
Andreas Geisslerfd450c42021-12-10 08:36:45 +000045 {{- if .Values.global.sdc_cassandra.localCluster }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000046 - sdc-cs
Mahendra Raghuwanshi35f83f52019-03-20 10:42:49 +000047 {{- else }}
48 - cassandra
49 {{- end }}
ChrisC32172342020-10-02 16:39:13 +020050 - "-t"
51 - "15"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000052 env:
53 - name: NAMESPACE
54 valueFrom:
55 fieldRef:
56 apiVersion: v1
57 fieldPath: metadata.namespace
ChrisC32172342020-10-02 16:39:13 +020058 resources:
59 limits:
60 cpu: 100m
61 memory: 100Mi
62 requests:
63 cpu: 3m
64 memory: 20Mi
Mandeep Khindaa1047f42018-03-22 02:12:15 +000065 containers:
66 - name: {{ include "common.name" . }}-job
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010067 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.cassandraInitImage }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000068 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
69 volumeMounts:
70 - name: {{ include "common.fullname" . }}-environments
MichaelMorrisb137f7e2020-03-15 17:44:48 +000071 mountPath: /home/sdc/chef-solo/environments/
Mandeep Khinda403c1c12018-04-19 23:15:43 +000072 - name: {{ include "common.fullname" . }}-chef-cache
MichaelMorrisb137f7e2020-03-15 17:44:48 +000073 mountPath: /home/sdc/chef-solo/cache
Mandeep Khindaa1047f42018-03-22 02:12:15 +000074 env:
75 - name: ENVNAME
ChrisC742a7b22020-09-04 11:29:57 +020076 value: {{ .Values.env.name }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000077 - name: RELEASE
78 value: {{ .Values.config.release }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000079 - name: SDC_USER
80 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010081 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000082 - name: SDC_PASSWORD
83 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010084 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000085 - name: CS_PASSWORD
86 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010087 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: cs_password}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000088 - name: HOST_IP
89 valueFrom:
90 fieldRef:
91 fieldPath: status.podIP
ChrisC32172342020-10-02 16:39:13 +020092 resources:
93 limits:
94 cpu: 800m
95 memory: 1024Mi
96 requests:
97 cpu: 200m
98 memory: 300Mi
othman touijer2b764d02022-01-05 14:40:37 +010099 {{ include "common.waitForJobContainer" . | indent 6 | trim }}
farida azmy1383b4c2021-04-06 12:33:31 +0200100 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000101 volumes:
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000102 - name: {{ include "common.fullname" . }}-environments
103 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100104 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000105 defaultMode: 0755
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000106 - name: {{ include "common.fullname" . }}-chef-cache
107 emptyDir: {}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000108 imagePullSecrets:
109 - name: "{{ include "common.namespace" . }}-docker-registry-key"
110 restartPolicy: Never