Merge "el-alto early release build for osdf and has"
[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     release: {{ .Release.Name }}
10   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
14     "helm.sh/hook-weight": "-2"
15     "helm.sh/hook-delete-policy": hook-succeeded
16 spec:
17   template:
18     metadata:
19       name: {{ include "common.fullname" . }}
20       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}}"
24         release: {{ .Release.Name }}
25     spec:
26       restartPolicy: Never
27       containers:
28       - name: post-install-job
29         image: "{{ include "common.repository" . }}/{{ .Values.global.clientImage }}"
30         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
31         env:
32         - name: DELAY
33           value: "60"
34     {{- if .Values.global.allow_http }}
35         - name: PROTO
36           value: "http"
37         - name: PORT
38           value: "8080"
39     {{ end }}
40         - name: REQUESTID
41           value: "{{.Chart.Name}}-post-install"
42
43         volumeMounts:
44         - mountPath: /etc/localtime
45           name: localtime
46           readOnly: true
47
48 # NOTE: on the following several configMaps, careful to include / at end
49 #       since there may be more than one file in each mountPath
50 # NOTE: the basename of the subdirectory is important - it matches the DBCL API URI
51         - name: {{ include "common.fullname" . }}-dbc-drnodes
52           mountPath: /opt/app/config/dr_nodes/
53         resources:
54 {{ include "common.resources" . | indent 10 }}
55         {{- if .Values.nodeSelector }}
56       nodeSelector:
57 {{ toYaml .Values.nodeSelector | indent 8 }}
58         {{- end -}}
59         {{- if .Values.affinity }}
60       affinity:
61 {{ toYaml .Values.affinity | indent 8 }}
62         {{- end }}
63       volumes:
64         - name: localtime
65           hostPath:
66             path: /etc/localtime
67         - name: {{ include "common.fullname" . }}-dbc-drnodes
68           configMap:
69             name: {{ include "common.fullname" . }}-dbc-drnodes
70       imagePullSecrets:
71       - name: "{{ include "common.namespace" . }}-docker-registry-key"