blob: d5861fadfc2d0c730b4777f0d432f61ee3751b07 [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
k.kedron2774ab12020-03-26 11:13:46 +010062 - 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/
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +030086 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 }}
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +030092 {{ if eq .Values.liveness.enabled true }}
93 livenessProbe:
94 tcpSocket:
Fuss, Areli (af732p)e2c1f3b2020-03-31 19:02:58 +030095 port: {{ .Values.service.internalPort }}
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +030096 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
97 periodSeconds: {{ .Values.liveness.periodSeconds }}
98 {{ end }}
99 readinessProbe:
100 httpGet:
101 path: /dcaed/healthCheck
Fuss, Areli (af732p)e2c1f3b2020-03-31 19:02:58 +0300102 port: {{ .Values.service.internalPort }}
k.kedronc784bbd2019-09-05 18:28:16 +0200103 scheme: HTTPS
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +0300104 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:
k.kedron2774ab12020-03-26 11:13:46 +0100116 - name: sdc-environments-output
MichaelMorrisb137f7e2020-03-15 17:44:48 +0000117 mountPath: /var/lib/jetty/chef-solo/environments/
k.kedron2774ab12020-03-26 11:13:46 +0100118 - name: sdc-cert
119 mountPath: /var/lib/jetty/chef-solo/cookbooks/Deploy-DCAE/files/default/org.onap.sdc.p12
120 subPath: org.onap.sdc.p12
121 - name: sdc-cert
122 mountPath: /var/lib/jetty/chef-solo/cookbooks/Deploy-DCAE/files/default/org.onap.sdc.trust.jks
123 subPath: org.onap.sdc.trust.jks
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +0300124 - name: {{ include "common.fullname" . }}-localtime
125 mountPath: /etc/localtime
126 readOnly: true
127 - name: {{ include "common.fullname" . }}-logs
k.kedronc784bbd2019-09-05 18:28:16 +0200128 mountPath: /var/lib/jetty/logs
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +0300129 - name: {{ include "common.fullname" . }}-logback
130 mountPath: /tmp/logback.xml
131 subPath: logback.xml
132 lifecycle:
133 postStart:
134 exec:
135 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"]
136 resources:
137{{ include "common.resources" . | indent 12 }}
138 {{- if .Values.nodeSelector }}
139 nodeSelector:
140{{ toYaml .Values.nodeSelector | indent 10 }}
141 {{- end -}}
142 {{- if .Values.affinity }}
143 affinity:
144{{ toYaml .Values.affinity | indent 10 }}
145 {{- end }}
146
147 # side car containers
148 - name: {{ include "common.name" . }}-filebeat-onap
149 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
150 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
151 volumeMounts:
152 - name: {{ include "common.fullname" . }}-filebeat-conf
153 mountPath: /usr/share/filebeat/filebeat.yml
154 subPath: filebeat.yml
155 - name: {{ include "common.fullname" . }}-logs
156 mountPath: /var/log/onap
157 - name: {{ include "common.fullname" . }}-data-filebeat
158 mountPath: /usr/share/filebeat/data
159 volumes:
160 - name: {{ include "common.fullname" . }}-localtime
161 hostPath:
162 path: /etc/localtime
k.kedron2774ab12020-03-26 11:13:46 +0100163 - name: sdc-cert
164 secret:
165 secretName: sdc-cert
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +0300166 - name: {{ include "common.fullname" . }}-filebeat-conf
167 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100168 name: {{ include "common.release" . }}-sdc-filebeat-configmap
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +0300169 - name: {{ include "common.fullname" . }}-data-filebeat
170 emptyDir: {}
171 - name: {{ include "common.fullname" . }}-logback
172 configMap:
173 name : {{ include "common.fullname" . }}-logging-configmap
174 - name: {{ include "common.fullname" . }}-environments
175 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100176 name: {{ include "common.release" . }}-sdc-environments-configmap
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +0300177 defaultMode: 0755
k.kedron2774ab12020-03-26 11:13:46 +0100178 - name: sdc-environments-output
179 emptyDir: { medium: "Memory" }
180 - name: {{ include "common.fullname" . }}-logs
Areli, Fuss (af732p)307fdc72018-05-29 14:40:03 +0300181 emptyDir: {}
182 imagePullSecrets:
183 - name: "{{ include "common.namespace" . }}-docker-registry-key"