blob: 08fc3e9148d80edbd94b87ee566373c0dbfe3f56 [file] [log] [blame]
Jakub Latusek2bd138d2020-10-21 13:36:29 +02001{{/*
Geora Barsky417b3b42018-08-17 13:31:36 -04002# 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.
Jakub Latusek2bd138d2020-10-21 13:36:29 +020015*/}}
Geora Barsky417b3b42018-08-17 13:31:36 -040016
17apiVersion: extensions/v1beta1
18kind: Deployment
19metadata:
20 name: {{ include "common.fullname" . }}
21 namespace: {{ include "common.namespace" . }}
22 labels:
23 app: {{ include "common.name" . }}
24 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
Geora Barsky417b3b42018-08-17 13:31:36 -040026 heritage: {{ .Release.Service }}
27spec:
28 replicas: {{ .Values.replicaCount }}
29 selector:
30 matchLabels:
31 app: {{ include "common.name" . }}
32 template:
33 metadata:
34 labels:
35 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010036 release: {{ include "common.release" . }}
Geora Barsky417b3b42018-08-17 13:31:36 -040037 name: {{ include "common.name" . }}
38 spec:
jmacaf645b52018-10-11 12:21:54 +000039 initContainers:
40 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020041 - /app/ready.py
jmacaf645b52018-10-11 12:21:54 +000042 args:
43 - --container-name
44 - pomba-elasticsearch
45 env:
46 - name: NAMESPACE
47 valueFrom:
48 fieldRef:
49 apiVersion: v1
50 fieldPath: metadata.namespace
Sylvain Desbureaux93ed0752020-11-21 21:22:18 +010051 image: {{ include "repositoryGenerator.image.readiness" . }}
jmacaf645b52018-10-11 12:21:54 +000052 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 name: {{ include "common.name" . }}-readiness
Geora Barsky417b3b42018-08-17 13:31:36 -040054 containers:
55 - name: {{ include "common.name" . }}
Sylvain Desbureaux93ed0752020-11-21 21:22:18 +010056 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Geora Barsky417b3b42018-08-17 13:31:36 -040057 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:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000112{{ include "common.resources" . | indent 10 }}
Geora Barsky417b3b42018-08-17 13:31:36 -0400113 {{- 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
Sylvain Desbureaux93ed0752020-11-21 21:22:18 +0100124 image: {{ include "repositoryGenerator.image.logging" . }}
Geora Barsky417b3b42018-08-17 13:31:36 -0400125 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:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100150 name: {{ include "common.release" . }}-pomba-filebeat-configmap
Geora Barsky417b3b42018-08-17 13:31:36 -0400151 - 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"