blob: a311f6879972aaaa9067f3d34202bdd3a427d81c [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
Mahendra Raghuwanshi6b77b722019-03-15 12:02:42 +000039 {{- if .Values.global.cassandra.localCluster }}
michaere1bd45e12018-10-29 14:23:55 +000040 - aai-cassandra
Mahendra Raghuwanshi6b77b722019-03-15 12:02:42 +000041 {{- else }}
42 - cassandra
43 {{- end }}
michaere1bd45e12018-10-29 14:23:55 +000044 env:
45 - name: NAMESPACE
46 valueFrom:
47 fieldRef:
48 apiVersion: v1
49 fieldPath: metadata.namespace
50 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
51 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 name: {{ include "common.name" . }}-readiness
Ravi Geda9234bde2018-10-30 10:03:44 +000053 {{ if .Values.global.installSidecarSecurity }}
54 - name: {{ .Values.global.tproxyConfig.name }}
55 image: "{{ include "common.repository" . }}/{{ .Values.global.tproxyConfig.image }}"
56 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
57 securityContext:
58 privileged: true
59 {{ end }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -050060 containers:
61 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000062 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
Daniel Silverthorn48f10702018-03-08 10:02:21 -050063 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
64 ports:
65 - containerPort: {{ .Values.service.internalPort }}
66 # disable liveness probe when breakpoints set in debugger
67 # so K8s doesn't restart unresponsive container
kj05b57f82018-03-28 18:10:32 +030068 {{ if .Values.liveness.enabled }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -050069 livenessProbe:
70 tcpSocket:
71 port: {{ .Values.service.internalPort }}
72 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
73 periodSeconds: {{ .Values.liveness.periodSeconds }}
kj05b57f82018-03-28 18:10:32 +030074 {{ end }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -050075 readinessProbe:
76 tcpSocket:
77 port: {{ .Values.service.internalPort }}
78 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
79 periodSeconds: {{ .Values.readiness.periodSeconds }}
80 env:
81 - name: CONFIG_HOME
82 value: "/opt/app/champ-service/appconfig"
83 - name: GRAPHIMPL
84 value: "janus-deps"
Daniel Silverthorn82cee4d2018-03-28 19:18:19 +000085 - name: KEY_STORE_PASSWORD
86 valueFrom:
87 secretKeyRef:
88 name: {{ template "common.fullname" . }}-pass
89 key: KEY_STORE_PASSWORD
90 - name: KEY_MANAGER_PASSWORD
91 valueFrom:
92 secretKeyRef:
93 name: {{ template "common.fullname" . }}-pass
94 key: KEY_MANAGER_PASSWORD
Daniel Silverthorn48f10702018-03-08 10:02:21 -050095 - name: SERVICE_BEANS
96 value: "/opt/app/champ-service/dynamic/conf"
97 volumeMounts:
98 - mountPath: /etc/localtime
99 name: localtime
100 readOnly: true
101 - mountPath: /opt/app/champ-service/appconfig/champ-api.properties
102 name: {{ include "common.fullname" . }}-config
103 subPath: champ-api.properties
104 - mountPath: /opt/app/champ-service/appconfig/auth
105 name: {{ include "common.fullname" . }}-secrets
106 - mountPath: /opt/app/champ-service/dynamic/conf/champ-beans.xml
107 name: {{ include "common.fullname" . }}-dynamic-config
108 subPath: champ-beans.xml
Shwetank Daveb4333f92018-08-14 09:55:46 -0400109 - mountPath: /opt/app/champ-service/bundleconfig/etc/logback.xml
110 name: {{ include "common.fullname" . }}-logback-config
111 subPath: logback.xml
Michael Arrastia1149a062018-09-17 15:12:45 +0100112 - mountPath: /var/log/onap
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500113 name: {{ include "common.fullname" . }}-logs
114 resources:
kranthikirangcb25a532018-12-07 16:12:02 -0500115{{ include "common.resources" . }}
116 {{- if .Values.nodeSelector }}
117 nodeSelector:
118{{ toYaml .Values.nodeSelector | indent 8 }}
119 {{- end -}}
120 {{- if .Values.affinity }}
121 affinity:
122{{ toYaml .Values.affinity | indent 8 }}
123 {{- end }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500124
Michael Arrastia1149a062018-09-17 15:12:45 +0100125 # side car containers
126 - name: filebeat-onap
127 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
128 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
129 volumeMounts:
130 - mountPath: /usr/share/filebeat/filebeat.yml
131 subPath: filebeat.yml
132 name: filebeat-conf
133 - mountPath: /var/log/onap
134 name: {{ include "common.fullname" . }}-logs
135 - mountPath: /usr/share/filebeat/data
136 name: aai-filebeat
Ravi Geda9234bde2018-10-30 10:03:44 +0000137 {{ if .Values.global.installSidecarSecurity }}
138 - name: {{ .Values.global.rproxy.name }}
139 image: "{{ include "common.repository" . }}/{{ .Values.global.rproxy.image }}"
140 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
141 env:
142 - name: CONFIG_HOME
143 value: "/opt/app/rproxy/config"
144 - name: KEY_STORE_PASSWORD
145 value: {{ .Values.config.keyStorePassword }}
146 - name: spring_profiles_active
147 value: {{ .Values.global.rproxy.activeSpringProfiles }}
148 volumeMounts:
149 - name: {{ include "common.fullname" . }}-rproxy-config
150 mountPath: /opt/app/rproxy/config/forward-proxy.properties
151 subPath: forward-proxy.properties
152 - name: {{ include "common.fullname" . }}-rproxy-config
153 mountPath: /opt/app/rproxy/config/primary-service.properties
154 subPath: primary-service.properties
155 - name: {{ include "common.fullname" . }}-rproxy-config
156 mountPath: /opt/app/rproxy/config/reverse-proxy.properties
157 subPath: reverse-proxy.properties
158 - name: {{ include "common.fullname" . }}-rproxy-config
159 mountPath: /opt/app/rproxy/config/cadi.properties
160 subPath: cadi.properties
161 - name: {{ include "common.fullname" . }}-rproxy-log-config
162 mountPath: /opt/app/rproxy/config/logback-spring.xml
163 subPath: logback-spring.xml
bwong218737f7e2019-03-14 17:15:58 +0000164 - name: {{ include "common.fullname" . }}-rproxy-uri-auth-config
165 mountPath: /opt/app/rproxy/config/auth/uri-authorization.json
166 subPath: uri-authorization.json
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000167 - name: {{ include "common.fullname" . }}-rproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000168 mountPath: /opt/app/rproxy/config/auth/tomcat_keystore
169 subPath: tomcat_keystore
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000170 - name: {{ include "common.fullname" . }}-rproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000171 mountPath: /opt/app/rproxy/config/auth/client-cert.p12
172 subPath: client-cert.p12
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000173 - name: {{ include "common.fullname" . }}-rproxy-auth-certs
174 mountPath: /opt/app/rproxy/config/auth/org.onap.aai.p12
175 subPath: org.onap.aai.p12
Ravi Geda9234bde2018-10-30 10:03:44 +0000176 - name: {{ include "common.fullname" . }}-rproxy-security-config
177 mountPath: /opt/app/rproxy/config/security/keyfile
178 subPath: keyfile
179
180 ports:
181 - containerPort: {{ .Values.global.rproxy.port }}
182
183 - name: {{ .Values.global.fproxy.name }}
184 image: "{{ include "common.repository" . }}/{{ .Values.global.fproxy.image }}"
185 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
186 env:
187 - name: CONFIG_HOME
188 value: "/opt/app/fproxy/config"
189 - name: KEY_STORE_PASSWORD
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000190 value: {{ .Values.config.keyStorePassword }}
191 - name: TRUST_STORE_PASSWORD
192 value: {{ .Values.config.trustStorePassword }}
Ravi Geda9234bde2018-10-30 10:03:44 +0000193 - name: spring_profiles_active
194 value: {{ .Values.global.fproxy.activeSpringProfiles }}
195 volumeMounts:
196 - name: {{ include "common.fullname" . }}-fproxy-config
197 mountPath: /opt/app/fproxy/config/fproxy.properties
198 subPath: fproxy.properties
199 - name: {{ include "common.fullname" . }}-fproxy-log-config
200 mountPath: /opt/app/fproxy/config/logback-spring.xml
201 subPath: logback-spring.xml
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000202 - name: {{ include "common.fullname" . }}-fproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000203 mountPath: /opt/app/fproxy/config/auth/tomcat_keystore
204 subPath: tomcat_keystore
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000205 - name: {{ include "common.fullname" . }}-fproxy-auth-certs
206 mountPath: /opt/app/fproxy/config/auth/fproxy_truststore
207 subPath: fproxy_truststore
208 - name: {{ include "common.fullname" . }}-fproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000209 mountPath: /opt/app/fproxy/config/auth/client-cert.p12
210 subPath: client-cert.p12
211 ports:
212 - containerPort: {{ .Values.global.fproxy.port }}
213 {{ end }}
Michael Arrastia1149a062018-09-17 15:12:45 +0100214
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500215 volumes:
216 - name: localtime
217 hostPath:
218 path: /etc/localtime
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500219 - name: {{ include "common.fullname" . }}-config
220 configMap:
Daniel Silverthorn82cee4d2018-03-28 19:18:19 +0000221 name: {{ include "common.fullname" . }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500222 items:
223 - key: champ-api.properties
224 path: champ-api.properties
225 - name: {{ include "common.fullname" . }}-secrets
226 secret:
Daniel Silverthorn82cee4d2018-03-28 19:18:19 +0000227 secretName: {{ include "common.fullname" . }}-champ
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500228 - name: {{ include "common.fullname" . }}-dynamic-config
229 configMap:
Daniel Silverthorn82cee4d2018-03-28 19:18:19 +0000230 name: {{ include "common.fullname" . }}-dynamic
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500231 items:
232 - key: champ-beans.xml
233 path: champ-beans.xml
234 - name: {{ include "common.fullname" . }}-logs
235 emptyDir: {}
Shwetank Daveb4333f92018-08-14 09:55:46 -0400236 - name: {{ include "common.fullname" . }}-logback-config
237 configMap:
238 name: {{ include "common.fullname" . }}-log-configmap
239 items:
240 - key: logback.xml
241 path: logback.xml
Michael Arrastia1149a062018-09-17 15:12:45 +0100242 - name: filebeat-conf
243 configMap:
244 name: aai-filebeat
245 - name: aai-filebeat
246 emptyDir: {}
Ravi Geda9234bde2018-10-30 10:03:44 +0000247 {{ if .Values.global.installSidecarSecurity }}
248 - name: {{ include "common.fullname" . }}-rproxy-config
249 configMap:
250 name: {{ include "common.fullname" . }}-rproxy-config
251 - name: {{ include "common.fullname" . }}-rproxy-log-config
252 configMap:
253 name: {{ include "common.fullname" . }}-rproxy-log-config
bwong218737f7e2019-03-14 17:15:58 +0000254 - name: {{ include "common.fullname" . }}-rproxy-uri-auth-config
255 configMap:
256 name: {{ include "common.fullname" . }}-rproxy-uri-auth-config
Ravi Geda9234bde2018-10-30 10:03:44 +0000257 - name: {{ include "common.fullname" . }}-rproxy-auth-config
258 secret:
259 secretName: {{ include "common.fullname" . }}-rproxy-auth-config
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000260 - name: {{ include "common.fullname" . }}-rproxy-auth-certs
261 secret:
262 secretName: aai-rproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000263 - name: {{ include "common.fullname" . }}-rproxy-security-config
264 secret:
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000265 secretName: aai-rproxy-security-config
Ravi Geda9234bde2018-10-30 10:03:44 +0000266 - name: {{ include "common.fullname" . }}-fproxy-config
267 configMap:
268 name: {{ include "common.fullname" . }}-fproxy-config
269 - name: {{ include "common.fullname" . }}-fproxy-log-config
270 configMap:
271 name: {{ include "common.fullname" . }}-fproxy-log-config
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000272 - name: {{ include "common.fullname" . }}-fproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000273 secret:
Lee, Tian (tl5884)fd8e7fb2019-01-11 16:52:27 +0000274 secretName: aai-fproxy-auth-certs
Ravi Geda9234bde2018-10-30 10:03:44 +0000275 {{ end }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500276 imagePullSecrets:
277 - name: "{{ include "common.namespace" . }}-docker-registry-key"