[DCAEMOD] Uses new tpls for repos / images
[oom.git] / kubernetes / pomba / components / pomba-data-router / templates / deployment.yaml
1 {{/*
2 # Copyright © 2018 Amdocs
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
17 apiVersion: extensions/v1beta1
18 kind: Deployment
19 metadata:
20   name: {{ include "common.fullname" . }}
21   namespace: {{ include "common.namespace" . }}
22   labels:
23     app: {{ include "common.name" . }}
24     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
25     release: {{ include "common.release" . }}
26     heritage: {{ .Release.Service }}
27 spec:
28   replicas: {{ .Values.replicaCount }}
29   selector:
30     matchLabels:
31       app: {{ include "common.name" . }}
32   template:
33     metadata:
34       labels:
35         app: {{ include "common.name" . }}
36         release: {{ include "common.release" . }}
37       name: {{ include "common.name" . }}
38     spec:
39       initContainers:
40       - command:
41         - /app/ready.py
42         args:
43         - --container-name
44         - pomba-search-data
45         env:
46         - name: NAMESPACE
47           valueFrom:
48             fieldRef:
49               apiVersion: v1
50               fieldPath: metadata.namespace
51         image: {{ include "repositoryGenerator.image.readiness" . }}
52         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53         name: {{ include "common.name" . }}-readiness
54       - command:
55         - /bin/sh
56         - -c
57         - |
58           mkdir -p /logroot/data-router/logs
59           chmod -R 777 /logroot/data-router/logs
60           chown -R root:root /logroot
61         env:
62         - name: NAMESPACE
63           valueFrom:
64             fieldRef:
65               apiVersion: v1
66               fieldPath: metadata.namespace
67         securityContext:
68           privileged: true
69         image: {{ include "repositoryGenerator.image.busybox" . }}
70         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
71         name: init-sysctl
72         volumeMounts:
73         - name: {{ include "common.fullname" . }}-logs
74           mountPath: /logroot/
75       containers:
76       - name: {{ include "common.name" . }}
77         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
78         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
79         env:
80         - name: SERVICE_BEANS
81           value: /opt/app/data-router/dynamic/conf
82         - name: CONFIG_HOME
83           value: /opt/app/data-router/config/
84         - name: KEY_STORE_PASSWORD
85           value: {{ .Values.config.keyStorePassword }}
86         - name: DYNAMIC_ROUTES
87           value: /opt/app/data-router/dynamic/routes
88         - name: KEY_MANAGER_PASSWORD
89           value: {{ .Values.config.keyManagerPassword }}
90         volumeMounts:
91         - mountPath: /etc/localtime
92           name: localtime
93           readOnly: true
94         - mountPath:  /opt/app/data-router/config/auth
95           name: {{ include "common.fullname" . }}-auth
96         - mountPath:  /opt/app/data-router/config/data-router.properties
97           subPath: data-router.properties
98           name: {{ include "common.fullname" . }}-properties
99         - mountPath:  /opt/app/data-router/config/schemaIngest.properties
100           subPath: schemaIngest.properties
101           name: {{ include "common.fullname" . }}-properties
102         - mountPath: /opt/app/data-router/dynamic/routes/audit.route
103           subPath: audit.route
104           name: {{ include "common.fullname" . }}-dynamic-route
105         - mountPath: /opt/app/data-router/dynamic/routes/poaValidation.route
106           subPath: poaValidation.route
107           name: {{ include "common.fullname" . }}-dynamic-route
108         - mountPath: /opt/app/data-router/dynamic/conf/audit-bean.xml
109           subPath: audit-bean.xml
110           name: {{ include "common.fullname" . }}-dynamic-policy
111         - mountPath: /opt/app/data-router/dynamic/conf/poa-validation-bean.xml
112           subPath: poa-validation-bean.xml
113           name: {{ include "common.fullname" . }}-dynamic-policy
114         - mountPath: /logs/
115           name: {{ include "common.fullname" . }}-logs
116         resources:
117 {{ include "common.resources" . | indent 10 }}
118         ports:
119         - containerPort: {{ .Values.service.internalPort }}
120         {{- if eq .Values.liveness.enabled true }}
121         livenessProbe:
122           tcpSocket:
123             port: {{ .Values.service.internalPort }}
124           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
125           periodSeconds: {{ .Values.liveness.periodSeconds }}
126         {{ end -}}
127         readinessProbe:
128           tcpSocket:
129             port: {{ .Values.service.internalPort }}
130           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
131           periodSeconds: {{ .Values.readiness.periodSeconds }}
132
133       # Filebeat sidecar container
134       - name: {{ include "common.name" . }}-filebeat-onap
135         image: {{ include "repositoryGenerator.image.logging" . }}
136         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
137         volumeMounts:
138         - name: {{ include "common.fullname" . }}-filebeat-conf
139           mountPath: /usr/share/filebeat/filebeat.yml
140           subPath: filebeat.yml
141         - name: {{ include "common.fullname" . }}-data-filebeat
142           mountPath: /usr/share/filebeat/data
143         - name: {{ include "common.fullname" . }}-logs
144           mountPath: /opt/app/logs
145
146       volumes:
147       - name: localtime
148         hostPath:
149           path: /etc/localtime
150       - name: {{ include "common.fullname" . }}-auth
151         secret:
152           secretName: {{ include "common.fullname" . }}
153       - name: {{ include "common.fullname" . }}-properties
154         configMap:
155           name: {{ include "common.fullname" . }}-prop
156           items:
157           - key: data-router.properties
158             path: data-router.properties
159           - key: schemaIngest.properties
160             path: schemaIngest.properties
161       - name: {{ include "common.fullname" . }}-filebeat-conf
162         configMap:
163           name: {{ include "common.release" . }}-pomba-filebeat-configmap
164       - name: {{ include "common.fullname" . }}-data-filebeat
165         emptyDir: {}
166       - name: {{ include "common.fullname" . }}-dynamic-route
167         configMap:
168           name: {{ include "common.fullname" . }}-dynamic
169       - name: {{ include "common.fullname" . }}-dynamic-policy
170         configMap:
171           name: {{ include "common.fullname" . }}-dynamic
172       - name: {{ include "common.fullname" . }}-logs
173         persistentVolumeClaim:
174           claimName: {{ include "common.fullname" . }}
175       restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
176       imagePullSecrets:
177       - name: "{{ include "common.namespace" . }}-docker-registry-key"