blob: b9abef846278e9bd0f017b7ad97205c6d6a6a47a [file] [log] [blame]
Jakub Latusekd8eaff62020-10-21 13:36:29 +02001{{/*
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00002# Copyright © 2017 Amdocs, AT&T, Bell Canada
3# Modifications Copyright © 2018 ZTE
priyanshua1b061392018-05-29 12:50:14 +05304#
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*/}}
priyanshua1b061392018-05-29 12:50:14 +053017
priyanshu617e90b2019-03-14 12:56:55 +053018{{ if .Values.initJob.enabled }}
priyanshua1b061392018-05-29 12:50:14 +053019apiVersion: batch/v1
20kind: Job
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010021metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
priyanshua1b061392018-05-29 12:50:14 +053022spec:
23 backoffLimit: 20
24 template:
25 metadata:
26 labels:
27 app: {{ include "common.name" . }}-job
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010028 release: {{ include "common.release" . }}
priyanshua1b061392018-05-29 12:50:14 +053029 spec:
30 restartPolicy: Never
31 initContainers:
ChrisC32172342020-10-02 16:39:13 +020032 - name: {{ include "common.name" . }}-init-readiness
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010033 image: {{ include "repositoryGenerator.image.readiness" . }}
ChrisC32172342020-10-02 16:39:13 +020034 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
35 command:
36 - /app/ready.py
37 args:
38 - --job-name
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010039 - {{ include "common.release" . }}-sdc-cs
ChrisC32172342020-10-02 16:39:13 +020040 - "-t"
41 - "20"
42 env:
43 - name: NAMESPACE
44 valueFrom:
45 fieldRef:
46 apiVersion: v1
47 fieldPath: metadata.namespace
48 resources:
49 limits:
50 cpu: 100m
51 memory: 100Mi
52 requests:
53 cpu: 3m
54 memory: 20Mi
priyanshua1b061392018-05-29 12:50:14 +053055 containers:
othman touijer2b764d02022-01-05 14:40:37 +010056 - name: {{ include "common.name" . }}-job
57 image:
58 {{ include "repositoryGenerator.repository" . }}/{{ .Values.configInitImage }}
59 imagePullPolicy:
60 {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
61 {{- if include "common.onServiceMesh" . }}
62 args:
63 - echo "waiting 10s for istio side cars to be up"; sleep 10s; /start.sh
64 command:
65 - /bin/sh
66 - -c
67 {{- end }}
dasarathi52802465e8f782023-05-03 09:51:20 +000068 volumeMounts:
69 - name: {{ include "common.fullname" . }}-cqlshrc
70 mountPath: /home/sdc/.cassandra
othman touijer2b764d02022-01-05 14:40:37 +010071 env:
ChrisC32172342020-10-02 16:39:13 +020072 - name: CS_HOST
Andreas Geisslerfd450c42021-12-10 08:36:45 +000073 value: "{{ .Values.global.sdc_cassandra.serviceName }}"
ChrisC32172342020-10-02 16:39:13 +020074 - name: CS_PORT
othman touijer2b764d02022-01-05 14:40:37 +010075 value: {{ .Values.config.cassandraClientPort | quote }}
ChrisC32172342020-10-02 16:39:13 +020076 - name: CS_AUTHENTICATE
othman touijer2b764d02022-01-05 14:40:37 +010077 value: {{ .Values.config.cassandraAuthenticationEnabled | quote }}
ChrisC32172342020-10-02 16:39:13 +020078 - name: CS_USER
othman touijer2b764d02022-01-05 14:40:37 +010079 valueFrom: {secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}}
ChrisC32172342020-10-02 16:39:13 +020080 - name: CS_PASSWORD
othman touijer2b764d02022-01-05 14:40:37 +010081 valueFrom: {secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}}
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010082 resources: {{ include "common.resources" . | nindent 10 }}
othman touijer2b764d02022-01-05 14:40:37 +010083 {{ include "common.waitForJobContainer" . | indent 6 | trim }}
dasarathi52802465e8f782023-05-03 09:51:20 +000084 volumes:
85 - name: {{ include "common.fullname" . }}-cqlshrc
86 configMap:
87 name: {{ include "common.release" . }}-sdc-cqlshrc
priyanshua1b061392018-05-29 12:50:14 +053088 imagePullSecrets:
othman touijer2b764d02022-01-05 14:40:37 +010089 - name: "{{ include "common.namespace" . }}-docker-registry-key"
Mahendra Raghuwanshi35f83f52019-03-20 10:42:49 +000090{{ end }}