Merge "[Gizmo] Use nodePortPrefix variable"
[oom.git] / kubernetes / aai / charts / aai-champ / templates / deployment.yaml
1 # Copyright © 2018 Amdocs, AT&T
2 # Modifications Copyright © 2018 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 apiVersion: extensions/v1beta1
17 kind: Deployment
18 metadata:
19   name: {{ include "common.fullname" . }}
20   namespace: {{ include "common.namespace" . }}
21   labels:
22     app: {{ include "common.name" . }}
23     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24     release: {{ .Release.Name }}
25     heritage: {{ .Release.Service }}
26 spec:
27   replicas: {{ .Values.replicaCount }}
28   template:
29     metadata:
30       labels:
31         app: {{ include "common.name" . }}
32         release: {{ .Release.Name }}
33     spec:
34       containers:
35         - name: {{ include "common.name" . }}
36           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
37           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38           ports:
39           - containerPort: {{ .Values.service.internalPort }}
40           # disable liveness probe when breakpoints set in debugger
41           # so K8s doesn't restart unresponsive container
42           {{ if .Values.liveness.enabled }}
43           livenessProbe:
44             tcpSocket:
45               port: {{ .Values.service.internalPort }}
46             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
47             periodSeconds: {{ .Values.liveness.periodSeconds }}
48           {{ end }}
49           readinessProbe:
50             tcpSocket:
51               port: {{ .Values.service.internalPort }}
52             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
53             periodSeconds: {{ .Values.readiness.periodSeconds }}
54           env:
55             - name: CONFIG_HOME
56               value: "/opt/app/champ-service/appconfig"
57             - name: GRAPHIMPL
58               value: "janus-deps"
59             - name: KEY_STORE_PASSWORD
60               valueFrom:
61                 secretKeyRef:
62                   name: {{ template "common.fullname" . }}-pass
63                   key: KEY_STORE_PASSWORD
64             - name: KEY_MANAGER_PASSWORD
65               valueFrom:
66                 secretKeyRef:
67                   name: {{ template "common.fullname" . }}-pass
68                   key: KEY_MANAGER_PASSWORD
69             - name: SERVICE_BEANS
70               value: "/opt/app/champ-service/dynamic/conf"
71           volumeMounts:
72           - mountPath: /etc/localtime
73             name: localtime
74             readOnly: true
75           - mountPath: /opt/app/champ-service/appconfig/champ-api.properties
76             name: {{ include "common.fullname" . }}-config
77             subPath: champ-api.properties
78           - mountPath: /opt/app/champ-service/appconfig/auth
79             name: {{ include "common.fullname" . }}-secrets
80           - mountPath: /opt/app/champ-service/dynamic/conf/champ-beans.xml
81             name: {{ include "common.fullname" . }}-dynamic-config
82             subPath: champ-beans.xml
83           - mountPath: /opt/app/champ-service/bundleconfig/etc/logback.xml
84             name: {{ include "common.fullname" . }}-logback-config
85             subPath: logback.xml
86           - mountPath: /var/log/onap
87             name: {{ include "common.fullname" . }}-logs
88           resources:
89 {{ include "common.resources" . | indent 12 }}
90         {{- if .Values.nodeSelector }}
91         nodeSelector:
92 {{ toYaml .Values.nodeSelector | indent 10 }}
93         {{- end -}}
94         {{- if .Values.affinity }}
95         affinity:
96 {{ toYaml .Values.affinity | indent 10 }}
97         {{- end }}
98
99         # side car containers
100         - name: filebeat-onap
101           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
102           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
103           volumeMounts:
104           - mountPath: /usr/share/filebeat/filebeat.yml
105             subPath: filebeat.yml
106             name: filebeat-conf
107           - mountPath: /var/log/onap
108             name: {{ include "common.fullname" . }}-logs
109           - mountPath: /usr/share/filebeat/data
110             name: aai-filebeat
111
112       volumes:
113         - name: localtime
114           hostPath:
115             path: /etc/localtime
116         - name: {{ include "common.fullname" . }}-config
117           configMap:
118             name: {{ include "common.fullname" . }}
119             items:
120             - key: champ-api.properties
121               path: champ-api.properties
122         - name: {{ include "common.fullname" . }}-secrets
123           secret:
124             secretName: {{ include "common.fullname" . }}-champ
125         - name: {{ include "common.fullname" . }}-dynamic-config
126           configMap:
127             name: {{ include "common.fullname" . }}-dynamic
128             items:
129             - key: champ-beans.xml
130               path: champ-beans.xml
131         - name: {{ include "common.fullname" . }}-logs
132           emptyDir: {}
133         - name: {{ include "common.fullname" . }}-logback-config
134           configMap:
135             name: {{ include "common.fullname" . }}-log-configmap
136             items:
137             - key: logback.xml
138               path: logback.xml
139         - name: filebeat-conf
140           configMap:
141             name: aai-filebeat
142         - name: aai-filebeat
143           emptyDir: {}
144       imagePullSecrets:
145       - name: "{{ include "common.namespace" . }}-docker-registry-key"