blob: e9ab9c96fe3c234bfec126c52f96a4f607c0bbe4 [file] [log] [blame]
dglFromAtt671f59b2019-03-13 15:50:40 +00001apiVersion: batch/v1
2kind: Job
3metadata:
4 name: {{ include "common.fullname" . }}-post-install
5 labels:
6 app.kubernetes.io/managed-by: {{.Release.Service | quote }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +01007 app.kubernetes.io/instance: {{include "common.release" . | quote }}
dglFromAtt671f59b2019-03-13 15:50:40 +00008 helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}"
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +01009 release: {{ include "common.release" . }}
dglFromAtt671f59b2019-03-13 15:50:40 +000010 annotations:
11 # This is what defines this resource as a hook. Without this line, the
12 # job is considered part of the release.
13 "helm.sh/hook": post-install
sunil.unnava02f077e2019-03-28 20:50:29 -040014 "helm.sh/hook-weight": "-2"
dglFromAtt671f59b2019-03-13 15:50:40 +000015 "helm.sh/hook-delete-policy": hook-succeeded
16spec:
17 template:
18 metadata:
dglFromAtt655708d2019-03-18 16:30:47 +000019 name: {{ include "common.fullname" . }}
dglFromAtt671f59b2019-03-13 15:50:40 +000020 labels:
21 app.kubernetes.io/managed-by: {{.Release.Service | quote }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010022 app.kubernetes.io/instance: {{include "common.release" . | quote }}
dglFromAtt671f59b2019-03-13 15:50:40 +000023 helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}"
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
dglFromAtt671f59b2019-03-13 15:50:40 +000025 spec:
26 restartPolicy: Never
27 containers:
28 - name: post-install-job
29 image: "{{ include "common.repository" . }}/{{ .Values.global.clientImage }}"
sunil.unnava02f077e2019-03-28 20:50:29 -040030 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
dglFromAtt671f59b2019-03-13 15:50:40 +000031 env:
32 - name: DELAY
33 value: "60"
efiacor338e9662019-05-15 10:48:17 +000034 {{- if .Values.global.allow_http }}
sunil.unnava02f077e2019-03-28 20:50:29 -040035 - name: PROTO
36 value: "http"
37 - name: PORT
38 value: "8080"
efiacor338e9662019-05-15 10:48:17 +000039 {{ end }}
dglFromAtt671f59b2019-03-13 15:50:40 +000040 - name: REQUESTID
41 value: "{{.Chart.Name}}-post-install"
42
43 volumeMounts:
44 - mountPath: /etc/localtime
45 name: localtime
46 readOnly: true
47
48# NOTE: on the following several configMaps, careful to include / at end
49# since there may be more than one file in each mountPath
50# NOTE: the basename of the subdirectory is important - it matches the DBCL API URI
51 - name: {{ include "common.fullname" . }}-dbc-drnodes
52 mountPath: /opt/app/config/dr_nodes/
53 resources:
54{{ include "common.resources" . | indent 10 }}
55 {{- if .Values.nodeSelector }}
56 nodeSelector:
57{{ toYaml .Values.nodeSelector | indent 8 }}
58 {{- end -}}
59 {{- if .Values.affinity }}
60 affinity:
61{{ toYaml .Values.affinity | indent 8 }}
62 {{- end }}
63 volumes:
64 - name: localtime
65 hostPath:
66 path: /etc/localtime
67 - name: {{ include "common.fullname" . }}-dbc-drnodes
68 configMap:
69 name: {{ include "common.fullname" . }}-dbc-drnodes
70 imagePullSecrets:
71 - name: "{{ include "common.namespace" . }}-docker-registry-key"