[AAI] Reintegrate AAI OOM charts in main repo
[oom.git] / kubernetes / aai / components / 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: apps/v1
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: {{ include "common.release" . }}
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: {{ include "common.release" . }}
36       name: {{ include "common.name" . }}
37     spec:
38       {{- if .Values.nodeSelector }}
39       nodeSelector:
40 {{ toYaml .Values.nodeSelector | indent 8 }}
41       {{- end -}}
42       {{- if .Values.affinity }}
43       affinity:
44 {{ toYaml .Values.affinity | indent 8 }}
45       {{- end }}
46       initContainers:
47       - command:
48         - /bin/sh
49         - -c
50         - |
51           mkdir -p /logroot/data-router/logs
52           chmod -R 777 /logroot/data-router/logs
53           chown -R root:root /logroot
54         env:
55         - name: NAMESPACE
56           valueFrom:
57             fieldRef:
58               apiVersion: v1
59               fieldPath: metadata.namespace
60         securityContext:
61           privileged: true
62         image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }}
63         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
64         name: init-sysctl
65         volumeMounts:
66         - name: {{ include "common.fullname" . }}-logs
67           mountPath: /logroot/
68       containers:
69       - name: {{ include "common.name" . }}
70         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
71         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
72         env:
73         - name: SERVICE_BEANS
74           value: /opt/app/data-router/dynamic/conf
75         - name: CONFIG_HOME
76           value: /opt/app/data-router/config/
77         - name: KEY_STORE_PASSWORD
78           value: {{ .Values.config.keyStorePassword }}
79         - name: DYNAMIC_ROUTES
80           value: /opt/app/data-router/dynamic/routes
81         - name: KEY_MANAGER_PASSWORD
82           value: {{ .Values.config.keyManagerPassword }}
83         - name: PATH
84           value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
85         - name: JAVA_HOME
86           value: usr/lib/jvm/java-8-openjdk-amd64
87         volumeMounts:
88         - mountPath: /etc/localtime
89           name: localtime
90           readOnly: true
91         - mountPath:  /opt/app/data-router/config/auth
92           name: {{ include "common.fullname" . }}-auth
93         - mountPath:  /opt/app/data-router/config/data-router.properties
94           subPath: data-router.properties
95           name: {{ include "common.fullname" . }}-properties
96         - mountPath:  /opt/app/data-router/config/schemaIngest.properties
97           subPath: schemaIngest.properties
98           name: {{ include "common.fullname" . }}-properties
99         - mountPath: /opt/app/data-router/dynamic/routes/entity-event.route
100           subPath: entity-event.route
101           name: {{ include "common.fullname" . }}-dynamic-route
102         - mountPath: /opt/app/data-router/dynamic/conf/entity-event-policy.xml
103           subPath: entity-event-policy.xml
104           name: {{ include "common.fullname" . }}-dynamic-policy
105         - mountPath: /opt/app/data-router/dynamic/conf/data-router-oxm.xml
106           subPath: data-router-oxm.xml
107           name: {{ include "common.fullname" . }}-dynamic-oxm
108         - mountPath: /opt/app/data-router/bundleconfig/etc/logback.xml
109           name: {{ include "common.fullname" . }}-logback-config
110           subPath: logback.xml
111         - mountPath: /var/log/onap
112           name: {{ include "common.fullname" . }}-logs
113         - mountPath: /logs
114           name: {{ include "common.fullname" . }}-logs
115
116         ports:
117         - containerPort: {{ .Values.service.internalPort }}
118         {{- if eq .Values.liveness.enabled true }}
119         livenessProbe:
120           tcpSocket:
121             port: {{ .Values.service.internalPort }}
122           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
123           periodSeconds: {{ .Values.liveness.periodSeconds }}
124         {{ end -}}
125         readinessProbe:
126           tcpSocket:
127             port: {{ .Values.service.internalPort }}
128           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
129           periodSeconds: {{ .Values.readiness.periodSeconds }}
130         resources:
131 {{ include "common.resources" . }}
132
133       # side car containers
134       - name: filebeat-onap
135         image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
136         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
137         volumeMounts:
138         - mountPath: /usr/share/filebeat/filebeat.yml
139           subPath: filebeat.yml
140           name: filebeat-conf
141         - mountPath: /var/log/onap
142           name: {{ include "common.fullname" . }}-logs
143         - mountPath: /logs
144           name: {{ include "common.fullname" . }}-logs
145         - mountPath: /usr/share/filebeat/data
146           name: aai-filebeat
147         resources:
148 {{ include "common.resources" . }}
149       volumes:
150       - name: localtime
151         hostPath:
152           path: /etc/localtime
153       - name: filebeat-conf
154         configMap:
155           name: aai-filebeat
156       - name: aai-filebeat
157         emptyDir: {}
158       - name: {{ include "common.fullname" . }}-auth
159         secret:
160           secretName: {{ include "common.fullname" . }}
161       - name: {{ include "common.fullname" . }}-properties
162         configMap:
163           name: {{ include "common.fullname" . }}-prop
164           items:
165           - key: data-router.properties
166             path: data-router.properties
167           - key: schemaIngest.properties
168             path: schemaIngest.properties
169       - name: {{ include "common.fullname" . }}-dynamic-route
170         configMap:
171           name: {{ include "common.fullname" . }}-dynamic
172       - name: {{ include "common.fullname" . }}-dynamic-policy
173         configMap:
174           name: {{ include "common.fullname" . }}-dynamic
175       - name: {{ include "common.fullname" . }}-dynamic-oxm
176         configMap:
177           name: {{ include "common.fullname" . }}-dynamic
178       - name: {{ include "common.fullname" . }}-logs
179         emptyDir: {}
180       - name: {{ include "common.fullname" . }}-logback-config
181         configMap:
182           name: {{ include "common.fullname" . }}-log-configmap
183           items:
184           - key: logback.xml
185             path: logback.xml
186       restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
187       imagePullSecrets:
188       - name: "{{ include "common.namespace" . }}-docker-registry-key"