blob: 1daee714b608f6f5ab84c3cbaf4d0e0d5590e4c6 [file] [log] [blame]
priyanshu3af9db62018-08-16 16:23:52 +05301# 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
15apiVersion: extensions/v1beta1
16kind: Deployment
17metadata:
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 }}
25spec:
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 }}
dfx1971cb300942019-05-12 10:17:56 +030054 - containerPort: {{ .Values.service.internalPort2 }}
priyanshu3af9db62018-08-16 16:23:52 +053055 {{ 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 }}
dfx1971b2734ed2019-05-07 10:35:58 +030074 - name: IS_HTTPS
75 value: "{{ .Values.config.isHttpsEnabled}}"
76 {{ if and .Values.config.isHttpsEnabled (eq .Values.security.isDefaultStore false) }}
77 - name: KEYSTORE_PASS
r.bogacki08a72d62019-10-01 08:43:44 +020078 value: "{{ .Values.security.keystorePass}}"
dfx1971b2734ed2019-05-07 10:35:58 +030079 - name: TRUSTSTORE_PASS
r.bogacki08a72d62019-10-01 08:43:44 +020080 value: "{{ .Values.security.truststorePass}}"
dfx1971b2734ed2019-05-07 10:35:58 +030081 - name: TRUSTSTORE_PATH
82 value: "{{ .Values.security.storePath }}/{{ .Values.security.truststoreFilename }}"
83 - name: KEYSTORE_PATH
84 value: "{{ .Values.security.storePath }}/{{ .Values.security.keystoreFilename }}"
dfx1971b2734ed2019-05-07 10:35:58 +030085 {{ end }}
priyanshu3af9db62018-08-16 16:23:52 +053086 volumeMounts:
87 - name: {{ include "common.fullname" . }}-localtime
88 mountPath: /etc/localtime
89 readOnly: true
90 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000091{{ include "common.resources" . | indent 12 }}
priyanshu3af9db62018-08-16 16:23:52 +053092 {{- 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 }}
priyanshu3af9db62018-08-16 16:23:52 +0530100 # 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"