blob: ac9cf77fbb785800dd68c3a92679168ffa2266e4 [file] [log] [blame]
kj9bf27312018-03-19 15:07:44 +02001# Copyright © 2017 Amdocs, Bell Canada
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00002# Modifications Copyright © 2018 AT&T
kj9bf27312018-03-19 15:07:44 +02003#
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 selector:
29 matchLabels:
30 app: {{ include "common.name" . }}
31 template:
32 metadata:
33 labels:
34 app: {{ include "common.name" . }}
35 release: {{ .Release.Name }}
36 name: {{ include "common.name" . }}
37 spec:
Arul.Nambib8c668f2018-07-17 16:02:30 -040038 initContainers:
39 - command:
40 - /root/ready.py
41 args:
42 - --container-name
43 - aai-elasticsearch
44 - --container-name
45 - aai-search-data
46 - --container-name
47 - aai
48 env:
49 - name: NAMESPACE
50 valueFrom:
51 fieldRef:
52 apiVersion: v1
53 fieldPath: metadata.namespace
54 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
55 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
56 name: {{ include "common.name" . }}-readiness
kj9bf27312018-03-19 15:07:44 +020057 containers:
58 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000059 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
kj9bf27312018-03-19 15:07:44 +020060 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
rv871fb59b7fd2018-09-05 13:33:10 -040061
kj9bf27312018-03-19 15:07:44 +020062 volumeMounts:
63 - mountPath: /etc/localtime
64 name: localtime
65 readOnly: true
Arul.Nambic5f034a2019-01-08 01:55:24 -050066 - mountPath: /opt/app/sparky/config/auth/client-cert-onap.p12
kj9bf27312018-03-19 15:07:44 +020067 name: {{ include "common.fullname" . }}-auth-config
Arul.Nambic5f034a2019-01-08 01:55:24 -050068 subPath: client-cert-onap.p12
69
70 - mountPath: /opt/app/sparky/config/auth/csp-cookie-filter.properties
71 name: {{ include "common.fullname" . }}-auth-config
72 subPath: csp-cookie-filter.properties
73
74 - mountPath: /opt/app/sparky/config/auth/org.onap.aai.p12
75 name: {{ include "common.fullname" . }}-auth-config
76 subPath: org.onap.aai.p12
77
78 - mountPath: /opt/app/sparky/config/auth/truststoreONAPall.jks
79 name: aai-common-aai-auth-mount
80 subPath: truststoreONAPall.jks
rv871fb59b7fd2018-09-05 13:33:10 -040081
82 - mountPath: /opt/app/sparky/config/portal/
kj9bf27312018-03-19 15:07:44 +020083 name: {{ include "common.fullname" . }}-portal-config
rv871fb59b7fd2018-09-05 13:33:10 -040084
85 - mountPath: /opt/app/sparky/config/portal/BOOT-INF/classes/
86 name: {{ include "common.fullname" . }}-portal-config-props
87
kj9bf27312018-03-19 15:07:44 +020088 - mountPath: /var/log/onap
89 name: {{ include "common.fullname" . }}-logs
rv871fb59b7fd2018-09-05 13:33:10 -040090
91 - mountPath: /opt/app/sparky/config/application.properties
92 name: {{ include "common.fullname" . }}-properties
93 subPath: application.properties
94
95 - mountPath: /opt/app/sparky/config/application-resources.properties
96 name: {{ include "common.fullname" . }}-properties
97 subPath: application-resources.properties
98
99 - mountPath: /opt/app/sparky/config/application-ssl.properties
100 name: {{ include "common.fullname" . }}-properties
101 subPath: application-ssl.properties
102
103 - mountPath: /opt/app/sparky/config/application-oxm-default.properties
104 name: {{ include "common.fullname" . }}-properties
105 subPath: application-oxm-default.properties
BorislavGb14a4de2018-10-11 11:31:12 +0000106
rv871fb59b7fd2018-09-05 13:33:10 -0400107 - mountPath: /opt/app/sparky/config/application-oxm-override.properties
108 name: {{ include "common.fullname" . }}-properties
109 subPath: application-oxm-override.properties
110
111 - mountPath: /opt/app/sparky/config/application-oxm-schema-prod.properties
112 name: {{ include "common.fullname" . }}-properties
113 subPath: application-oxm-schema-prod.properties
Arul.Nambi279c43e2018-10-10 16:14:55 -0400114
115 - mountPath: /opt/app/sparky/config/roles.config
116 name: {{ include "common.fullname" . }}-properties
117 subPath: roles.config
118
BorislavGb14a4de2018-10-11 11:31:12 +0000119 - mountPath: /opt/app/sparky/config/users.config
Arul.Nambi279c43e2018-10-10 16:14:55 -0400120 name: {{ include "common.fullname" . }}-properties
121 subPath: users.config
BorislavGb14a4de2018-10-11 11:31:12 +0000122
kj9bf27312018-03-19 15:07:44 +0200123 ports:
124 - containerPort: {{ .Values.service.internalPort }}
125 # disable liveness probe when breakpoints set in debugger
126 # so K8s doesn't restart unresponsive container
127 {{- if eq .Values.liveness.enabled true }}
128 livenessProbe:
129 tcpSocket:
Arul.Nambi89c02792018-06-20 11:40:17 -0400130 port: {{ .Values.service.internalPort }}
kj9bf27312018-03-19 15:07:44 +0200131 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
132 periodSeconds: {{ .Values.liveness.periodSeconds }}
133 {{ end -}}
134 readinessProbe:
135 tcpSocket:
Arul.Nambi89c02792018-06-20 11:40:17 -0400136 port: {{ .Values.service.internalPort }}
kj9bf27312018-03-19 15:07:44 +0200137 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
138 periodSeconds: {{ .Values.readiness.periodSeconds }}
139 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000140{{ include "common.resources" . | indent 12 }}
kj9bf27312018-03-19 15:07:44 +0200141 {{- if .Values.nodeSelector }}
142 nodeSelector:
143{{ toYaml .Values.nodeSelector | indent 8 }}
144 {{- end -}}
145 {{- if .Values.affinity }}
146 affinity:
147{{ toYaml .Values.affinity | indent 8 }}
148 {{- end }}
149
150 # side car containers
151 - name: filebeat-onap
152 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
153 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
154 volumeMounts:
155 - mountPath: /usr/share/filebeat/filebeat.yml
156 subPath: filebeat.yml
157 name: filebeat-conf
158 - mountPath: /var/log/onap
159 name: {{ include "common.fullname" . }}-logs
160 - mountPath: /usr/share/filebeat/data
161 name: aai-sparky-filebeat
162
163 volumes:
164 - name: localtime
165 hostPath:
166 path: /etc/localtime
rv871fb59b7fd2018-09-05 13:33:10 -0400167
168 - name: {{ include "common.fullname" . }}-properties
169 configMap:
170 name: {{ include "common.fullname" . }}-prop
171
kj9bf27312018-03-19 15:07:44 +0200172 - name: {{ include "common.fullname" . }}-config
173 configMap:
174 name: {{ include "common.fullname" . }}
rv871fb59b7fd2018-09-05 13:33:10 -0400175
Keren Joseph5689d5f2018-04-22 15:22:46 +0300176 - name: {{ include "common.fullname" . }}-portal-config
177 configMap:
178 name: {{ include "common.fullname" . }}-portal
rv871fb59b7fd2018-09-05 13:33:10 -0400179
180 - name: {{ include "common.fullname" . }}-portal-config-props
Keren Joseph5689d5f2018-04-22 15:22:46 +0300181 configMap:
rv871fb59b7fd2018-09-05 13:33:10 -0400182 name: {{ include "common.fullname" . }}-portal-props
183
184 - name: {{ include "common.fullname" . }}-auth-config
185 secret:
186 secretName: {{ include "common.fullname" . }}
Arul.Nambic5f034a2019-01-08 01:55:24 -0500187
188 - name: aai-common-aai-auth-mount
189 secret:
190 secretName: aai-common-aai-auth
191
kj9bf27312018-03-19 15:07:44 +0200192 - name: filebeat-conf
193 configMap:
194 name: aai-filebeat
195 - name: {{ include "common.fullname" . }}-logs
196 emptyDir: {}
197 - name: aai-sparky-filebeat
198 emptyDir: {}
rv871fb59b7fd2018-09-05 13:33:10 -0400199 - name: modeldir
200 emptyDir: {}
kj9bf27312018-03-19 15:07:44 +0200201 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
202 imagePullSecrets:
203 - name: "{{ include "common.namespace" . }}-docker-registry-key"