[DCAEMOD] Uses new tpls for repos / images
[oom.git] / kubernetes / pomba / components / pomba-validation-service / 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   template:
30     metadata:
31       labels:
32         app: {{ include "common.name" . }}
33         release: {{ include "common.release" . }}
34     spec:
35       containers:
36         - name: {{ include "common.name" . }}
37           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
38           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
39           ports:
40           - containerPort: {{ .Values.service.internalPort }}
41           # disable liveness probe when breakpoints set in debugger
42           # so K8s doesn't restart unresponsive container
43           {{ if .Values.liveness.enabled }}
44           livenessProbe:
45             tcpSocket:
46               port: {{ .Values.service.internalPort }}
47             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
48             periodSeconds: {{ .Values.liveness.periodSeconds }}
49           {{ end }}
50           {{ if .Values.readiness.enabled }}
51           readinessProbe:
52             tcpSocket:
53               port: {{ .Values.service.internalPort }}
54             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
55             periodSeconds: {{ .Values.readiness.periodSeconds }}
56           {{ end }}
57           env:
58             - name: APP_HOME
59               value: "{{ .Values.config.appDir }}"
60             - name: CONFIG_HOME
61               value: "{{ .Values.config.configDir }}"
62             - name: MAX_HEAP
63               value: "{{ .Values.config.maxHeap }}"
64           volumeMounts:
65           - mountPath: /etc/localtime
66             name: localtime
67             readOnly: true
68           - mountPath: {{ .Values.config.appDir }}/application.properties
69             name: root-config-app-prop
70             subPath: application.properties
71           - mountPath: {{ .Values.config.configDir }}/
72             name: properties
73           - mountPath: {{ .Values.config.configAuthDir }}/
74             name: config-auth
75           - mountPath: {{ .Values.config.configTopicsDir }}/
76             name: config-topics
77           - mountPath: {{ .Values.config.rulesDir }}/
78             name: rules
79           resources:
80 {{ include "common.resources" . | indent 12 }}
81         {{- if .Values.nodeSelector }}
82         nodeSelector:
83 {{ toYaml .Values.nodeSelector | indent 10 }}
84         {{- end -}}
85         {{- if .Values.affinity }}
86         affinity:
87 {{ toYaml .Values.affinity | indent 10 }}
88         {{- end }}
89
90         # Filebeat sidecar container
91         - name: {{ include "common.name" . }}-filebeat-onap
92           image: {{ include "repositoryGenerator.image.logging" . }}
93           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
94           volumeMounts:
95           - name: {{ include "common.fullname" . }}-filebeat-conf
96             mountPath: /usr/share/filebeat/filebeat.yml
97             subPath: filebeat.yml
98           - name: {{ include "common.fullname" . }}-data-filebeat
99             mountPath: /usr/share/filebeat/data
100           - name: {{ include "common.fullname" . }}-logs
101             mountPath: /opt/app/logs
102
103       volumes:
104         - name: localtime
105           hostPath:
106             path: /etc/localtime
107         - name: {{ include "common.fullname" . }}-filebeat-conf
108           configMap:
109             name: {{ include "common.release" . }}-pomba-filebeat-configmap
110         - name: {{ include "common.fullname" . }}-data-filebeat
111           emptyDir: {}
112         - name: root-config-app-prop
113           configMap:
114             name: {{ include "common.fullname" . }}-root-config
115             defaultMode: 0644
116         - name:  {{ include "common.fullname" . }}-logs
117           emptyDir: {}
118         - name: properties
119           configMap:
120             name: {{ include "common.fullname" . }}-config-properties
121             defaultMode: 0644
122             items:
123             - key: validation-service.properties
124               path: validation-service.properties
125             - key: validation-service-auth.properties
126               path: validation-service-auth.properties
127             - key: rule-indexing.properties
128               path: rule-indexing.properties
129             - key: rule-data-dictionary.properties
130               path: rule-data-dictionary.properties
131             - key: aai-environment.properties
132               path: aai-environment.properties
133             - key: schemaIngest.properties
134               path: schemaIngest.properties
135             - key: auth_policy.json
136               path: auth_policy.json
137         - name: config-auth
138           secret:
139             secretName: {{ include "common.fullname" . }}-config-auth-secret
140             items:
141             - key: tomcat_keystore
142               path: tomcat_keystore
143             - key: client-cert-onap.p12
144               path: client-cert-onap.p12
145         - name: config-topics
146           configMap:
147             name: {{ include "common.fullname" . }}-config-topics
148             defaultMode: 0644
149             items:
150             - key: topic-poa-audit-result.properties
151               path: topic-poa-audit-result.properties
152             - key: topic-poa-rule-validation.properties
153               path: topic-poa-rule-validation.properties
154         - name: rules
155           configMap:
156             name: {{ include "common.fullname" . }}-rules
157             defaultMode: 0644
158             items:
159             - key: default-rules.groovy
160               path: default-rules.groovy
161       imagePullSecrets:
162       - name: "{{ include "common.namespace" . }}-docker-registry-key"