Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 1 | {{/* |
| 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 | |
| 17 | apiVersion: batch/v1 |
| 18 | kind: Job |
| 19 | metadata: |
| 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 Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 25 | release: {{ include "common.release" . }} |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 26 | heritage: {{ .Release.Service }} |
| 27 | spec: |
| 28 | replicas: {{ .Values.replicaCount }} |
| 29 | template: |
| 30 | metadata: |
| 31 | labels: |
| 32 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 33 | release: {{ include "common.release" . }} |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 34 | spec: |
| 35 | initContainers: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 36 | - image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 37 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 38 | name: {{ include "common.name" . }}-readiness |
| 39 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 40 | - /app/ready.py |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 41 | args: |
| 42 | - --container-name |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 43 | - "music-springboot" |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 44 | - --container-name |
| 45 | - "music-cassandra" |
| 46 | env: |
| 47 | - name: NAMESPACE |
| 48 | valueFrom: |
| 49 | fieldRef: |
| 50 | apiVersion: v1 |
| 51 | fieldPath: metadata.namespace |
| 52 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 53 | - /app/ready.py |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 54 | args: |
| 55 | - -j |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 56 | - "{{ include "common.release" . }}-music-cassandra-job-config" |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 57 | env: |
| 58 | - name: NAMESPACE |
| 59 | valueFrom: |
| 60 | fieldRef: |
| 61 | apiVersion: v1 |
| 62 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 63 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 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 }}" |
dkamdocs | 6ad3a1c | 2018-12-21 09:25:53 +0000 | [diff] [blame] | 68 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 69 | name: {{ include "common.name" . }}-onboard |
| 70 | command: |
| 71 | - "/bin/sh" |
| 72 | - "-c" |
| 73 | - | |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 74 | echo "job-onboard" |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 75 | 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: |
krishnaa96 | f122bbe | 2020-09-11 15:36:32 +0530 | [diff] [blame] | 84 | {{ include "common.resources" . | indent 10 }} |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 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: |
dkamdocs | 6ad3a1c | 2018-12-21 09:25:53 +0000 | [diff] [blame] | 105 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |