Merge "Remove logback and bump up the clamp version"
[oom.git] / kubernetes / sdc / charts / sdc-dcae-dt / 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: {{ include "common.release" . }}
24     heritage: {{ .Release.Service }}
25 spec:
26   replicas: {{ .Values.replicaCount }}
27   template:
28     metadata:
29       labels:
30         app: {{ include "common.name" . }}
31         release: {{ include "common.release" . }}
32     spec:
33       initContainers:
34       - name: {{ include "common.name" . }}-readiness
35         command:
36         - /root/ready.py
37         args:
38         - --container-name
39         - sdc-dcae-be
40         env:
41         - name: NAMESPACE
42           valueFrom:
43             fieldRef:
44               apiVersion: v1
45               fieldPath: metadata.namespace
46         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
47         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
48       - name: {{ include "common.name" . }}-job-completion
49         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
50         imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
51         command:
52         - /root/job_complete.py
53         args:
54         - --job-name
55         - {{ include "common.release" . }}-sdc-dcae-be-tools
56         env:
57         - name: NAMESPACE
58           valueFrom:
59             fieldRef:
60               apiVersion: v1
61               fieldPath: metadata.namespace
62       - name: {{ include "common.name" . }}-update-config
63         image: "{{ .Values.global.envsubstImage }}"
64         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
65         command:
66           - sh
67         args:
68           - -c
69           - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config-output/${PFILE}; chmod 0755 /config-output/${PFILE}; done"
70         env:
71           - name: KEYSTORE_PASS
72             valueFrom:
73               secretKeyRef:
74                 name: {{ include "common.release" . }}-sdc-cs-secrets
75                 key: keystore_password
76           - name: TRUSTSTORE_PASS
77             valueFrom:
78               secretKeyRef:
79                 name: {{ include "common.release" . }}-sdc-cs-secrets
80                 key: truststore_password
81         volumeMounts:
82           - name: {{ include "common.fullname" . }}-environments
83             mountPath: /config-input/
84           - name: sdc-environments-output
85             mountPath: /config-output/
86       containers:
87         - name: {{ include "common.name" . }}
88           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
89           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
90           ports:
91           - containerPort: {{ .Values.service.internalPort }}
92           {{ if eq .Values.liveness.enabled true }}
93           livenessProbe:
94             tcpSocket:
95               port: {{ .Values.service.internalPort }}
96             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
97             periodSeconds: {{ .Values.liveness.periodSeconds }}
98           {{ end }}
99           readinessProbe:
100             httpGet:
101               path: /dcae/healthCheckOld
102               port: {{ .Values.service.internalPort }}
103               scheme: HTTPS
104             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
105             periodSeconds: {{ .Values.readiness.periodSeconds }}
106           env:
107           - name: ENVNAME
108             value: {{ .Values.global.env.name }}
109           - name: JAVA_OPTIONS
110             value: {{ .Values.config.javaOptions }}
111           - name: HOST_IP
112             valueFrom:
113               fieldRef:
114                 fieldPath: status.podIP
115           volumeMounts:
116           - name: sdc-environments-output
117             mountPath: /var/lib/jetty/chef-solo/environments/
118           - name: sdc-cert
119             mountPath: /var/lib/jetty/chef-solo/cookbooks/dcae-dt/files/default/org.onap.sdc.p12
120             subPath: org.onap.sdc.p12
121           - name: sdc-cert
122             mountPath: /var/lib/jetty/chef-solo/cookbooks/dcae-dt/files/default/org.onap.sdc.trust.jks
123             subPath: org.onap.sdc.trust.jks
124           - name: {{ include "common.fullname" . }}-localtime
125             mountPath: /etc/localtime
126             readOnly: true
127           - name: {{ include "common.fullname" . }}-logs
128             mountPath: /var/lib/jetty/logs
129           - name: {{ include "common.fullname" . }}-logback
130             mountPath: /tmp/logback.xml
131             subPath: logback.xml
132           resources:
133 {{ include "common.resources" . | indent 12 }}
134         {{- if .Values.nodeSelector }}
135         nodeSelector:
136 {{ toYaml .Values.nodeSelector | indent 10 }}
137         {{- end -}}
138         {{- if .Values.affinity }}
139         affinity:
140 {{ toYaml .Values.affinity | indent 10 }}
141         {{- end }}
142
143         # side car containers
144         - name: {{ include "common.name" . }}-filebeat-onap
145           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
146           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
147           volumeMounts:
148           - name: {{ include "common.fullname" . }}-filebeat-conf
149             mountPath: /usr/share/filebeat/filebeat.yml
150             subPath: filebeat.yml
151           - name: {{ include "common.fullname" . }}-logs
152             mountPath: /var/log/onap
153           - name: {{ include "common.fullname" . }}-data-filebeat
154             mountPath: /usr/share/filebeat/data
155       volumes:
156         - name: {{ include "common.fullname" . }}-localtime
157           hostPath:
158             path: /etc/localtime
159         - name: sdc-cert
160           secret:
161             secretName: sdc-cert
162         - name: {{ include "common.fullname" . }}-filebeat-conf
163           configMap:
164             name: {{ include "common.release" . }}-sdc-filebeat-configmap
165         - name: {{ include "common.fullname" . }}-data-filebeat
166           emptyDir: {}
167         - name: {{ include "common.fullname" . }}-logback
168           configMap:
169             name : {{ include "common.fullname" . }}-logging-configmap
170         - name: {{ include "common.fullname" . }}-environments
171           configMap:
172             name: {{ include "common.release" . }}-sdc-environments-configmap
173             defaultMode: 0755
174         - name: sdc-environments-output
175           emptyDir: { medium: "Memory" }
176         - name: {{ include "common.fullname" . }}-logs
177           emptyDir: {}
178       imagePullSecrets:
179       - name: "{{ include "common.namespace" . }}-docker-registry-key"