blob: 8ceca385a42ddc428a709cf1ca4c0372b09d7a08 [file] [log] [blame]
Jakub Latusekd8eaff62020-10-21 13:36:29 +02001{{/*
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +00002# Copyright © 2017 Amdocs, AT&T, Bell Canada
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00003# Modifications Copyright © 2018 ZTE
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +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 Khinda51a8b1b2018-04-24 20:05:32 +000017
18apiVersion: batch/v1
19kind: Job
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010020metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000021spec:
Mike Elliott6482f502018-04-30 15:02:43 -040022 backoffLimit: 20
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +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 Khinda51a8b1b2018-04-24 20:05:32 +000028 spec:
29 restartPolicy: Never
30 initContainers:
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000031 - name: {{ include "common.name" . }}-job-completion
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010032 image: {{ include "repositoryGenerator.image.readiness" . }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000033 imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
34 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020035 - /app/ready.py
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000036 args:
37 - --job-name
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010038 - {{ include "common.release" . }}-sdc-cs
ChrisC32172342020-10-02 16:39:13 +020039 - "-t"
40 - "20"
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000041 env:
42 - name: NAMESPACE
43 valueFrom:
44 fieldRef:
45 apiVersion: v1
46 fieldPath: metadata.namespace
ChrisC32172342020-10-02 16:39:13 +020047 resources:
48 limits:
Andreas Geissler47537432024-02-27 08:55:23 +010049 cpu: "100m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010050 memory: "500Mi"
ChrisC32172342020-10-02 16:39:13 +020051 requests:
Andreas Geissler47537432024-02-27 08:55:23 +010052 cpu: "3m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010053 memory: "20Mi"
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000054 containers:
55 - name: {{ include "common.name" . }}-job
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010056 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.onboardingInitImage }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000057 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
othman touijer2b764d02022-01-05 14:40:37 +010058 {{- if include "common.onServiceMesh" . }}
59 args:
60 - echo "waiting 10s for istio side cars to be up"; sleep 10s; /home/sdc/startup.sh
61 command:
62 - /bin/sh
63 - -c
64 {{- end }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000065 volumeMounts:
66 - name: {{ include "common.fullname" . }}-environments
MichaelMorrisb137f7e2020-03-15 17:44:48 +000067 mountPath: /home/sdc/chef-solo/environments/
dasarathi52802465e8f782023-05-03 09:51:20 +000068 - name: {{ include "common.fullname" . }}-cqlshrc
69 mountPath: /home/sdc/.cassandra
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000070 env:
71 - name: ENVNAME
ChrisC742a7b22020-09-04 11:29:57 +020072 value: {{ .Values.env.name }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000073 - name: HOST_IP
74 valueFrom:
75 fieldRef:
76 fieldPath: status.podIP
77 - 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 Khinda51a8b1b2018-04-24 20:05:32 +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 Khinda51a8b1b2018-04-24 20:05:32 +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 Khinda51a8b1b2018-04-24 20:05:32 +000086 - name: CS_HOST_IP
Andreas Geisslerfd450c42021-12-10 08:36:45 +000087 value: "{{ .Values.global.sdc_cassandra.serviceName }}"
ChrisC32172342020-10-02 16:39:13 +020088 resources:
89 limits:
Andreas Geissler47537432024-02-27 08:55:23 +010090 cpu: "800m"
91 memory: "1Gi"
ChrisC32172342020-10-02 16:39:13 +020092 requests:
Andreas Geissler47537432024-02-27 08:55:23 +010093 cpu: "200m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010094 memory: "200Mi"
othman touijer2b764d02022-01-05 14:40:37 +010095 {{ include "common.waitForJobContainer" . | indent 6 | trim }}
vladimir turokd8044182023-07-27 16:28:36 +020096 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000097 volumes:
98 - name: {{ include "common.fullname" . }}-environments
99 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100100 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000101 defaultMode: 0755
dasarathi52802465e8f782023-05-03 09:51:20 +0000102 - name: {{ include "common.fullname" . }}-cqlshrc
103 configMap:
104 name: {{ include "common.release" . }}-sdc-cqlshrc
Andreas Geisslerbd0d31a2024-03-20 09:51:32 +0100105 {{- include "common.imagePullSecrets" . | nindent 6 }}