[DMAAP] Use common aaf template in dmaap-bc
[oom.git] / kubernetes / dmaap / components / dmaap-bc / templates / post-install-job.yaml
1 apiVersion: batch/v1
2 kind: Job
3 metadata:
4   name: {{ include "common.fullname" . }}-post-install
5   namespace: {{ include "common.namespace" . }}
6   labels: {{- include "common.labels" . | nindent 4 }}
7   annotations:
8     # This is what defines this resource as a hook. Without this line, the
9     # job is considered part of the release.
10     "helm.sh/hook": post-install
11     "helm.sh/hook-weight": "-5"
12     "helm.sh/hook-delete-policy": hook-succeeded
13 spec:
14   template:
15     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
16     spec:
17       restartPolicy: Never
18       containers:
19       - name: post-install-job
20         image: "{{ include "common.repository" . }}/{{ .Values.global.clientImage }}"
21         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
22         env:
23         - name: DELAY
24           value: "0"
25         - name: PROTO
26 {{- if (include "common.needTLS" .) }}
27           value: "https"
28         - name: PORT
29           value: "8443"
30 {{- else }}
31           value: "http"
32         - name: PORT
33           value: "8080"
34 {{- end }}
35         - name: REQUESTID
36           value: "{{.Chart.Name}}-post-install"
37         volumeMounts:
38         - mountPath: /etc/localtime
39           name: localtime
40           readOnly: true
41
42 # NOTE: on the following several configMaps, careful to include / at end
43 #       since there may be more than one file in each mountPath
44 # NOTE: the basename of the subdirectory of mountPath is important - it matches the DBCL API URI
45         - name:  {{ include "common.fullname" . }}-dbc-dmaap
46           mountPath: /opt/app/config/dmaap/
47         - name:  {{ include "common.fullname" . }}-dbc-dcaelocations
48           mountPath: /opt/app/config/dcaeLocations/
49         resources: {{ include "common.resources" . | nindent 10 }}
50         {{- if .Values.nodeSelector }}
51       nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
52         {{- end -}}
53         {{- if .Values.affinity }}
54       affinity: {{ toYaml .Values.affinity | nindent 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"