Merge "[AAI|ROBOT] track latest commits on submodules" into elalto
[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   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": "-5"
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
28       containers:
29       - name: post-install-job
30         image: "{{ include "common.repository" . }}/{{ .Values.global.clientImage }}"
31         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
32         env:
33         - name: DELAY
34           value: "0"
35 # hack explanation:
36 # since the dmaap-bc SSL certificate is expired in this release, we
37 # pass the -k flag to ignore the cert check error.
38 # AFAIK, this post-install script is the only client which actually
39 # uses https (against dmaap-bc API) in El Alto Release.
40 # So, this workaround is the easiest way out for me.
41 # Also note that the only reason to even deploy dmaap-bc is if you
42 # need authenticated topics in message-router, or a feed in data-router.
43 # If that is not your case, then don't even deploy dmaap-bc.
44         - name: PROTO
45           value: "-k https"
46         - name: PORT
47           value: "8443"
48         - name: REQUESTID
49           value: "{{.Chart.Name}}-post-install"
50         volumeMounts:
51         - mountPath: /etc/localtime
52           name: localtime
53           readOnly: true
54
55 # NOTE: on the following several configMaps, careful to include / at end
56 #       since there may be more than one file in each mountPath
57 # NOTE: the basename of the subdirectory of mountPath is important - it matches the DBCL API URI
58         - name:  {{ include "common.fullname" . }}-dbc-dmaap
59           mountPath: /opt/app/config/dmaap/
60         - name:  {{ include "common.fullname" . }}-dbc-dcaelocations
61           mountPath: /opt/app/config/dcaeLocations/
62         resources:
63 {{ include "common.resources" . | indent 10 }}
64         {{- if .Values.nodeSelector }}
65       nodeSelector:
66 {{ toYaml .Values.nodeSelector | indent 8 }}
67         {{- end -}}
68         {{- if .Values.affinity }}
69       affinity:
70 {{ toYaml .Values.affinity | indent 8 }}
71         {{- end }}
72       volumes:
73         - name: localtime
74           hostPath:
75             path: /etc/localtime
76         - name: {{ include "common.fullname" . }}-dbc-dmaap
77           configMap:
78             name: {{ include "common.fullname" . }}-dbc-dmaap
79         - name: {{ include "common.fullname" . }}-dbc-dcaelocations
80           configMap:
81             name: {{ include "common.fullname" . }}-dbc-dcaelocations
82       imagePullSecrets:
83       - name: "{{ include "common.namespace" . }}-docker-registry-key"