Merge "Add VFC DB helm charts"
[oom.git] / kubernetes / aai / charts / aai-search-data / 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: "{{ include "common.repository" . }}/{{ .Values.image }}"
40         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
41         env:
42         - name: CONFIG_HOME
43           value: /opt/app/search-data-service/config/
44         - name: KEY_STORE_PASSWORD
45           value: {{ .Values.config.keyStorePassword }}
46         - name: KEY_MANAGER_PASSWORD
47           value: {{ .Values.config.keyManagerPassword }}
48         volumeMounts:
49         - mountPath: /etc/localtime
50           name: localtime
51           readOnly: true
52         - mountPath: /opt/app/search-data-service/config/filter-config.json
53           subPath: filter-config.json
54           name: {{ include "common.fullname" . }}-service-config
55         - mountPath: /opt/app/search-data-service/config/elastic-search.properties
56           subPath: elastic-search.properties
57           name: {{ include "common.fullname" . }}-service-config
58         - mountPath: /opt/app/search-data-service/config/analysis-config.json
59           subPath: analysis-config.json
60           name: {{ include "common.fullname" . }}-service-config
61         - mountPath: /opt/app/search-data-service/config/es-payload-translation.json
62           subPath: es-payload-translation.json
63           name: {{ include "common.fullname" . }}-service-config
64         - mountPath: /opt/app/search-data-service/config/dynamic-custom-template.json
65           subPath: dynamic-custom-template.json
66           name: {{ include "common.fullname" . }}-service-config
67         - mountPath: /opt/app/search-data-service/config/auth/tomcat_keystore
68           subPath: tomcat_keystore
69           name: {{ include "common.fullname" . }}-service-auth-config
70         - mountPath: /opt/app/search-data-service/config/auth/search_policy.json
71           subPath: search_policy.json
72           name: {{ include "common.fullname" . }}-search-policy-config
73         - mountPath: /var/log/onap
74           name: {{ include "common.fullname" . }}-service-logs
75         - mountPath: /opt/app/search-data-service/bundleconfig/etc/logback.xml
76           name: {{ include "common.fullname" . }}-service-log-conf
77           subPath: logback.xml
78         ports:
79         - containerPort: {{ .Values.service.internalPort }}
80         # disable liveness probe when breakpoints set in debugger
81         # so K8s doesn't restart unresponsive container
82         {{- if eq .Values.liveness.enabled true }}
83         livenessProbe:
84           tcpSocket:
85             port: {{ .Values.service.internalPort }}
86           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
87           periodSeconds: {{ .Values.liveness.periodSeconds }}
88         {{ end -}}
89         readinessProbe:
90           tcpSocket:
91             port: {{ .Values.service.internalPort }}
92           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
93           periodSeconds: {{ .Values.readiness.periodSeconds }}
94         resources:
95 {{ toYaml .Values.resources | indent 10 }}
96       {{- if .Values.nodeSelector }}
97       nodeSelector:
98 {{ toYaml .Values.nodeSelector | indent 8 }}
99       {{- end -}}
100       {{- if .Values.affinity }}
101       affinity:
102 {{ toYaml .Values.affinity | indent 8 }}
103       {{- end }}
104
105       # side car containers
106       - name: filebeat-onap
107         image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
108         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
109         volumeMounts:
110         - mountPath: /usr/share/filebeat/filebeat.yml
111           subPath: filebeat.yml
112           name: filebeat-conf
113         - mountPath: /var/log/onap
114           name: {{ include "common.fullname" . }}-service-logs
115         - mountPath: /usr/share/filebeat/data
116           name: {{ include "common.fullname" . }}-service-filebeat
117
118       volumes:
119       - name: localtime
120         hostPath:
121           path: /etc/localtime
122       - name: {{ include "common.fullname" . }}-service-config
123         configMap:
124           name: {{ include "common.fullname" . }}
125       - name: {{ include "common.fullname" . }}-service-auth-config
126         secret:
127           secretName: {{ include "common.fullname" . }}-keystone
128       - name: {{ include "common.fullname" . }}-search-policy-config
129         secret:
130           secretName: {{ include "common.fullname" . }}-policy
131       - name: filebeat-conf
132         configMap:
133           name: aai-filebeat
134       - name: {{ include "common.fullname" . }}-service-logs
135         emptyDir: {}
136       - name: {{ include "common.fullname" . }}-service-filebeat
137         emptyDir: {}
138       - name: {{ include "common.fullname" . }}-service-log-conf
139         configMap:
140          name: {{ include "common.fullname" . }}-service-log
141       restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
142       imagePullSecrets:
143       - name: "{{ include "common.namespace" . }}-docker-registry-key"