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