blob: 9ba05b8631d906c53302c6e0c9ce3806d5b5d81c [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 }}
68 env:
ChrisC32172342020-10-02 16:39:13 +020069 - name: CS_HOST
Andreas Geisslerfd450c42021-12-10 08:36:45 +000070 value: "{{ .Values.global.sdc_cassandra.serviceName }}"
ChrisC32172342020-10-02 16:39:13 +020071 - name: CS_PORT
othman touijer2b764d02022-01-05 14:40:37 +010072 value: {{ .Values.config.cassandraClientPort | quote }}
ChrisC32172342020-10-02 16:39:13 +020073 - name: CS_AUTHENTICATE
othman touijer2b764d02022-01-05 14:40:37 +010074 value: {{ .Values.config.cassandraAuthenticationEnabled | quote }}
ChrisC32172342020-10-02 16:39:13 +020075 - name: CS_USER
othman touijer2b764d02022-01-05 14:40:37 +010076 valueFrom: {secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}}
ChrisC32172342020-10-02 16:39:13 +020077 - name: CS_PASSWORD
othman touijer2b764d02022-01-05 14:40:37 +010078 valueFrom: {secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}}
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010079 resources: {{ include "common.resources" . | nindent 10 }}
othman touijer2b764d02022-01-05 14:40:37 +010080 {{ include "common.waitForJobContainer" . | indent 6 | trim }}
priyanshua1b061392018-05-29 12:50:14 +053081 imagePullSecrets:
othman touijer2b764d02022-01-05 14:40:37 +010082 - name: "{{ include "common.namespace" . }}-docker-registry-key"
Mahendra Raghuwanshi35f83f52019-03-20 10:42:49 +000083{{ end }}