blob: ee18d9b24c89082f874b90119e4db52d6d1f2ae0 [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:
kranthikirangcb25a532018-12-07 16:12:02 -0500140{{ include "common.resources" . }}
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
kranthikirangcb25a532018-12-07 16:12:02 -0500162 resources:
163{{ include "common.resources" . }}
kj9bf27312018-03-19 15:07:44 +0200164
165 volumes:
166 - name: localtime
167 hostPath:
168 path: /etc/localtime
rv871fb59b7fd2018-09-05 13:33:10 -0400169
170 - name: {{ include "common.fullname" . }}-properties
171 configMap:
172 name: {{ include "common.fullname" . }}-prop
173
kj9bf27312018-03-19 15:07:44 +0200174 - name: {{ include "common.fullname" . }}-config
175 configMap:
176 name: {{ include "common.fullname" . }}
rv871fb59b7fd2018-09-05 13:33:10 -0400177
Keren Joseph5689d5f2018-04-22 15:22:46 +0300178 - name: {{ include "common.fullname" . }}-portal-config
179 configMap:
180 name: {{ include "common.fullname" . }}-portal
rv871fb59b7fd2018-09-05 13:33:10 -0400181
182 - name: {{ include "common.fullname" . }}-portal-config-props
Keren Joseph5689d5f2018-04-22 15:22:46 +0300183 configMap:
rv871fb59b7fd2018-09-05 13:33:10 -0400184 name: {{ include "common.fullname" . }}-portal-props
185
186 - name: {{ include "common.fullname" . }}-auth-config
187 secret:
188 secretName: {{ include "common.fullname" . }}
Arul.Nambic5f034a2019-01-08 01:55:24 -0500189
190 - name: aai-common-aai-auth-mount
191 secret:
192 secretName: aai-common-aai-auth
193
kj9bf27312018-03-19 15:07:44 +0200194 - name: filebeat-conf
195 configMap:
196 name: aai-filebeat
197 - name: {{ include "common.fullname" . }}-logs
198 emptyDir: {}
199 - name: aai-sparky-filebeat
200 emptyDir: {}
rv871fb59b7fd2018-09-05 13:33:10 -0400201 - name: modeldir
202 emptyDir: {}
kj9bf27312018-03-19 15:07:44 +0200203 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
204 imagePullSecrets:
205 - name: "{{ include "common.namespace" . }}-docker-registry-key"