Merge "Update data-router to use HTTPS DMaaP"
[oom.git] / kubernetes / aai / charts / aai-data-router / templates / deployment.yaml
1 # Copyright © 2017 Amdocs, Bell Canada
2 # Modifications Copyright © 2018 AT&T
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 apiVersion: extensions/v1beta1
17 kind: Deployment
18 metadata:
19   name: {{ include "common.fullname" . }}
20   namespace: {{ include "common.namespace" . }}
21   labels:
22     app: {{ include "common.name" . }}
23     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24     release: {{ .Release.Name }}
25     heritage: {{ .Release.Service }}
26 spec:
27   replicas: {{ .Values.replicaCount }}
28   selector:
29     matchLabels:
30       app: {{ include "common.name" . }}
31   template:
32     metadata:
33       labels:
34         app: {{ include "common.name" . }}
35         release: {{ .Release.Name }}
36       name: {{ include "common.name" . }}
37     spec:
38       initContainers:
39       - command:
40         - /bin/sh
41         - -c
42         - |
43           mkdir -p /logroot/data-router/logs
44           chmod -R 777 /logroot/data-router/logs
45           chown -R root:root /logroot
46         env:
47         - name: NAMESPACE
48           valueFrom:
49             fieldRef:
50               apiVersion: v1
51               fieldPath: metadata.namespace
52         securityContext:
53           privileged: true
54         image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }}
55         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
56         name: init-sysctl
57         volumeMounts:
58         - name: {{ include "common.fullname" . }}-logs
59           mountPath: /logroot/
60       containers:
61       - name: {{ include "common.name" . }}
62         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
63         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
64         env:
65         - name: SERVICE_BEANS
66           value: /opt/app/data-router/dynamic/conf
67         - name: CONFIG_HOME
68           value: /opt/app/data-router/config/
69         - name: KEY_STORE_PASSWORD
70           value: {{ .Values.config.keyStorePassword }}
71         - name: DYNAMIC_ROUTES
72           value: /opt/app/data-router/dynamic/routes
73         - name: KEY_MANAGER_PASSWORD
74           value: {{ .Values.config.keyManagerPassword }}
75         - name: PATH
76           value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
77         - name: JAVA_HOME
78           value: usr/lib/jvm/java-8-openjdk-amd64
79         volumeMounts:
80         - mountPath: /etc/localtime
81           name: localtime
82           readOnly: true
83         - mountPath:  /opt/app/data-router/config/auth
84           name: {{ include "common.fullname" . }}-auth
85         - mountPath:  /opt/app/data-router/config/data-router.properties
86           subPath: data-router.properties
87           name: {{ include "common.fullname" . }}-properties
88         - mountPath:  /opt/app/data-router/config/schemaIngest.properties
89           subPath: schemaIngest.properties
90           name: {{ include "common.fullname" . }}-properties
91         - mountPath: /opt/app/data-router/dynamic/routes/entity-event.route
92           subPath: entity-event.route
93           name: {{ include "common.fullname" . }}-dynamic-route
94         - mountPath: /opt/app/data-router/dynamic/conf/entity-event-policy.xml
95           subPath: entity-event-policy.xml
96           name: {{ include "common.fullname" . }}-dynamic-policy
97         - mountPath: /opt/app/data-router/bundleconfig/etc/logback.xml
98           name: {{ include "common.fullname" . }}-logback-config
99           subPath: logback.xml
100         - mountPath: /var/log/onap
101           name: {{ include "common.fullname" . }}-logs
102         ports:
103         - containerPort: {{ .Values.service.internalPort }}
104         {{- if eq .Values.liveness.enabled true }}
105         livenessProbe:
106           tcpSocket:
107             port: {{ .Values.service.internalPort }}
108           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
109           periodSeconds: {{ .Values.liveness.periodSeconds }}
110         {{ end -}}
111         readinessProbe:
112           tcpSocket:
113             port: {{ .Values.service.internalPort }}
114           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
115           periodSeconds: {{ .Values.readiness.periodSeconds }}
116         resources:
117 {{ include "common.resources" . | indent 12 }}
118
119       # side car containers
120       - name: filebeat-onap
121         image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
122         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
123         volumeMounts:
124         - mountPath: /usr/share/filebeat/filebeat.yml
125           subPath: filebeat.yml
126           name: filebeat-conf
127         - mountPath: /var/log/onap
128           name: {{ include "common.fullname" . }}-logs
129         - mountPath: /usr/share/filebeat/data
130           name: aai-filebeat
131       volumes:
132       - name: localtime
133         hostPath:
134           path: /etc/localtime
135       - name: filebeat-conf
136         configMap:
137           name: aai-filebeat
138       - name: aai-filebeat
139         emptyDir: {}
140       - name: {{ include "common.fullname" . }}-auth
141         secret:
142           secretName: {{ include "common.fullname" . }}
143       - name: {{ include "common.fullname" . }}-properties
144         configMap:
145           name: {{ include "common.fullname" . }}-prop
146           items:
147           - key: data-router.properties
148             path: data-router.properties
149           - key: schemaIngest.properties
150             path: schemaIngest.properties
151       - name: {{ include "common.fullname" . }}-dynamic-route
152         configMap:
153           name: {{ include "common.fullname" . }}-dynamic
154       - name: {{ include "common.fullname" . }}-dynamic-policy
155         configMap:
156           name: {{ include "common.fullname" . }}-dynamic
157       - name: {{ include "common.fullname" . }}-logs
158         emptyDir: {}
159       - name: {{ include "common.fullname" . }}-logback-config
160         configMap:
161           name: {{ include "common.fullname" . }}-log-configmap
162           items:
163           - key: logback.xml
164             path: logback.xml
165       restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
166       imagePullSecrets:
167       - name: "{{ include "common.namespace" . }}-docker-registry-key"