blob: d3c89d4a59e7346fff34ac97c3277d18ca9ed34d [file] [log] [blame]
Nelson,Thomas(tn1381)(arthurdent3)4807fdf2018-09-19 16:52:36 -04001{{/*
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
17apiVersion: batch/v1
18kind: Job
19metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
Nelson,Thomas(tn1381)(arthurdent3)4807fdf2018-09-19 16:52:36 -040026 heritage: {{ .Release.Service }}
27spec:
28 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}-job
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010032 release: {{ include "common.release" . }}
Nelson,Thomas(tn1381)(arthurdent3)4807fdf2018-09-19 16:52:36 -040033 spec:
34 restartPolicy: Never
35 initContainers:
36 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureaux589ecb92020-11-19 17:19:06 +010037 image: {{ include "repositoryGenerator.image.readiness" . }}
Nelson,Thomas(tn1381)(arthurdent3)4807fdf2018-09-19 16:52:36 -040038 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
39 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020040 - /app/ready.py
Nelson,Thomas(tn1381)(arthurdent3)4807fdf2018-09-19 16:52:36 -040041 args:
Nelson,Thomas(tn1381)(arthurdent3)4807fdf2018-09-19 16:52:36 -040042 - --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 Desbureaux589ecb92020-11-19 17:19:06 +010052 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.job.image }}
Nelson,Thomas(tn1381)(arthurdent3)4807fdf2018-09-19 16:52:36 -040053 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 Desbureaux589ecb92020-11-19 17:19:06 +010065 - name: DELAY
Nelson,Thomas(tn1381)(arthurdent3)4807fdf2018-09-19 16:52:36 -040066 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"