c6fa76ce72f4d863c52a92b83d3e1a9a02903fc9
[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": "-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       containers:
26       - name: post-install-job
27         image: "{{ include "common.repository" . }}/{{ .Values.global.clientImage }}"
28         env:
29         - name: DELAY
30           value: "60"
31         - name: REQUESTID
32           value: "{{.Chart.Name}}-post-install"
33
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 is important - it matches the DBCL API URI
42         - name: {{ include "common.fullname" . }}-dbc-drnodes
43           mountPath: /opt/app/config/dr_nodes/
44         resources:
45 {{ include "common.resources" . | indent 10 }}
46         {{- if .Values.nodeSelector }}
47       nodeSelector:
48 {{ toYaml .Values.nodeSelector | indent 8 }}
49         {{- end -}}
50         {{- if .Values.affinity }}
51       affinity:
52 {{ toYaml .Values.affinity | indent 8 }}
53         {{- end }}
54       volumes:
55         - name: localtime
56           hostPath:
57             path: /etc/localtime
58         - name: {{ include "common.fullname" . }}-dbc-drnodes
59           configMap:
60             name: {{ include "common.fullname" . }}-dbc-drnodes
61       imagePullSecrets:
62       - name: "{{ include "common.namespace" . }}-docker-registry-key"