blob: 83e8f1fd150c9363774574cb02ad0381a03447af [file] [log] [blame]
Sylvain Desbureaux70070412020-11-09 21:58:48 +01001# 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
16apiVersion: apps/v1
17kind: Deployment
18metadata:
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 }}
26spec:
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.global.installSidecarSecurity }}
39 initContainers:
40 - name: {{ .Values.global.tproxyConfig.name }}
41 image: "{{ include "common.repository" . }}/{{ .Values.global.tproxyConfig.image }}"
42 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
43 securityContext:
44 privileged: true
45 {{ end }}
46 containers:
47 - name: {{ include "common.name" . }}
48 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
49 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
50 env:
51 - name: CONFIG_HOME
52 value: /opt/app/search-data-service/config/
53 - name: KEY_STORE_PASSWORD
54 value: {{ .Values.config.keyStorePassword }}
55 - name: KEY_MANAGER_PASSWORD
56 value: {{ .Values.config.keyManagerPassword }}
57 volumeMounts:
58 - mountPath: /etc/localtime
59 name: localtime
60 readOnly: true
61 - mountPath: /opt/app/search-data-service/config/filter-config.json
62 subPath: filter-config.json
63 name: {{ include "common.fullname" . }}-service-config
64 - mountPath: /opt/app/search-data-service/config/elastic-search.properties
65 subPath: elastic-search.properties
66 name: {{ include "common.fullname" . }}-service-config
67 - mountPath: /opt/app/search-data-service/config/analysis-config.json
68 subPath: analysis-config.json
69 name: {{ include "common.fullname" . }}-service-config
70 - mountPath: /opt/app/search-data-service/config/es-payload-translation.json
71 subPath: es-payload-translation.json
72 name: {{ include "common.fullname" . }}-service-config
73 - mountPath: /opt/app/search-data-service/config/dynamic-custom-template.json
74 subPath: dynamic-custom-template.json
75 name: {{ include "common.fullname" . }}-service-config
76 - mountPath: /opt/app/search-data-service/config/auth/tomcat_keystore
77 subPath: tomcat_keystore
78 name: {{ include "common.fullname" . }}-service-auth-config
79 - mountPath: /opt/app/search-data-service/config/auth/search_policy.json
80 subPath: search_policy.json
81 name: {{ include "common.fullname" . }}-search-policy-config
82 - mountPath: /var/log/onap
83 name: {{ include "common.fullname" . }}-service-logs
84 - mountPath: /opt/app/search-data-service/bundleconfig/etc/logback.xml
85 name: {{ include "common.fullname" . }}-service-log-conf
86 subPath: logback.xml
87 ports:
88 - containerPort: {{ .Values.service.internalPort }}
89 # disable liveness probe when breakpoints set in debugger
90 # so K8s doesn't restart unresponsive container
91 {{- if eq .Values.liveness.enabled true }}
92 livenessProbe:
93 tcpSocket:
94 port: {{ .Values.service.internalPort }}
95 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
96 periodSeconds: {{ .Values.liveness.periodSeconds }}
97 {{ end -}}
98 readinessProbe:
99 tcpSocket:
100 port: {{ .Values.service.internalPort }}
101 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
102 periodSeconds: {{ .Values.readiness.periodSeconds }}
103 resources:
104{{ include "common.resources" . }}
105 {{- if .Values.nodeSelector }}
106 nodeSelector:
107{{ toYaml .Values.nodeSelector | indent 8 }}
108 {{- end -}}
109 {{- if .Values.affinity }}
110 affinity:
111{{ toYaml .Values.affinity | indent 8 }}
112 {{- end }}
113
114 # side car containers
115 - name: filebeat-onap
116 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
117 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
118 volumeMounts:
119 - mountPath: /usr/share/filebeat/filebeat.yml
120 subPath: filebeat.yml
121 name: filebeat-conf
122 - mountPath: /var/log/onap
123 name: {{ include "common.fullname" . }}-service-logs
124 - mountPath: /usr/share/filebeat/data
125 name: {{ include "common.fullname" . }}-service-filebeat
126
127 {{ if .Values.global.installSidecarSecurity }}
128 - name: {{ .Values.global.rproxy.name }}
129 image: "{{ include "common.repository" . }}/{{ .Values.global.rproxy.image }}"
130 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
131 env:
132 - name: CONFIG_HOME
133 value: "/opt/app/rproxy/config"
134 - name: KEY_STORE_PASSWORD
135 value: {{ .Values.config.keyStorePassword }}
136 - name: spring_profiles_active
137 value: {{ .Values.global.rproxy.activeSpringProfiles }}
138 volumeMounts:
139 - name: {{ include "common.fullname" . }}-rproxy-config
140 mountPath: /opt/app/rproxy/config/forward-proxy.properties
141 subPath: forward-proxy.properties
142 - name: {{ include "common.fullname" . }}-rproxy-config
143 mountPath: /opt/app/rproxy/config/primary-service.properties
144 subPath: primary-service.properties
145 - name: {{ include "common.fullname" . }}-rproxy-config
146 mountPath: /opt/app/rproxy/config/reverse-proxy.properties
147 subPath: reverse-proxy.properties
148 - name: {{ include "common.fullname" . }}-rproxy-config
149 mountPath: /opt/app/rproxy/config/cadi.properties
150 subPath: cadi.properties
151 - name: {{ include "common.fullname" . }}-rproxy-log-config
152 mountPath: /opt/app/rproxy/config/logback-spring.xml
153 subPath: logback-spring.xml
154 - name: {{ include "common.fullname" . }}-rproxy-auth-certs
155 mountPath: /opt/app/rproxy/config/auth/tomcat_keystore
156 subPath: tomcat_keystore
157 - name: {{ include "common.fullname" . }}-rproxy-auth-certs
158 mountPath: /opt/app/rproxy/config/auth/client-cert.p12
159 subPath: client-cert.p12
160 - name: {{ include "common.fullname" . }}-rproxy-uri-auth-config
161 mountPath: /opt/app/rproxy/config/auth/uri-authorization.json
162 subPath: uri-authorization.json
163 - name: {{ include "common.fullname" . }}-rproxy-auth-certs
164 mountPath: /opt/app/rproxy/config/auth/org.onap.aai.p12
165 subPath: org.onap.aai.p12
166 - name: {{ include "common.fullname" . }}-rproxy-security-config
167 mountPath: /opt/app/rproxy/config/security/keyfile
168 subPath: keyfile
169
170 ports:
171 - containerPort: {{ .Values.global.rproxy.port }}
172
173 - name: {{ .Values.global.fproxy.name }}
174 image: "{{ include "common.repository" . }}/{{ .Values.global.fproxy.image }}"
175 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
176 env:
177 - name: CONFIG_HOME
178 value: "/opt/app/fproxy/config"
179 - name: KEY_STORE_PASSWORD
180 value: {{ .Values.config.keyStorePassword }}
181 - name: TRUST_STORE_PASSWORD
182 value: {{ .Values.config.trustStorePassword }}
183 - name: spring_profiles_active
184 value: {{ .Values.global.fproxy.activeSpringProfiles }}
185 volumeMounts:
186 - name: {{ include "common.fullname" . }}-fproxy-config
187 mountPath: /opt/app/fproxy/config/fproxy.properties
188 subPath: fproxy.properties
189 - name: {{ include "common.fullname" . }}-fproxy-log-config
190 mountPath: /opt/app/fproxy/config/logback-spring.xml
191 subPath: logback-spring.xml
192 - name: {{ include "common.fullname" . }}-fproxy-auth-certs
193 mountPath: /opt/app/fproxy/config/auth/fproxy_truststore
194 subPath: fproxy_truststore
195 - name: {{ include "common.fullname" . }}-fproxy-auth-certs
196 mountPath: /opt/app/fproxy/config/auth/tomcat_keystore
197 subPath: tomcat_keystore
198 - name: {{ include "common.fullname" . }}-fproxy-auth-certs
199 mountPath: /opt/app/fproxy/config/auth/client-cert.p12
200 subPath: client-cert.p12
201 ports:
202 - containerPort: {{ .Values.global.fproxy.port }}
203 {{ end }}
204
205 volumes:
206 - name: localtime
207 hostPath:
208 path: /etc/localtime
209 - name: {{ include "common.fullname" . }}-service-config
210 configMap:
211 name: {{ include "common.fullname" . }}
212 - name: {{ include "common.fullname" . }}-service-auth-config
213 secret:
214 secretName: {{ include "common.fullname" . }}-keystone
215 - name: {{ include "common.fullname" . }}-search-policy-config
216 secret:
217 secretName: {{ include "common.fullname" . }}-policy
218 - name: filebeat-conf
219 configMap:
220 name: aai-filebeat
221 - name: {{ include "common.fullname" . }}-service-logs
222 emptyDir: {}
223 - name: {{ include "common.fullname" . }}-service-filebeat
224 emptyDir: {}
225 - name: {{ include "common.fullname" . }}-service-log-conf
226 configMap:
227 name: {{ include "common.fullname" . }}-service-log
228 {{ if .Values.global.installSidecarSecurity }}
229 - name: {{ include "common.fullname" . }}-rproxy-config
230 configMap:
231 name: {{ include "common.fullname" . }}-rproxy-config
232 - name: {{ include "common.fullname" . }}-rproxy-log-config
233 configMap:
234 name: {{ include "common.fullname" . }}-rproxy-log-config
235 - name: {{ include "common.fullname" . }}-rproxy-uri-auth-config
236 configMap:
237 name: {{ include "common.fullname" . }}-rproxy-uri-auth-config
238 - name: {{ include "common.fullname" . }}-rproxy-auth-config
239 secret:
240 secretName: {{ include "common.fullname" . }}-rproxy-auth-config
241 - name: {{ include "common.fullname" . }}-rproxy-auth-certs
242 secret:
243 secretName: aai-rproxy-auth-certs
244 - name: {{ include "common.fullname" . }}-rproxy-security-config
245 secret:
246 secretName: aai-rproxy-security-config
247 - name: {{ include "common.fullname" . }}-fproxy-config
248 configMap:
249 name: {{ include "common.fullname" . }}-fproxy-config
250 - name: {{ include "common.fullname" . }}-fproxy-log-config
251 configMap:
252 name: {{ include "common.fullname" . }}-fproxy-log-config
253 - name: {{ include "common.fullname" . }}-fproxy-auth-certs
254 secret:
255 secretName: aai-fproxy-auth-certs
256 {{ end }}
257 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
258 imagePullSecrets:
259 - name: "{{ include "common.namespace" . }}-docker-registry-key"