Merge "Attempt2: Post-install jobs for DMaaP Provisioning"
[oom.git] / kubernetes / dmaap / components / dbc / 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": "-5"
14     "helm.sh/hook-delete-policy": hook-succeeded
15 spec:
16   template:
17     metadata:
18       name: "{{.Release.Name}}"
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
26       containers:
27       - name: post-install-job
28         image: "{{ include "common.repository" . }}/{{ .Values.global.clientImage }}"
29         env:
30         - name: DELAY
31           value: "0"
32         - name: REQUESTID
33           value: "{{.Chart.Name}}-post-install"
34         volumeMounts:
35         - mountPath: /etc/localtime
36           name: localtime
37           readOnly: true
38
39 # NOTE: on the following several configMaps, careful to include / at end
40 #       since there may be more than one file in each mountPath
41 # NOTE: the basename of the subdirectory of mountPath is important - it matches the DBCL API URI
42         - name:  {{ include "common.fullname" . }}-dbc-dmaap
43           mountPath: /opt/app/config/dmaap/
44         - name:  {{ include "common.fullname" . }}-dbc-dcaelocations
45           mountPath: /opt/app/config/dcaeLocations/
46         resources:
47 {{ include "common.resources" . | indent 10 }}
48         {{- if .Values.nodeSelector }}
49       nodeSelector:
50 {{ toYaml .Values.nodeSelector | indent 8 }}
51         {{- end -}}
52         {{- if .Values.affinity }}
53       affinity:
54 {{ toYaml .Values.affinity | indent 8 }}
55         {{- 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"