Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 1 | {{/* |
| 2 | # Copyright © 2018 AT&T, Amdocs, Bell Canada Intellectual Property. All rights reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | */}} |
| 16 | |
| 17 | apiVersion: batch/v1 |
| 18 | kind: Job |
| 19 | metadata: |
| 20 | name: {{ include "common.fullname" . }}-config |
| 21 | namespace: {{ include "common.namespace" . }} |
| 22 | labels: |
| 23 | app: {{ include "common.name" . }}-job |
| 24 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 25 | release: {{ include "common.release" . }} |
Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 26 | heritage: {{ .Release.Service }} |
| 27 | spec: |
| 28 | template: |
| 29 | metadata: |
| 30 | labels: |
| 31 | app: {{ include "common.name" . }}-job |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 32 | release: {{ include "common.release" . }} |
Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 33 | spec: |
| 34 | restartPolicy: Never |
| 35 | initContainers: |
| 36 | - name: {{ include "common.name" . }}-readiness |
Sylvain Desbureaux | 589ecb9 | 2020-11-19 17:19:06 +0100 | [diff] [blame] | 37 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 38 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 39 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 40 | - /app/ready.py |
Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 41 | args: |
Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 42 | - --container-name |
| 43 | - music-cassandra |
| 44 | env: |
| 45 | - name: NAMESPACE |
| 46 | valueFrom: |
| 47 | fieldRef: |
| 48 | apiVersion: v1 |
| 49 | fieldPath: metadata.namespace |
| 50 | containers: |
| 51 | - name: {{ include "common.name" . }}-update-job |
Sylvain Desbureaux | 589ecb9 | 2020-11-19 17:19:06 +0100 | [diff] [blame] | 52 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.job.image }} |
Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 53 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 54 | env: |
| 55 | - name: CASS_HOSTNAME |
| 56 | value: "{{ .Values.job.host }}" |
| 57 | - name: USERNAME |
| 58 | value: "{{ .Values.cql.adminUser.username }}" |
| 59 | - name: PORT |
| 60 | value: "{{ .Values.job.port }}" |
| 61 | - name: PASSWORD |
| 62 | value: "{{ .Values.cql.adminUser.password }}" |
| 63 | - name: TIMEOUT |
| 64 | value: "{{ .Values.job.timeout }}" |
Sylvain Desbureaux | 589ecb9 | 2020-11-19 17:19:06 +0100 | [diff] [blame] | 65 | - name: DELAY |
Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 66 | value: "{{ .Values.job.delay }}" |
| 67 | volumeMounts: |
| 68 | # Admin cql Files that setup Admin Keyspace and Change Admin user. |
| 69 | - name: {{ include "common.name" . }}-cql |
| 70 | mountPath: /cql/admin.cql |
| 71 | subPath: admin.cql |
| 72 | - name: {{ include "common.name" . }}-cql |
| 73 | mountPath: /cql/admin_pw.cql |
| 74 | subPath: admin_pw.cql |
| 75 | # This is where Apps or MISC will put any of their own startup cql scripts. |
| 76 | - name: {{ include "common.name" . }}-extra-cql |
| 77 | mountPath: /cql/extra |
| 78 | volumes: |
| 79 | - name: {{ include "common.name" . }}-cql |
| 80 | configMap: |
| 81 | name: {{ include "common.fullname" . }}-cql |
| 82 | - name: {{ include "common.name" . }}-extra-cql |
| 83 | configMap: |
| 84 | name: {{ include "common.fullname" . }}-extra-cql |
| 85 | restartPolicy: Never |
| 86 | imagePullSecrets: |
| 87 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |