blob: e411b2b4e7c7c76ddd798d6140298c7518d01c1f [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 }}
7 app.kubernetes.io/instance: {{.Release.Name | quote }}
8 helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}"
9 annotations:
10 # This is what defines this resource as a hook. Without this line, the
11 # job is considered part of the release.
12 "helm.sh/hook": post-install
sunil.unnava02f077e2019-03-28 20:50:29 -040013 "helm.sh/hook-weight": "-3"
dglFromAtt671f59b2019-03-13 15:50:40 +000014 "helm.sh/hook-delete-policy": hook-succeeded
15spec:
16 template:
17 metadata:
dglFromAtt655708d2019-03-18 16:30:47 +000018 name: {{ include "common.fullname" . }}
dglFromAtt671f59b2019-03-13 15:50:40 +000019 labels:
20 app.kubernetes.io/managed-by: {{.Release.Service | quote }}
21 app.kubernetes.io/instance: {{.Release.Name | quote }}
22 helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}"
23 spec:
24 restartPolicy: Never
25 containers:
26 - name: post-install-job
27 image: "{{ include "common.repository" . }}/{{ .Values.global.clientImage }}"
sunil.unnava02f077e2019-03-28 20:50:29 -040028 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
dglFromAtt671f59b2019-03-13 15:50:40 +000029 env:
30 - name: DELAY
31 value: "30"
efiacor338e9662019-05-15 10:48:17 +000032 {{- if .Values.global.allow_http }}
sunil.unnava02f077e2019-03-28 20:50:29 -040033 - name: PROTO
34 value: "http"
35 - name: PORT
36 value: "8080"
efiacor338e9662019-05-15 10:48:17 +000037 {{ end }}
dglFromAtt671f59b2019-03-13 15:50:40 +000038 - name: REQUESTID
39 value: "{{.Chart.Name}}-post-install"
40
41 volumeMounts:
42 - mountPath: /etc/localtime
43 name: localtime
44 readOnly: true
45
46# NOTE: on the following several configMaps, careful to include / at end
47# since there may be more than one file in each mountPath
48# NOTE: the basename of the subdirectory is important - it matches the DBCL API URI
49 - name: {{ include "common.fullname" . }}-dbc-feeds
50 mountPath: /opt/app/config/feeds/
51 - name: {{ include "common.fullname" . }}-dbc-drpubs
52 mountPath: /opt/app/config/dr_pubs/
53 - name: {{ include "common.fullname" . }}-dbc-drsubs
54 mountPath: /opt/app/config/dr_subs/
55 resources:
56{{ include "common.resources" . | indent 10 }}
57 {{- if .Values.nodeSelector }}
58 nodeSelector:
59{{ toYaml .Values.nodeSelector | indent 8 }}
60 {{- end -}}
61 {{- if .Values.affinity }}
62 affinity:
63{{ toYaml .Values.affinity | indent 8 }}
64 {{- end }}
65 volumes:
66 - name: localtime
67 hostPath:
68 path: /etc/localtime
dglFromAtt671f59b2019-03-13 15:50:40 +000069 - name: {{ include "common.fullname" . }}-dbc-feeds
70 configMap:
71 name: {{ include "common.fullname" . }}-dbc-feeds
72 - name: {{ include "common.fullname" . }}-dbc-drpubs
73 configMap:
74 name: {{ include "common.fullname" . }}-dbc-drpubs
75 - name: {{ include "common.fullname" . }}-dbc-drsubs
76 configMap:
77 name: {{ include "common.fullname" . }}-dbc-drsubs
78 imagePullSecrets:
79 - name: "{{ include "common.namespace" . }}-docker-registry-key"