Jakub Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Mandeep Khinda | b1f9efe | 2018-03-28 19:01:55 +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 | b1f9efe | 2018-03-28 19:01:55 +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 | b1f9efe | 2018-03-28 19:01:55 +0000 | [diff] [blame] | 17 | |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 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 | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 21 | spec: |
Mike Elliott | 6482f50 | 2018-04-30 15:02:43 -0400 | [diff] [blame] | 22 | backoffLimit: 20 |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +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 | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 28 | spec: |
| 29 | restartPolicy: Never |
| 30 | initContainers: |
| 31 | - name: {{ include "common.name" . }}-init-readiness |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 32 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +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 | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 36 | args: |
| 37 | - --container-name |
Andreas Geissler | fd450c4 | 2021-12-10 08:36:45 +0000 | [diff] [blame] | 38 | {{- if .Values.global.sdc_cassandra.localCluster }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 39 | - sdc-cs |
Mahendra Raghuwanshi | 35f83f5 | 2019-03-20 10:42:49 +0000 | [diff] [blame] | 40 | {{- else }} |
| 41 | - cassandra |
| 42 | {{- end }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 43 | - "-t" |
| 44 | - "15" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 45 | env: |
| 46 | - name: NAMESPACE |
| 47 | valueFrom: |
| 48 | fieldRef: |
| 49 | apiVersion: v1 |
| 50 | fieldPath: metadata.namespace |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 51 | resources: |
| 52 | limits: |
| 53 | cpu: 100m |
| 54 | memory: 100Mi |
| 55 | requests: |
| 56 | cpu: 3m |
| 57 | memory: 20Mi |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 58 | containers: |
| 59 | - name: {{ include "common.name" . }}-job |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 60 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.cassandraInitImage }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 61 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 62 | volumeMounts: |
| 63 | - name: {{ include "common.fullname" . }}-environments |
MichaelMorris | b137f7e | 2020-03-15 17:44:48 +0000 | [diff] [blame] | 64 | mountPath: /home/sdc/chef-solo/environments/ |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 65 | - name: {{ include "common.fullname" . }}-chef-cache |
MichaelMorris | b137f7e | 2020-03-15 17:44:48 +0000 | [diff] [blame] | 66 | mountPath: /home/sdc/chef-solo/cache |
dasarathi528024 | 65e8f78 | 2023-05-03 09:51:20 +0000 | [diff] [blame] | 67 | - name: {{ include "common.fullname" . }}-cqlshrc |
| 68 | mountPath: /home/sdc/.cassandra |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 69 | env: |
| 70 | - name: ENVNAME |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 71 | value: {{ .Values.env.name }} |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 72 | - name: RELEASE |
| 73 | value: {{ .Values.config.release }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 74 | - name: SDC_USER |
| 75 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 76 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 77 | - name: SDC_PASSWORD |
| 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_password} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 80 | - name: CS_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: cs_password} |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 83 | - name: HOST_IP |
| 84 | valueFrom: |
| 85 | fieldRef: |
| 86 | fieldPath: status.podIP |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 87 | resources: |
| 88 | limits: |
| 89 | cpu: 800m |
| 90 | memory: 1024Mi |
| 91 | requests: |
| 92 | cpu: 200m |
| 93 | memory: 300Mi |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 94 | {{ include "common.waitForJobContainer" . | indent 6 | trim }} |
farida azmy | 1383b4c | 2021-04-06 12:33:31 +0200 | [diff] [blame] | 95 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 96 | volumes: |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 97 | - name: {{ include "common.fullname" . }}-environments |
| 98 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 99 | name: {{ include "common.release" . }}-sdc-environments-configmap |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 100 | defaultMode: 0755 |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 101 | - name: {{ include "common.fullname" . }}-chef-cache |
| 102 | emptyDir: {} |
dasarathi528024 | 65e8f78 | 2023-05-03 09:51:20 +0000 | [diff] [blame] | 103 | - name: {{ include "common.fullname" . }}-cqlshrc |
| 104 | configMap: |
| 105 | name: {{ include "common.release" . }}-sdc-cqlshrc |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 106 | imagePullSecrets: |
| 107 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
| 108 | restartPolicy: Never |