[DCAEMOD] Uses new tpls for repos / images
[oom.git] / kubernetes / pomba / charts / pomba-search-data / templates / deployment.yaml
1 {{/*
2 # Copyright © 2017 Amdocs, Bell Canada
3 #
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 */}}
16
17 apiVersion: extensions/v1beta1
18 kind: Deployment
19 metadata:
20   name: {{ include "common.fullname" . }}
21   namespace: {{ include "common.namespace" . }}
22   labels:
23     app: {{ include "common.name" . }}
24     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
25     release: {{ include "common.release" . }}
26     heritage: {{ .Release.Service }}
27 spec:
28   replicas: {{ .Values.replicaCount }}
29   selector:
30     matchLabels:
31       app: {{ include "common.name" . }}
32   template:
33     metadata:
34       labels:
35         app: {{ include "common.name" . }}
36         release: {{ include "common.release" . }}
37       name: {{ include "common.name" . }}
38     spec:
39       initContainers:
40       - command:
41         - /app/ready.py
42         args:
43         - --container-name
44         - pomba-elasticsearch
45         env:
46         - name: NAMESPACE
47           valueFrom:
48             fieldRef:
49               apiVersion: v1
50               fieldPath: metadata.namespace
51         image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
52         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53         name: {{ include "common.name" . }}-readiness
54       containers:
55       - name: {{ include "common.name" . }}
56         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
57         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
58         env:
59         - name: CONFIG_HOME
60           value: /opt/app/search-data-service/config/
61         - name: KEY_STORE_PASSWORD
62           value: {{ .Values.config.keyStorePassword }}
63         - name: KEY_MANAGER_PASSWORD
64           value: {{ .Values.config.keyManagerPassword }}
65         volumeMounts:
66         - mountPath: /etc/localtime
67           name: localtime
68           readOnly: true
69         - mountPath: /opt/app/search-data-service/config/filter-config.json
70           subPath: filter-config.json
71           name: {{ include "common.fullname" . }}-service-config
72         - mountPath: /opt/app/search-data-service/config/elastic-search.properties
73           subPath: elastic-search.properties
74           name: {{ include "common.fullname" . }}-service-config
75         - mountPath: /opt/app/search-data-service/config/analysis-config.json
76           subPath: analysis-config.json
77           name: {{ include "common.fullname" . }}-service-config
78         - mountPath: /opt/app/search-data-service/config/es-payload-translation.json
79           subPath: es-payload-translation.json
80           name: {{ include "common.fullname" . }}-service-config
81         - mountPath: /opt/app/search-data-service/config/dynamic-custom-template.json
82           subPath: dynamic-custom-template.json
83           name: {{ include "common.fullname" . }}-service-config
84         - mountPath: /opt/app/search-data-service/config/auth/tomcat_keystore
85           subPath: tomcat_keystore
86           name: {{ include "common.fullname" . }}-service-auth-config
87         - mountPath: /opt/app/search-data-service/config/auth/search_policy.json
88           subPath: search_policy.json
89           name: {{ include "common.fullname" . }}-search-policy-config
90         - mountPath: /var/log/onap
91           name: {{ include "common.fullname" . }}-service-logs
92         - mountPath: /opt/app/search-data-service/bundleconfig/etc/logback.xml
93           name: {{ include "common.fullname" . }}-service-log-conf
94           subPath: logback.xml
95         ports:
96         - containerPort: {{ .Values.service.internalPort }}
97         # disable liveness probe when breakpoints set in debugger
98         # so K8s doesn't restart unresponsive container
99         {{- if eq .Values.liveness.enabled true }}
100         livenessProbe:
101           tcpSocket:
102             port: {{ .Values.service.internalPort }}
103           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
104           periodSeconds: {{ .Values.liveness.periodSeconds }}
105         {{ end -}}
106         readinessProbe:
107           tcpSocket:
108             port: {{ .Values.service.internalPort }}
109           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
110           periodSeconds: {{ .Values.readiness.periodSeconds }}
111         resources:
112 {{ include "common.resources" . | indent 10 }}
113       {{- if .Values.nodeSelector }}
114       nodeSelector:
115 {{ toYaml .Values.nodeSelector | indent 8 }}
116       {{- end -}}
117       {{- if .Values.affinity }}
118       affinity:
119 {{ toYaml .Values.affinity | indent 8 }}
120       {{- end }}
121
122       # side car containers
123       - name: filebeat-onap
124         image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
125         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
126         volumeMounts:
127         - mountPath: /usr/share/filebeat/filebeat.yml
128           subPath: filebeat.yml
129           name: filebeat-conf
130         - mountPath: /var/log/onap
131           name: {{ include "common.fullname" . }}-service-logs
132         - mountPath: /usr/share/filebeat/data
133           name: {{ include "common.fullname" . }}-service-filebeat
134
135       volumes:
136       - name: localtime
137         hostPath:
138           path: /etc/localtime
139       - name: {{ include "common.fullname" . }}-service-config
140         configMap:
141           name: {{ include "common.fullname" . }}
142       - name: {{ include "common.fullname" . }}-service-auth-config
143         secret:
144           secretName: {{ include "common.fullname" . }}-keystone
145       - name: {{ include "common.fullname" . }}-search-policy-config
146         secret:
147           secretName: {{ include "common.fullname" . }}-policy
148       - name: filebeat-conf
149         configMap:
150           name: {{ include "common.release" . }}-pomba-filebeat-configmap
151       - name: {{ include "common.fullname" . }}-service-logs
152         emptyDir: {}
153       - name: {{ include "common.fullname" . }}-service-filebeat
154         emptyDir: {}
155       - name: {{ include "common.fullname" . }}-service-log-conf
156         configMap:
157          name: {{ include "common.fullname" . }}-service-log
158       restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
159       imagePullSecrets:
160       - name: "{{ include "common.namespace" . }}-docker-registry-key"