blob: f428491127bcde43a05e863263cbf2b24ef6548f [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}}"
Ondřej Šmalec21a2b5e2019-08-14 15:50:06 +02009 release: {{ .Release.Name }}
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": "-4"
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 }}
22 app.kubernetes.io/instance: {{.Release.Name | quote }}
23 helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}"
Ondřej Šmalec21a2b5e2019-08-14 15:50:06 +020024 release: {{ .Release.Name }}
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: "Always"
dglFromAtt671f59b2019-03-13 15:50:40 +000031 env:
32 - name: DELAY
sunil.unnava02f077e2019-03-28 20:50:29 -040033 value: "30"
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 volumeMounts:
43 - mountPath: /etc/localtime
44 name: localtime
45 readOnly: true
46
47# NOTE: on the following several configMaps, careful to include / at end
48# since there may be more than one file in each mountPath
49# NOTE: the basename of the subdirectory of mountPath is important - it matches the DBCL API URI
50 - name: {{ include "common.fullname" . }}-dbc-mrclusters
51 mountPath: /opt/app/config/mr_clusters/
52 - name: {{ include "common.fullname" . }}-dbc-topics
53 mountPath: /opt/app/config/topics/
54 resources:
55{{ include "common.resources" . | indent 10 }}
56 {{- if .Values.nodeSelector }}
57 nodeSelector:
58{{ toYaml .Values.nodeSelector | indent 8 }}
59 {{- end -}}
60 {{- if .Values.affinity }}
61 affinity:
62{{ toYaml .Values.affinity | indent 8 }}
63 {{- end }}
64 volumes:
65 - name: localtime
66 hostPath:
67 path: /etc/localtime
68 - name: {{ include "common.fullname" . }}-dbc-mrclusters
69 configMap:
70 name: {{ include "common.fullname" . }}-dbc-mrclusters
71 - name: {{ include "common.fullname" . }}-dbc-topics
72 configMap:
73 name: {{ include "common.fullname" . }}-dbc-topics
74 imagePullSecrets:
75 - name: "{{ include "common.namespace" . }}-docker-registry-key"