Jakub Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, AT&T, Bell Canada |
| 3 | # Modifications Copyright © 2018 ZTE |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 4 | # |
| 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 Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 16 | */}} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 17 | |
priyanshu | 617e90b | 2019-03-14 12:56:55 +0530 | [diff] [blame] | 18 | {{ if .Values.initJob.enabled }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 19 | apiVersion: batch/v1 |
| 20 | kind: Job |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame] | 21 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 22 | spec: |
| 23 | backoffLimit: 20 |
| 24 | template: |
| 25 | metadata: |
| 26 | labels: |
| 27 | app: {{ include "common.name" . }}-job |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 28 | release: {{ include "common.release" . }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 29 | spec: |
| 30 | restartPolicy: Never |
| 31 | initContainers: |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 32 | - name: {{ include "common.name" . }}-init-readiness |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 33 | image: {{ include "repositoryGenerator.image.readiness" . }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 34 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 35 | command: |
| 36 | - /app/ready.py |
| 37 | args: |
| 38 | - --job-name |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame] | 39 | - {{ include "common.release" . }}-sdc-cs |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 40 | - "-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 |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 55 | containers: |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 56 | - 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 }} |
dasarathi528024 | 65e8f78 | 2023-05-03 09:51:20 +0000 | [diff] [blame] | 68 | volumeMounts: |
| 69 | - name: {{ include "common.fullname" . }}-cqlshrc |
| 70 | mountPath: /home/sdc/.cassandra |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 71 | env: |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 72 | - name: CS_HOST |
Andreas Geissler | fd450c4 | 2021-12-10 08:36:45 +0000 | [diff] [blame] | 73 | value: "{{ .Values.global.sdc_cassandra.serviceName }}" |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 74 | - name: CS_PORT |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 75 | value: {{ .Values.config.cassandraClientPort | quote }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 76 | - name: CS_AUTHENTICATE |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 77 | value: {{ .Values.config.cassandraAuthenticationEnabled | quote }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 78 | - name: CS_USER |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 79 | valueFrom: {secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 80 | - name: CS_PASSWORD |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 81 | valueFrom: {secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}} |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 82 | resources: {{ include "common.resources" . | nindent 10 }} |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 83 | {{ include "common.waitForJobContainer" . | indent 6 | trim }} |
vladimir turok | d804418 | 2023-07-27 16:28:36 +0200 | [diff] [blame^] | 84 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
dasarathi528024 | 65e8f78 | 2023-05-03 09:51:20 +0000 | [diff] [blame] | 85 | volumes: |
| 86 | - name: {{ include "common.fullname" . }}-cqlshrc |
| 87 | configMap: |
| 88 | name: {{ include "common.release" . }}-sdc-cqlshrc |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 89 | imagePullSecrets: |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 90 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
Mahendra Raghuwanshi | 35f83f5 | 2019-03-20 10:42:49 +0000 | [diff] [blame] | 91 | {{ end }} |