blob: e63aeb369aa87199c90f431f7f87860610dcfcc1 [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:
Sylvain Desbureaux01c711e2020-11-21 21:47:01 +010036 - image: {{ include "repositoryGenerator.image.readiness" . }}
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070037 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38 name: {{ include "common.name" . }}-readiness
39 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020040 - /app/ready.py
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070041 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:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020053 - /app/ready.py
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070054 args:
55 - -j
Sylvain Desbureaux589ecb92020-11-19 17:19:06 +010056 - "{{ include "common.release" . }}-music-cassandra-config"
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070057 env:
58 - name: NAMESPACE
59 valueFrom:
60 fieldRef:
61 apiVersion: v1
62 fieldPath: metadata.namespace
Sylvain Desbureaux01c711e2020-11-21 21:47:01 +010063 image: {{ include "repositoryGenerator.image.readiness" . }}
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070064 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
65 name: {{ include "common.name" . }}-music-db-readiness
66 containers:
Sylvain Desbureaux01c711e2020-11-21 21:47:01 +010067 - image: {{ include "repositoryGenerator.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:
krishnaa96f122bbe2020-09-11 15:36:32 +053084{{ include "common.resources" . | indent 10 }}
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070085 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"