DMAAP changes
[oom.git] / kubernetes / dmaap / components / dmaap-dr-node / templates / post-install-job.yaml
1 apiVersion: batch/v1
2 kind: Job
3 metadata:
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
13     "helm.sh/hook-weight": "-2"
14     "helm.sh/hook-delete-policy": hook-succeeded
15 spec:
16   template:
17     metadata:
18       name: {{ include "common.fullname" . }}
19       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 }}"
28         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
29         env:
30         - name: DELAY
31           value: "60"
32         - name: PROTO
33           value: "http"
34         - name: PORT
35           value: "8080"
36         - name: REQUESTID
37           value: "{{.Chart.Name}}-post-install"
38
39         volumeMounts:
40         - mountPath: /etc/localtime
41           name: localtime
42           readOnly: true
43
44 # NOTE: on the following several configMaps, careful to include / at end
45 #       since there may be more than one file in each mountPath
46 # NOTE: the basename of the subdirectory is important - it matches the DBCL API URI
47         - name: {{ include "common.fullname" . }}-dbc-drnodes
48           mountPath: /opt/app/config/dr_nodes/
49         resources:
50 {{ include "common.resources" . | indent 10 }}
51         {{- if .Values.nodeSelector }}
52       nodeSelector:
53 {{ toYaml .Values.nodeSelector | indent 8 }}
54         {{- end -}}
55         {{- if .Values.affinity }}
56       affinity:
57 {{ toYaml .Values.affinity | indent 8 }}
58         {{- end }}
59       volumes:
60         - name: localtime
61           hostPath:
62             path: /etc/localtime
63         - name: {{ include "common.fullname" . }}-dbc-drnodes
64           configMap:
65             name: {{ include "common.fullname" . }}-dbc-drnodes
66       imagePullSecrets:
67       - name: "{{ include "common.namespace" . }}-docker-registry-key"