Updated AAI to latest images - sparky
[oom.git] / kubernetes / aai / charts / aai-sparky-be / templates / deployment.yaml
1 # Copyright © 2017 Amdocs, Bell Canada
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 apiVersion: extensions/v1beta1
16 kind: Deployment
17 metadata:
18   name: {{ include "common.fullname" . }}
19   namespace: {{ include "common.namespace" . }}
20   labels:
21     app: {{ include "common.name" . }}
22     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23     release: {{ .Release.Name }}
24     heritage: {{ .Release.Service }}
25 spec:
26   replicas: {{ .Values.replicaCount }}
27   selector:
28     matchLabels:
29       app: {{ include "common.name" . }}
30   template:
31     metadata:
32       labels:
33         app: {{ include "common.name" . }}
34         release: {{ .Release.Name }}
35       name: {{ include "common.name" . }}
36     spec:
37       containers:
38       - name: {{ include "common.name" . }}
39         image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}"
40         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
41         env:
42         - name: CONFIG_HOME
43           value: /opt/app/sparky/appconfig/
44         - name: KEYSTORE_ALIAS_PASSWORD
45           value: {{ .Values.config.keystoreAliasPassword }}
46         - name: KEYSTORE_PASSWORD
47           value: {{ .Values.config.keyStorePassword }}
48         - name: SPARKY_SSL_ENABLED
49           value: 'true'
50         - name: SPARKY_PORTAL_ENABLED
51           value: 'false'
52         volumeMounts:
53         - mountPath: /etc/localtime
54           name: localtime
55           readOnly: true
56         - mountPath: /opt/app/sparky/appconfig/auth/
57           name: {{ include "common.fullname" . }}-auth-config
58         - mountPath: /opt/app/sparky/appconfig/camel-rests/
59           name: {{ include "common.fullname" . }}-camel-rests-config
60         - mountPath: /opt/app/sparky/appconfig/descriptors/
61           name: {{ include "common.fullname" . }}-descriptors-config
62         - mountPath: /opt/app/sparky/appconfig/filters/
63           name: {{ include "common.fullname" . }}-filters-config
64         - mountPath: /opt/app/sparky/appconfig/
65           name: {{ include "common.fullname" . }}-config
66         - mountPath: /opt/app/sparky/appconfig/portal
67           name: {{ include "common.fullname" . }}-portal-config
68         - mountPath: /opt/app/sparky/appconfig/portal/BOOT-INF/classes
69           name: {{ include "common.fullname" . }}-portal-boot-inf-config
70         - mountPath: /opt/app/sparky/appconfig/schemas
71           name: {{ include "common.fullname" . }}-schemas-config
72         - mountPath: /opt/app/sparky/appconfig/spring-beans/
73           name: {{ include "common.fullname" . }}-spring-beans-config
74         - mountPath: /var/log/onap
75           name: {{ include "common.fullname" . }}-logs
76         - mountPath: /opt/app/sparky/appconfig/logging/
77           name: {{ include "common.fullname" . }}-log-conf
78         ports:
79         - containerPort: {{ .Values.service.internalPort }}
80         - containerPort: {{ .Values.service.internalPort2 }}
81         # disable liveness probe when breakpoints set in debugger
82         # so K8s doesn't restart unresponsive container
83         {{- if eq .Values.liveness.enabled true }}
84         livenessProbe:
85           tcpSocket:
86             port: {{ .Values.service.internalPort2 }}
87           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
88           periodSeconds: {{ .Values.liveness.periodSeconds }}
89         {{ end -}}
90         readinessProbe:
91           tcpSocket:
92             port: {{ .Values.service.internalPort2 }}
93           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
94           periodSeconds: {{ .Values.readiness.periodSeconds }}
95         resources:
96 {{ toYaml .Values.resources | indent 10 }}
97       {{- if .Values.nodeSelector }}
98       nodeSelector:
99 {{ toYaml .Values.nodeSelector | indent 8 }}
100       {{- end -}}
101       {{- if .Values.affinity }}
102       affinity:
103 {{ toYaml .Values.affinity | indent 8 }}
104       {{- end }}
105
106       # side car containers
107       - name: filebeat-onap
108         image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
109         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
110         volumeMounts:
111         - mountPath: /usr/share/filebeat/filebeat.yml
112           subPath: filebeat.yml
113           name: filebeat-conf
114         - mountPath: /var/log/onap
115           name: {{ include "common.fullname" . }}-logs
116         - mountPath: /usr/share/filebeat/data
117           name: aai-sparky-filebeat
118
119       volumes:
120       - name: localtime
121         hostPath:
122           path: /etc/localtime
123       - name: {{ include "common.fullname" . }}-config
124         configMap:
125           name: {{ include "common.fullname" . }}
126       - name: {{ include "common.fullname" . }}-auth-config
127         secret:
128           secretName: {{ include "common.fullname" . }}
129       - name: {{ include "common.fullname" . }}-camel-rests-config
130         configMap:
131           name: {{ include "common.fullname" . }}-camel-rests
132       - name: {{ include "common.fullname" . }}-descriptors-config
133         configMap:
134           name: {{ include "common.fullname" . }}-descriptors
135       - name: {{ include "common.fullname" . }}-filters-config
136         configMap:
137           name: {{ include "common.fullname" . }}-filters
138       - name: {{ include "common.fullname" . }}-portal-config
139         configMap:
140           name: {{ include "common.fullname" . }}-portal
141       - name: {{ include "common.fullname" . }}-portal-boot-inf-config
142         configMap:
143           name: {{ include "common.fullname" . }}-boot-inf
144       - name: {{ include "common.fullname" . }}-schemas-config
145         configMap:
146           name: {{ include "common.fullname" . }}-schemas
147       - name: {{ include "common.fullname" . }}-spring-beans-config
148         configMap:
149           name: {{ include "common.fullname" . }}-spring-beans
150       - name: filebeat-conf
151         configMap:
152           name: aai-filebeat
153       - name: {{ include "common.fullname" . }}-logs
154         emptyDir: {}
155       - name: aai-sparky-filebeat
156         emptyDir: {}
157       - name: {{ include "common.fullname" . }}-log-conf
158         configMap:
159           name: {{ include "common.fullname" . }}-log
160       restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
161       imagePullSecrets:
162       - name: "{{ include "common.namespace" . }}-docker-registry-key"