blob: ad42a1fe08463f0ae240106bf80b7ed0b4e40666 [file] [log] [blame]
Dileep Ranganathan61225cb2018-10-01 08:14:16 -07001{{/*
2# Copyright 2018 Intel Corporation, Inc
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" . }}-onboard
21 namespace: {{ include "common.namespace" . }}
22 labels:
23 app: {{ include "common.name" . }}
24 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070026 heritage: {{ .Release.Service }}
27spec:
28 replicas: {{ .Values.replicaCount }}
29 template:
30 metadata:
31 labels:
32 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010033 release: {{ include "common.release" . }}
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070034 spec:
35 initContainers:
36 - image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
37 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38 name: {{ include "common.name" . }}-readiness
39 command:
40 - /root/ready.py
41 args:
42 - --container-name
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000043 - "music-springboot"
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070044 - --container-name
45 - "music-cassandra"
46 env:
47 - name: NAMESPACE
48 valueFrom:
49 fieldRef:
50 apiVersion: v1
51 fieldPath: metadata.namespace
52 - command:
53 - /root/job_complete.py
54 args:
55 - -j
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010056 - "{{ include "common.release" . }}-music-cassandra-job-config"
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070057 env:
58 - name: NAMESPACE
59 valueFrom:
60 fieldRef:
61 apiVersion: v1
62 fieldPath: metadata.namespace
63 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
64 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
65 name: {{ include "common.name" . }}-music-db-readiness
66 containers:
67 - image: "{{ include "common.repository" . }}/{{ .Values.global.image.optf_has }}"
dkamdocs6ad3a1c2018-12-21 09:25:53 +000068 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070069 name: {{ include "common.name" . }}-onboard
70 command:
71 - "/bin/sh"
72 - "-c"
73 - |
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000074 echo "job-onboard"
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070075 workingDir: /has
76 volumeMounts:
77 - mountPath: /etc/localtime
78 name: localtime
79 readOnly: true
80 - mountPath: /has/onboard.json
81 name: {{ .Values.global.commonConfigPrefix }}-config
82 subPath: onboard.json
83 resources:
84{{ toYaml .Values.resources | indent 10 }}
85 nodeSelector:
86 {{- if .Values.nodeSelector }}
87{{ toYaml .Values.nodeSelector | indent 8 }}
88 {{- end -}}
89 {{- if .Values.affinity }}
90 affinity:
91{{ toYaml .Values.affinity | indent 8 }}
92 {{- end }}
93 volumes:
94 - name: localtime
95 hostPath:
96 path: /etc/localtime
97 - name: {{ .Values.global.commonConfigPrefix }}-config
98 configMap:
99 name: {{ .Values.global.commonConfigPrefix }}-configmap
100 items:
101 - key: onboard.json
102 path: onboard.json
103 restartPolicy: OnFailure
104 imagePullSecrets:
dkamdocs6ad3a1c2018-12-21 09:25:53 +0000105 - name: "{{ include "common.namespace" . }}-docker-registry-key"