Merge "Updated The Version of Holmes"
[oom.git] / kubernetes / sdc / charts / sdc-wfd-fe / templates / deployment.yaml
1 # Copyright © 2018 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   template:
28     metadata:
29       labels:
30         app: {{ include "common.name" . }}
31         release: {{ .Release.Name }}
32     spec:
33       initContainers:
34       - name: {{ include "common.name" . }}-readiness
35         command:
36         - /root/ready.py
37         args:
38         - --container-name
39         - "sdc-wfd-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       containers:
49         - name: {{ include "common.name" . }}
50           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
51           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52           ports:
53           - containerPort: {{ .Values.service.internalPort }}
54           - containerPort: {{ .Values.service.internalPort2 }}
55           {{ if .Values.liveness.enabled }}
56           livenessProbe:
57             tcpSocket:
58               port: {{ .Values.service.internalPort }}
59             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
60             periodSeconds: {{ .Values.liveness.periodSeconds }}
61           {{ end }}
62           readinessProbe:
63             tcpSocket:
64               port: {{ .Values.service.internalPort }}
65             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
66             periodSeconds: {{ .Values.readiness.periodSeconds }}
67           env:
68           - name: ENVNAME
69             value: {{ .Values.global.env.name }}
70           - name: JAVA_OPTIONS
71             value: {{ .Values.config.javaOptions }}
72           - name: BACKEND
73             value: {{ .Values.config.backendServerURL }}
74           - name: IS_HTTPS
75             value: "{{ .Values.config.isHttpsEnabled}}"
76             {{ if and .Values.config.isHttpsEnabled (eq .Values.security.isDefaultStore false) }}
77           - name: KEYSTORE_PASS
78             value: "{{ .Values.security.keystorePass}}"
79           - name: TRUSTSTORE_PASS
80             value: "{{ .Values.security.truststorePass}}"
81           - name: TRUSTSTORE_PATH
82             value: "{{ .Values.security.storePath }}/{{ .Values.security.truststoreFilename }}"
83           - name: KEYSTORE_PATH
84             value: "{{ .Values.security.storePath }}/{{ .Values.security.keystoreFilename }}"
85             {{ end }}
86           volumeMounts:
87           - name: {{ include "common.fullname" . }}-localtime
88             mountPath: /etc/localtime
89             readOnly: true
90           resources:
91 {{ include "common.resources" . | indent 12 }}
92         {{- if .Values.nodeSelector }}
93         nodeSelector:
94 {{ toYaml .Values.nodeSelector | indent 10 }}
95         {{- end -}}
96         {{- if .Values.affinity }}
97         affinity:
98 {{ toYaml .Values.affinity | indent 10 }}
99         {{- end }}
100         # side car containers
101         - name: {{ include "common.name" . }}-filebeat-onap
102           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
103           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
104           volumeMounts:
105           - name: {{ include "common.fullname" . }}-filebeat-conf
106             mountPath: /usr/share/filebeat/filebeat.yml
107             subPath: filebeat.yml
108           - name: {{ include "common.fullname" . }}-logs
109             mountPath: /var/log/onap
110           - name: {{ include "common.fullname" . }}-data-filebeat
111             mountPath: /usr/share/filebeat/data
112       volumes:
113         - name: {{ include "common.fullname" . }}-localtime
114           hostPath:
115             path: /etc/localtime
116         - name: {{ include "common.fullname" . }}-filebeat-conf
117           configMap:
118             name: {{ .Release.Name }}-sdc-filebeat-configmap
119         - name: {{ include "common.fullname" . }}-data-filebeat
120           emptyDir: {}
121         - name:  {{ include "common.fullname" . }}-logs
122           emptyDir: {}
123       imagePullSecrets:
124       - name: "{{ include "common.namespace" . }}-docker-registry-key"