blob: 537763a6db446e4c8a9c9657b3b6de62bcb5a00f [file] [log] [blame]
Daniel Silverthorn48f10702018-03-08 10:02:21 -05001# Copyright © 2018 Amdocs, AT&T
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00002# Modifications Copyright © 2018 Bell Canada
Daniel Silverthorn48f10702018-03-08 10:02:21 -05003#
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: extensions/v1beta1
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: {{ .Release.Name }}
25 heritage: {{ .Release.Service }}
26spec:
27 replicas: {{ .Values.replicaCount }}
28 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}
32 release: {{ .Release.Name }}
33 spec:
michaere1bd45e12018-10-29 14:23:55 +000034 initContainers:
35 - command:
36 - /root/ready.py
37 args:
38 - --container-name
39 - aai-cassandra
40 env:
41 - name: NAMESPACE
42 valueFrom:
43 fieldRef:
44 apiVersion: v1
45 fieldPath: metadata.namespace
46 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
47 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
48 name: {{ include "common.name" . }}-readiness
Ravi Geda9234bde2018-10-30 10:03:44 +000049 {{ if .Values.global.installSidecarSecurity }}
50 - name: {{ .Values.global.tproxyConfig.name }}
51 image: "{{ include "common.repository" . }}/{{ .Values.global.tproxyConfig.image }}"
52 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 securityContext:
54 privileged: true
55 {{ end }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -050056 containers:
57 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000058 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
Daniel Silverthorn48f10702018-03-08 10:02:21 -050059 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60 ports:
61 - containerPort: {{ .Values.service.internalPort }}
62 # disable liveness probe when breakpoints set in debugger
63 # so K8s doesn't restart unresponsive container
kj05b57f82018-03-28 18:10:32 +030064 {{ if .Values.liveness.enabled }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -050065 livenessProbe:
66 tcpSocket:
67 port: {{ .Values.service.internalPort }}
68 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
69 periodSeconds: {{ .Values.liveness.periodSeconds }}
kj05b57f82018-03-28 18:10:32 +030070 {{ end }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -050071 readinessProbe:
72 tcpSocket:
73 port: {{ .Values.service.internalPort }}
74 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
75 periodSeconds: {{ .Values.readiness.periodSeconds }}
76 env:
77 - name: CONFIG_HOME
78 value: "/opt/app/champ-service/appconfig"
79 - name: GRAPHIMPL
80 value: "janus-deps"
Daniel Silverthorn82cee4d2018-03-28 19:18:19 +000081 - name: KEY_STORE_PASSWORD
82 valueFrom:
83 secretKeyRef:
84 name: {{ template "common.fullname" . }}-pass
85 key: KEY_STORE_PASSWORD
86 - name: KEY_MANAGER_PASSWORD
87 valueFrom:
88 secretKeyRef:
89 name: {{ template "common.fullname" . }}-pass
90 key: KEY_MANAGER_PASSWORD
Daniel Silverthorn48f10702018-03-08 10:02:21 -050091 - name: SERVICE_BEANS
92 value: "/opt/app/champ-service/dynamic/conf"
93 volumeMounts:
94 - mountPath: /etc/localtime
95 name: localtime
96 readOnly: true
97 - mountPath: /opt/app/champ-service/appconfig/champ-api.properties
98 name: {{ include "common.fullname" . }}-config
99 subPath: champ-api.properties
100 - mountPath: /opt/app/champ-service/appconfig/auth
101 name: {{ include "common.fullname" . }}-secrets
102 - mountPath: /opt/app/champ-service/dynamic/conf/champ-beans.xml
103 name: {{ include "common.fullname" . }}-dynamic-config
104 subPath: champ-beans.xml
Shwetank Daveb4333f92018-08-14 09:55:46 -0400105 - mountPath: /opt/app/champ-service/bundleconfig/etc/logback.xml
106 name: {{ include "common.fullname" . }}-logback-config
107 subPath: logback.xml
Michael Arrastia1149a062018-09-17 15:12:45 +0100108 - mountPath: /var/log/onap
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500109 name: {{ include "common.fullname" . }}-logs
110 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000111{{ include "common.resources" . | indent 12 }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500112 {{- if .Values.nodeSelector }}
113 nodeSelector:
114{{ toYaml .Values.nodeSelector | indent 10 }}
115 {{- end -}}
116 {{- if .Values.affinity }}
117 affinity:
118{{ toYaml .Values.affinity | indent 10 }}
119 {{- end }}
120
Michael Arrastia1149a062018-09-17 15:12:45 +0100121 # side car containers
122 - name: filebeat-onap
123 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
124 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
125 volumeMounts:
126 - mountPath: /usr/share/filebeat/filebeat.yml
127 subPath: filebeat.yml
128 name: filebeat-conf
129 - mountPath: /var/log/onap
130 name: {{ include "common.fullname" . }}-logs
131 - mountPath: /usr/share/filebeat/data
132 name: aai-filebeat
Ravi Geda9234bde2018-10-30 10:03:44 +0000133 {{ if .Values.global.installSidecarSecurity }}
134 - name: {{ .Values.global.rproxy.name }}
135 image: "{{ include "common.repository" . }}/{{ .Values.global.rproxy.image }}"
136 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
137 env:
138 - name: CONFIG_HOME
139 value: "/opt/app/rproxy/config"
140 - name: KEY_STORE_PASSWORD
141 value: {{ .Values.config.keyStorePassword }}
142 - name: spring_profiles_active
143 value: {{ .Values.global.rproxy.activeSpringProfiles }}
144 volumeMounts:
145 - name: {{ include "common.fullname" . }}-rproxy-config
146 mountPath: /opt/app/rproxy/config/forward-proxy.properties
147 subPath: forward-proxy.properties
148 - name: {{ include "common.fullname" . }}-rproxy-config
149 mountPath: /opt/app/rproxy/config/primary-service.properties
150 subPath: primary-service.properties
151 - name: {{ include "common.fullname" . }}-rproxy-config
152 mountPath: /opt/app/rproxy/config/reverse-proxy.properties
153 subPath: reverse-proxy.properties
154 - name: {{ include "common.fullname" . }}-rproxy-config
155 mountPath: /opt/app/rproxy/config/cadi.properties
156 subPath: cadi.properties
157 - name: {{ include "common.fullname" . }}-rproxy-log-config
158 mountPath: /opt/app/rproxy/config/logback-spring.xml
159 subPath: logback-spring.xml
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000160 - name: {{ include "common.fullname" . }}-rproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000161 mountPath: /opt/app/rproxy/config/auth/tomcat_keystore
162 subPath: tomcat_keystore
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000163 - name: {{ include "common.fullname" . }}-rproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000164 mountPath: /opt/app/rproxy/config/auth/client-cert.p12
165 subPath: client-cert.p12
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000166 - name: {{ include "common.fullname" . }}-rproxy-auth-certs
167 mountPath: /opt/app/rproxy/config/auth/org.onap.aai.p12
168 subPath: org.onap.aai.p12
Ravi Geda9234bde2018-10-30 10:03:44 +0000169 - name: {{ include "common.fullname" . }}-rproxy-auth-config
170 mountPath: /opt/app/rproxy/config/auth/uri-authorization.json
171 subPath: uri-authorization.json
Ravi Geda9234bde2018-10-30 10:03:44 +0000172 - name: {{ include "common.fullname" . }}-rproxy-security-config
173 mountPath: /opt/app/rproxy/config/security/keyfile
174 subPath: keyfile
175
176 ports:
177 - containerPort: {{ .Values.global.rproxy.port }}
178
179 - name: {{ .Values.global.fproxy.name }}
180 image: "{{ include "common.repository" . }}/{{ .Values.global.fproxy.image }}"
181 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
182 env:
183 - name: CONFIG_HOME
184 value: "/opt/app/fproxy/config"
185 - name: KEY_STORE_PASSWORD
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000186 value: {{ .Values.config.keyStorePassword }}
187 - name: TRUST_STORE_PASSWORD
188 value: {{ .Values.config.trustStorePassword }}
Ravi Geda9234bde2018-10-30 10:03:44 +0000189 - name: spring_profiles_active
190 value: {{ .Values.global.fproxy.activeSpringProfiles }}
191 volumeMounts:
192 - name: {{ include "common.fullname" . }}-fproxy-config
193 mountPath: /opt/app/fproxy/config/fproxy.properties
194 subPath: fproxy.properties
195 - name: {{ include "common.fullname" . }}-fproxy-log-config
196 mountPath: /opt/app/fproxy/config/logback-spring.xml
197 subPath: logback-spring.xml
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000198 - name: {{ include "common.fullname" . }}-fproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000199 mountPath: /opt/app/fproxy/config/auth/tomcat_keystore
200 subPath: tomcat_keystore
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000201 - name: {{ include "common.fullname" . }}-fproxy-auth-certs
202 mountPath: /opt/app/fproxy/config/auth/fproxy_truststore
203 subPath: fproxy_truststore
204 - name: {{ include "common.fullname" . }}-fproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000205 mountPath: /opt/app/fproxy/config/auth/client-cert.p12
206 subPath: client-cert.p12
207 ports:
208 - containerPort: {{ .Values.global.fproxy.port }}
209 {{ end }}
Michael Arrastia1149a062018-09-17 15:12:45 +0100210
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500211 volumes:
212 - name: localtime
213 hostPath:
214 path: /etc/localtime
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500215 - name: {{ include "common.fullname" . }}-config
216 configMap:
Daniel Silverthorn82cee4d2018-03-28 19:18:19 +0000217 name: {{ include "common.fullname" . }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500218 items:
219 - key: champ-api.properties
220 path: champ-api.properties
221 - name: {{ include "common.fullname" . }}-secrets
222 secret:
Daniel Silverthorn82cee4d2018-03-28 19:18:19 +0000223 secretName: {{ include "common.fullname" . }}-champ
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500224 - name: {{ include "common.fullname" . }}-dynamic-config
225 configMap:
Daniel Silverthorn82cee4d2018-03-28 19:18:19 +0000226 name: {{ include "common.fullname" . }}-dynamic
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500227 items:
228 - key: champ-beans.xml
229 path: champ-beans.xml
230 - name: {{ include "common.fullname" . }}-logs
231 emptyDir: {}
Shwetank Daveb4333f92018-08-14 09:55:46 -0400232 - name: {{ include "common.fullname" . }}-logback-config
233 configMap:
234 name: {{ include "common.fullname" . }}-log-configmap
235 items:
236 - key: logback.xml
237 path: logback.xml
Michael Arrastia1149a062018-09-17 15:12:45 +0100238 - name: filebeat-conf
239 configMap:
240 name: aai-filebeat
241 - name: aai-filebeat
242 emptyDir: {}
Ravi Geda9234bde2018-10-30 10:03:44 +0000243 {{ if .Values.global.installSidecarSecurity }}
244 - name: {{ include "common.fullname" . }}-rproxy-config
245 configMap:
246 name: {{ include "common.fullname" . }}-rproxy-config
247 - name: {{ include "common.fullname" . }}-rproxy-log-config
248 configMap:
249 name: {{ include "common.fullname" . }}-rproxy-log-config
250 - name: {{ include "common.fullname" . }}-rproxy-auth-config
251 secret:
252 secretName: {{ include "common.fullname" . }}-rproxy-auth-config
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000253 - name: {{ include "common.fullname" . }}-rproxy-auth-certs
254 secret:
255 secretName: aai-rproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000256 - name: {{ include "common.fullname" . }}-rproxy-security-config
257 secret:
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000258 secretName: aai-rproxy-security-config
Ravi Geda9234bde2018-10-30 10:03:44 +0000259 - name: {{ include "common.fullname" . }}-fproxy-config
260 configMap:
261 name: {{ include "common.fullname" . }}-fproxy-config
262 - name: {{ include "common.fullname" . }}-fproxy-log-config
263 configMap:
264 name: {{ include "common.fullname" . }}-fproxy-log-config
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000265 - name: {{ include "common.fullname" . }}-fproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000266 secret:
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000267 secretName: aai-fproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000268 {{ end }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500269 imagePullSecrets:
270 - name: "{{ include "common.namespace" . }}-docker-registry-key"