blob: a70f48515303d3a8f1b554c5d4f22da4c7cba2a6 [file] [log] [blame]
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +03001# Copyright © 2018 Amdocs, AT&T, 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 "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010023 release: {{ include "common.release" . }}
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +030024 heritage: {{ .Release.Service }}
25spec:
26 replicas: {{ .Values.replicaCount }}
27 template:
28 metadata:
29 labels:
30 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010031 release: {{ include "common.release" . }}
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +030032 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
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010055 - {{ include "common.release" . }}-sdc-dcae-be-tools
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +030056 env:
57 - name: NAMESPACE
58 valueFrom:
59 fieldRef:
60 apiVersion: v1
61 fieldPath: metadata.namespace
62 containers:
63 - name: {{ include "common.name" . }}
64 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
65 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
66 ports:
67 - containerPort: {{ .Values.service.internalPort }}
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +030068 {{ if eq .Values.liveness.enabled true }}
69 livenessProbe:
70 tcpSocket:
Fuss, Areli (af732p)e2c1f3b2020-03-31 19:02:58 +030071 port: {{ .Values.service.internalPort }}
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +030072 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
73 periodSeconds: {{ .Values.liveness.periodSeconds }}
74 {{ end }}
75 readinessProbe:
76 httpGet:
77 path: /dcaed/healthCheck
Fuss, Areli (af732p)e2c1f3b2020-03-31 19:02:58 +030078 port: {{ .Values.service.internalPort }}
k.kedronc784bbd2019-09-05 18:28:16 +020079 scheme: HTTPS
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +030080 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
81 periodSeconds: {{ .Values.readiness.periodSeconds }}
82 env:
83 - name: ENVNAME
84 value: {{ .Values.global.env.name }}
85 - name: JAVA_OPTIONS
86 value: {{ .Values.config.javaOptions }}
87 - name: HOST_IP
88 valueFrom:
89 fieldRef:
90 fieldPath: status.podIP
91 volumeMounts:
92 - name: {{ include "common.fullname" . }}-environments
MichaelMorrisb137f7e2020-03-15 17:44:48 +000093 mountPath: /var/lib/jetty/chef-solo/environments/
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +030094 - name: {{ include "common.fullname" . }}-localtime
95 mountPath: /etc/localtime
96 readOnly: true
97 - name: {{ include "common.fullname" . }}-logs
k.kedronc784bbd2019-09-05 18:28:16 +020098 mountPath: /var/lib/jetty/logs
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +030099 - name: {{ include "common.fullname" . }}-logback
100 mountPath: /tmp/logback.xml
101 subPath: logback.xml
102 lifecycle:
103 postStart:
104 exec:
105 command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/var/lib/jetty/config/dcae-fe/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
106 resources:
107{{ include "common.resources" . | indent 12 }}
108 {{- if .Values.nodeSelector }}
109 nodeSelector:
110{{ toYaml .Values.nodeSelector | indent 10 }}
111 {{- end -}}
112 {{- if .Values.affinity }}
113 affinity:
114{{ toYaml .Values.affinity | indent 10 }}
115 {{- end }}
116
117 # side car containers
118 - name: {{ include "common.name" . }}-filebeat-onap
119 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
120 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
121 volumeMounts:
122 - name: {{ include "common.fullname" . }}-filebeat-conf
123 mountPath: /usr/share/filebeat/filebeat.yml
124 subPath: filebeat.yml
125 - name: {{ include "common.fullname" . }}-logs
126 mountPath: /var/log/onap
127 - name: {{ include "common.fullname" . }}-data-filebeat
128 mountPath: /usr/share/filebeat/data
129 volumes:
130 - name: {{ include "common.fullname" . }}-localtime
131 hostPath:
132 path: /etc/localtime
133 - name: {{ include "common.fullname" . }}-filebeat-conf
134 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100135 name: {{ include "common.release" . }}-sdc-filebeat-configmap
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +0300136 - name: {{ include "common.fullname" . }}-data-filebeat
137 emptyDir: {}
138 - name: {{ include "common.fullname" . }}-logback
139 configMap:
140 name : {{ include "common.fullname" . }}-logging-configmap
141 - name: {{ include "common.fullname" . }}-environments
142 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100143 name: {{ include "common.release" . }}-sdc-environments-configmap
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +0300144 defaultMode: 0755
145 - name: {{ include "common.fullname" . }}-logs
146 emptyDir: {}
147 imagePullSecrets:
148 - name: "{{ include "common.namespace" . }}-docker-registry-key"