blob: c06d4e1130091601c4d3c389b9a097aa2828d5e4 [file] [log] [blame]
dglFromAtt671f59b2019-03-13 15:50:40 +00001apiVersion: batch/v1
2kind: Job
3metadata:
4 name: {{ include "common.fullname" . }}-post-install
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +01005 namespace: {{ include "common.namespace" . }}
6 labels: {{- include "common.labels" . | nindent 4 }}
dglFromAtt671f59b2019-03-13 15:50:40 +00007 annotations:
8 # This is what defines this resource as a hook. Without this line, the
9 # job is considered part of the release.
10 "helm.sh/hook": post-install
11 "helm.sh/hook-weight": "-5"
12 "helm.sh/hook-delete-policy": hook-succeeded
13spec:
14 template:
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010015 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
dglFromAtt671f59b2019-03-13 15:50:40 +000016 spec:
17 restartPolicy: Never
dglFromAtt671f59b2019-03-13 15:50:40 +000018 containers:
19 - name: post-install-job
20 image: "{{ include "common.repository" . }}/{{ .Values.global.clientImage }}"
sunil.unnava02f077e2019-03-28 20:50:29 -040021 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
dglFromAtt671f59b2019-03-13 15:50:40 +000022 env:
23 - name: DELAY
24 value: "0"
sunil.unnava02f077e2019-03-28 20:50:29 -040025 - name: PROTO
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010026{{- if (include "common.needTLS" .) }}
pkarascd790842019-04-18 10:21:40 +020027 value: "https"
sunil.unnava02f077e2019-03-28 20:50:29 -040028 - name: PORT
pkarascd790842019-04-18 10:21:40 +020029 value: "8443"
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010030{{- else }}
31 value: "http"
32 - name: PORT
33 value: "8080"
34{{- end }}
dglFromAtt671f59b2019-03-13 15:50:40 +000035 - name: REQUESTID
36 value: "{{.Chart.Name}}-post-install"
37 volumeMounts:
38 - mountPath: /etc/localtime
39 name: localtime
40 readOnly: true
41
42# NOTE: on the following several configMaps, careful to include / at end
43# since there may be more than one file in each mountPath
44# NOTE: the basename of the subdirectory of mountPath is important - it matches the DBCL API URI
45 - name: {{ include "common.fullname" . }}-dbc-dmaap
46 mountPath: /opt/app/config/dmaap/
47 - name: {{ include "common.fullname" . }}-dbc-dcaelocations
48 mountPath: /opt/app/config/dcaeLocations/
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010049 resources: {{ include "common.resources" . | nindent 10 }}
dglFromAtt671f59b2019-03-13 15:50:40 +000050 {{- if .Values.nodeSelector }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010051 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
dglFromAtt671f59b2019-03-13 15:50:40 +000052 {{- end -}}
53 {{- if .Values.affinity }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010054 affinity: {{ toYaml .Values.affinity | nindent 8 }}
dglFromAtt671f59b2019-03-13 15:50:40 +000055 {{- end }}
56 volumes:
57 - name: localtime
58 hostPath:
59 path: /etc/localtime
60 - name: {{ include "common.fullname" . }}-dbc-dmaap
61 configMap:
62 name: {{ include "common.fullname" . }}-dbc-dmaap
63 - name: {{ include "common.fullname" . }}-dbc-dcaelocations
64 configMap:
65 name: {{ include "common.fullname" . }}-dbc-dcaelocations
66 imagePullSecrets:
67 - name: "{{ include "common.namespace" . }}-docker-registry-key"