blob: e8f8700616fbe96530f3fa8cb7c5617cf57aa490 [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
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010020metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000021spec:
Mike Elliott6482f502018-04-30 15:02:43 -040022 backoffLimit: 20
Mandeep Khindaa1047f42018-03-22 02:12:15 +000023 template:
24 metadata:
25 labels:
26 app: {{ include "common.name" . }}-job
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010027 release: {{ include "common.release" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000028 spec:
29 restartPolicy: Never
30 initContainers:
31 - name: {{ include "common.name" . }}-init-readiness
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010032 image: {{ include "repositoryGenerator.image.readiness" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000033 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
34 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020035 - /app/ready.py
Mandeep Khindaa1047f42018-03-22 02:12:15 +000036 args:
37 - --container-name
Andreas Geisslerfd450c42021-12-10 08:36:45 +000038 {{- if .Values.global.sdc_cassandra.localCluster }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000039 - sdc-cs
Mahendra Raghuwanshi35f83f52019-03-20 10:42:49 +000040 {{- else }}
41 - cassandra
42 {{- end }}
ChrisC32172342020-10-02 16:39:13 +020043 - "-t"
44 - "15"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000045 env:
46 - name: NAMESPACE
47 valueFrom:
48 fieldRef:
49 apiVersion: v1
50 fieldPath: metadata.namespace
ChrisC32172342020-10-02 16:39:13 +020051 resources:
52 limits:
53 cpu: 100m
54 memory: 100Mi
55 requests:
56 cpu: 3m
57 memory: 20Mi
Mandeep Khindaa1047f42018-03-22 02:12:15 +000058 containers:
59 - name: {{ include "common.name" . }}-job
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010060 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.cassandraInitImage }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000061 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
62 volumeMounts:
63 - name: {{ include "common.fullname" . }}-environments
MichaelMorrisb137f7e2020-03-15 17:44:48 +000064 mountPath: /home/sdc/chef-solo/environments/
Mandeep Khinda403c1c12018-04-19 23:15:43 +000065 - name: {{ include "common.fullname" . }}-chef-cache
MichaelMorrisb137f7e2020-03-15 17:44:48 +000066 mountPath: /home/sdc/chef-solo/cache
dasarathi52802465e8f782023-05-03 09:51:20 +000067 - name: {{ include "common.fullname" . }}-cqlshrc
68 mountPath: /home/sdc/.cassandra
Mandeep Khindaa1047f42018-03-22 02:12:15 +000069 env:
70 - name: ENVNAME
ChrisC742a7b22020-09-04 11:29:57 +020071 value: {{ .Values.env.name }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000072 - name: RELEASE
73 value: {{ .Values.config.release }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000074 - name: SDC_USER
75 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010076 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000077 - name: SDC_PASSWORD
78 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010079 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000080 - name: CS_PASSWORD
81 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010082 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: cs_password}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000083 - name: HOST_IP
84 valueFrom:
85 fieldRef:
86 fieldPath: status.podIP
ChrisC32172342020-10-02 16:39:13 +020087 resources:
88 limits:
89 cpu: 800m
90 memory: 1024Mi
91 requests:
92 cpu: 200m
93 memory: 300Mi
othman touijer2b764d02022-01-05 14:40:37 +010094 {{ include "common.waitForJobContainer" . | indent 6 | trim }}
farida azmy1383b4c2021-04-06 12:33:31 +020095 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000096 volumes:
Mandeep Khinda403c1c12018-04-19 23:15:43 +000097 - name: {{ include "common.fullname" . }}-environments
98 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010099 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000100 defaultMode: 0755
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000101 - name: {{ include "common.fullname" . }}-chef-cache
102 emptyDir: {}
dasarathi52802465e8f782023-05-03 09:51:20 +0000103 - name: {{ include "common.fullname" . }}-cqlshrc
104 configMap:
105 name: {{ include "common.release" . }}-sdc-cqlshrc
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000106 imagePullSecrets:
107 - name: "{{ include "common.namespace" . }}-docker-registry-key"
108 restartPolicy: Never