blob: 6ec282e44e57a99f36c6495680734a743010d558 [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 "+" "_" }}
25 release: {{ .Release.Name }}
26 heritage: {{ .Release.Service }}
27spec:
28 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}-job
32 release: {{ .Release.Name }}
33 spec:
34 restartPolicy: Never
35 initContainers:
36 - name: {{ include "common.name" . }}-readiness
37 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
38 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
39 command:
40 - /root/ready.py
41 args:
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
52 image: "{{ .Values.global.repository }}/{{ .Values.job.cassandra.image }}"
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 }}"
65 - name: DELAY
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"
88