update log helm chart from 2 to 3.0.0
[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       initContainers:
38       - command:
39         - /root/ready.py
40         args:
41         - --container-name
42         - aai-elasticsearch
43         - --container-name
44         - aai-search-data
45         - --container-name
46         - aai
47         env:
48         - name: NAMESPACE
49           valueFrom:
50             fieldRef:
51               apiVersion: v1
52               fieldPath: metadata.namespace
53         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
54         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
55         name: {{ include "common.name" . }}-readiness
56       containers:
57       - name: {{ include "common.name" . }}
58         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
59         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60         env:
61         - name: CONFIG_HOME
62           value: /opt/app/sparky/appconfig/
63         - name: KEYSTORE_ALIAS_PASSWORD
64           value: {{ .Values.config.keystoreAliasPassword }}
65         - name: KEYSTORE_PASSWORD
66           value: {{ .Values.config.keyStorePassword }}
67         - name: SPARKY_SSL_ENABLED
68           value: 'false'
69         - name: SPARKY_PORTAL_ENABLED
70           value: 'false'
71         volumeMounts:
72         - mountPath: /etc/localtime
73           name: localtime
74           readOnly: true
75         - mountPath: /opt/app/sparky/appconfig/auth/
76           name: {{ include "common.fullname" . }}-auth-config
77         - mountPath: /opt/app/sparky/appconfig/camel-rests/
78           name: {{ include "common.fullname" . }}-camel-rests-config
79         - mountPath: /opt/app/sparky/appconfig/descriptors/
80           name: {{ include "common.fullname" . }}-descriptors-config
81         - mountPath: /opt/app/sparky/appconfig/filters/
82           name: {{ include "common.fullname" . }}-filters-config
83         - mountPath: /opt/app/sparky/appconfig/
84           name: {{ include "common.fullname" . }}-config
85         - mountPath: /opt/app/sparky/appconfig/portal
86           name: {{ include "common.fullname" . }}-portal-config
87         - mountPath: /opt/app/sparky/appconfig/portal/BOOT-INF/classes
88           name: {{ include "common.fullname" . }}-portal-boot-inf-config
89         - mountPath: /opt/app/sparky/appconfig/schemas
90           name: {{ include "common.fullname" . }}-schemas-config
91         - mountPath: /opt/app/sparky/appconfig/spring-beans/
92           name: {{ include "common.fullname" . }}-spring-beans-config
93         - mountPath: /var/log/onap
94           name: {{ include "common.fullname" . }}-logs
95         - mountPath: /opt/app/sparky/appconfig/logging/
96           name: {{ include "common.fullname" . }}-log-conf
97         ports:
98         - containerPort: {{ .Values.service.internalPort }}
99         - containerPort: {{ .Values.service.internalPort2 }}
100         # disable liveness probe when breakpoints set in debugger
101         # so K8s doesn't restart unresponsive container
102         {{- if eq .Values.liveness.enabled true }}
103         livenessProbe:
104           tcpSocket:
105             port: {{ .Values.service.internalPort }}
106           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
107           periodSeconds: {{ .Values.liveness.periodSeconds }}
108         {{ end -}}
109         readinessProbe:
110           tcpSocket:
111             port: {{ .Values.service.internalPort }}
112           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
113           periodSeconds: {{ .Values.readiness.periodSeconds }}
114         resources:
115 {{ toYaml .Values.resources | indent 10 }}
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 }}
124
125       # 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-sparky-filebeat
137
138       volumes:
139       - name: localtime
140         hostPath:
141           path: /etc/localtime
142       - name: {{ include "common.fullname" . }}-config
143         configMap:
144           name: {{ include "common.fullname" . }}
145       - name: {{ include "common.fullname" . }}-auth-config
146         secret:
147           secretName: {{ include "common.fullname" . }}
148       - name: {{ include "common.fullname" . }}-camel-rests-config
149         configMap:
150           name: {{ include "common.fullname" . }}-camel-rests
151       - name: {{ include "common.fullname" . }}-descriptors-config
152         configMap:
153           name: {{ include "common.fullname" . }}-descriptors
154       - name: {{ include "common.fullname" . }}-filters-config
155         configMap:
156           name: {{ include "common.fullname" . }}-filters
157       - name: {{ include "common.fullname" . }}-portal-config
158         configMap:
159           name: {{ include "common.fullname" . }}-portal
160       - name: {{ include "common.fullname" . }}-portal-boot-inf-config
161         configMap:
162           name: {{ include "common.fullname" . }}-boot-inf
163       - name: {{ include "common.fullname" . }}-schemas-config
164         configMap:
165           name: {{ include "common.fullname" . }}-schemas
166       - name: {{ include "common.fullname" . }}-spring-beans-config
167         configMap:
168           name: {{ include "common.fullname" . }}-spring-beans
169       - name: filebeat-conf
170         configMap:
171           name: aai-filebeat
172       - name: {{ include "common.fullname" . }}-logs
173         emptyDir: {}
174       - name: aai-sparky-filebeat
175         emptyDir: {}
176       - name: {{ include "common.fullname" . }}-log-conf
177         configMap:
178           name: {{ include "common.fullname" . }}-log
179       restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
180       imagePullSecrets:
181       - name: "{{ include "common.namespace" . }}-docker-registry-key"