Jakub Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, AT&T, Bell Canada |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 3 | # Modifications Copyright © 2018 ZTE |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [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 | */}} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 17 | |
| 18 | apiVersion: batch/v1 |
| 19 | kind: Job |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame] | 20 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 21 | spec: |
Mike Elliott | 6482f50 | 2018-04-30 15:02:43 -0400 | [diff] [blame] | 22 | backoffLimit: 20 |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 23 | template: |
| 24 | metadata: |
| 25 | labels: |
| 26 | app: {{ include "common.name" . }}-job |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 27 | release: {{ include "common.release" . }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 28 | spec: |
| 29 | restartPolicy: Never |
| 30 | initContainers: |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 31 | - name: {{ include "common.name" . }}-job-completion |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 32 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 33 | imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}" |
| 34 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 35 | - /app/ready.py |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 36 | args: |
| 37 | - --job-name |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame] | 38 | - {{ include "common.release" . }}-sdc-cs |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 39 | - "-t" |
| 40 | - "20" |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 41 | env: |
| 42 | - name: NAMESPACE |
| 43 | valueFrom: |
| 44 | fieldRef: |
| 45 | apiVersion: v1 |
| 46 | fieldPath: metadata.namespace |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 47 | resources: |
| 48 | limits: |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame] | 49 | cpu: "100m" |
Andreas Geissler | 8cbb3d9 | 2024-03-12 16:44:56 +0100 | [diff] [blame] | 50 | memory: "500Mi" |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 51 | requests: |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame] | 52 | cpu: "3m" |
Andreas Geissler | 8cbb3d9 | 2024-03-12 16:44:56 +0100 | [diff] [blame] | 53 | memory: "20Mi" |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 54 | containers: |
| 55 | - name: {{ include "common.name" . }}-job |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 56 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.onboardingInitImage }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 57 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 58 | {{- 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 Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 65 | volumeMounts: |
| 66 | - name: {{ include "common.fullname" . }}-environments |
MichaelMorris | b137f7e | 2020-03-15 17:44:48 +0000 | [diff] [blame] | 67 | mountPath: /home/sdc/chef-solo/environments/ |
dasarathi528024 | 65e8f78 | 2023-05-03 09:51:20 +0000 | [diff] [blame] | 68 | - name: {{ include "common.fullname" . }}-cqlshrc |
| 69 | mountPath: /home/sdc/.cassandra |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 70 | env: |
| 71 | - name: ENVNAME |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 72 | value: {{ .Values.env.name }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 73 | - name: HOST_IP |
| 74 | valueFrom: |
| 75 | fieldRef: |
| 76 | fieldPath: status.podIP |
| 77 | - name: SDC_USER |
| 78 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 79 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 80 | - name: SDC_PASSWORD |
| 81 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 82 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 83 | - name: CS_PASSWORD |
| 84 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 85 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: cs_password} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 86 | - name: CS_HOST_IP |
Andreas Geissler | fd450c4 | 2021-12-10 08:36:45 +0000 | [diff] [blame] | 87 | value: "{{ .Values.global.sdc_cassandra.serviceName }}" |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 88 | resources: |
| 89 | limits: |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame] | 90 | cpu: "800m" |
| 91 | memory: "1Gi" |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 92 | requests: |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame] | 93 | cpu: "200m" |
Andreas Geissler | 8cbb3d9 | 2024-03-12 16:44:56 +0100 | [diff] [blame] | 94 | memory: "200Mi" |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 95 | {{ include "common.waitForJobContainer" . | indent 6 | trim }} |
vladimir turok | d804418 | 2023-07-27 16:28:36 +0200 | [diff] [blame] | 96 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 97 | volumes: |
| 98 | - name: {{ include "common.fullname" . }}-environments |
| 99 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 100 | name: {{ include "common.release" . }}-sdc-environments-configmap |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 101 | defaultMode: 0755 |
dasarathi528024 | 65e8f78 | 2023-05-03 09:51:20 +0000 | [diff] [blame] | 102 | - name: {{ include "common.fullname" . }}-cqlshrc |
| 103 | configMap: |
| 104 | name: {{ include "common.release" . }}-sdc-cqlshrc |
Andreas Geissler | bd0d31a | 2024-03-20 09:51:32 +0100 | [diff] [blame] | 105 | {{- include "common.imagePullSecrets" . | nindent 6 }} |