blob: 007b1308c018a391f8351af65e63c4bfff8f5daf [file] [log] [blame]
Jakub Latusekd8eaff62020-10-21 13:36:29 +02001{{/*
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +00002# Copyright © 2017 Amdocs, AT&T, Bell Canada
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00003# Modifications Copyright © 2018 ZTE
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +00004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Jakub Latusekd8eaff62020-10-21 13:36:29 +020016*/}}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000017
kwasiel59cc6a42020-07-23 10:02:49 +000018apiVersion: apps/v1
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000019kind: Deployment
20metadata:
21 name: {{ include "common.fullname" . }}
22 namespace: {{ include "common.namespace" . }}
23 labels:
24 app: {{ include "common.name" . }}
25 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010026 release: {{ include "common.release" . }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000027 heritage: {{ .Release.Service }}
28spec:
kwasiel59cc6a42020-07-23 10:02:49 +000029 selector:
30 matchLabels:
31 app: {{ include "common.name" . }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000032 replicas: {{ .Values.replicaCount }}
33 template:
34 metadata:
35 labels:
36 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010037 release: {{ include "common.release" . }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000038 spec:
ChrisC742a7b22020-09-04 11:29:57 +020039 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000040 - name: {{ include "common.name" . }}-job-completion
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020041 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000042 imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
43 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020044 - /app/ready.py
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000045 args:
46 - --job-name
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010047 - {{ include "common.release" . }}-sdc-onboarding-be-cassandra-init
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000048 env:
49 - name: NAMESPACE
50 valueFrom:
51 fieldRef:
52 apiVersion: v1
53 fieldPath: metadata.namespace
ChrisC32172342020-10-02 16:39:13 +020054 resources:
55 limits:
56 cpu: 100m
57 memory: 100Mi
58 requests:
59 cpu: 3m
60 memory: 20Mi
ChrisC742a7b22020-09-04 11:29:57 +020061 {{- if .Values.global.aafEnabled }}
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:
ChrisC742a7b22020-09-04 11:29:57 +020066 - sh
k.kedron2774ab12020-03-26 11:13:46 +010067 args:
ChrisC742a7b22020-09-04 11:29:57 +020068 - "-c"
69 - |
70 export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0)
71 export KEYSTORE_PASS=$cadi_keystore_password_p12
72 export KEYMANAGER_PASS=$cadi_keystore_password_p12
73 export TRUSTSTORE_PASS=$cadi_truststore_password
74 cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.keystoreFile }} /config-output
75 cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.truststoreFile }} /config-output
76 cd /config-input && \
77 for PFILE in `find . -not -type d | grep -v -F ..`
78 do
79 envsubst <${PFILE} >/config-output/${PFILE}
80 chmod 0755 /config-output/${PFILE}
81 done
82 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
k.kedron2774ab12020-03-26 11:13:46 +010083 - name: {{ include "common.fullname" . }}-environments
84 mountPath: /config-input/
85 - name: sdc-environments-output
86 mountPath: /config-output/
ChrisC32172342020-10-02 16:39:13 +020087 resources:
88 limits:
89 cpu: 100m
90 memory: 100Mi
91 requests:
92 cpu: 3m
93 memory: 20Mi
ChrisC742a7b22020-09-04 11:29:57 +020094 {{- end }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000095 containers:
96 - name: {{ include "common.name" . }}
97 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
98 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
99 ports:
100 - containerPort: {{ .Values.service.internalPort }}
101 - containerPort: {{ .Values.service.internalPort2 }}
102 {{ if eq .Values.liveness.enabled true }}
103 livenessProbe:
amitjaia4cef272019-01-08 15:29:42 +0530104 exec:
105 command:
MichaelMorrisb137f7e2020-03-15 17:44:48 +0000106 - "/var/lib/jetty/ready-probe.sh"
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000107 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
108 periodSeconds: {{ .Values.liveness.periodSeconds }}
Brian Freeman6142d942019-10-02 09:50:19 -0500109 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000110 {{ end }}
111 readinessProbe:
112 exec:
113 command:
MichaelMorrisb137f7e2020-03-15 17:44:48 +0000114 - "/var/lib/jetty/ready-probe.sh"
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000115 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
116 periodSeconds: {{ .Values.readiness.periodSeconds }}
Brian Freeman6142d942019-10-02 09:50:19 -0500117 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
ChrisC32172342020-10-02 16:39:13 +0200118 resources: {{ include "common.resources" . | nindent 12 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000119 env:
120 - name: ENVNAME
ChrisC742a7b22020-09-04 11:29:57 +0200121 value: {{ .Values.env.name }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000122 - name: JAVA_OPTIONS
123 value: {{ .Values.config.javaOptions }}
124 - name: SDC_CLUSTER_NAME
ChrisC742a7b22020-09-04 11:29:57 +0200125 value: "SDC-CS-{{ .Values.env.name }}"
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000126 - name: cassandra_ssl_enabled
127 value: {{ .Values.config.cassandraSslEnabled | quote }}
128 - name: HOST_IP
129 valueFrom:
130 fieldRef:
131 fieldPath: status.podIP
132 - name: SDC_USER
133 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100134 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000135 - name: SDC_PASSWORD
136 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100137 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
kooper543d3aa2019-05-02 10:27:15 +0000138 - name: SDC_CERT_DIR
139 value: {{ .Values.cert.certDir }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000140 volumeMounts:
k.kedron2774ab12020-03-26 11:13:46 +0100141 - name: sdc-environments-output
MichaelMorrisb137f7e2020-03-15 17:44:48 +0000142 mountPath: /var/lib/jetty/chef-solo/environments/
ChrisC742a7b22020-09-04 11:29:57 +0200143 - name: sdc-environments-output
k.kedron2774ab12020-03-26 11:13:46 +0100144 mountPath: /var/lib/jetty/chef-solo/cookbooks/sdc-onboard-backend/files/default/org.onap.sdc.p12
145 subPath: org.onap.sdc.p12
ChrisC742a7b22020-09-04 11:29:57 +0200146 - name: sdc-environments-output
k.kedron2774ab12020-03-26 11:13:46 +0100147 mountPath: /var/lib/jetty/chef-solo/cookbooks/sdc-onboard-backend/files/default/org.onap.sdc.trust.jks
148 subPath: org.onap.sdc.trust.jks
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000149 - name: {{ include "common.fullname" . }}-localtime
150 mountPath: /etc/localtime
151 readOnly: true
152 - name: {{ include "common.fullname" . }}-logs
153 mountPath: /var/log/onap
154 - name: {{ include "common.fullname" . }}-logback
155 mountPath: /tmp/logback.xml
156 subPath: logback.xml
157 lifecycle:
158 postStart:
159 exec:
160 command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/var/lib/jetty/config/onboarding-be/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000161 # side car containers
162 - name: {{ include "common.name" . }}-filebeat-onap
163 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
164 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
165 volumeMounts:
166 - name: {{ include "common.fullname" . }}-filebeat-conf
167 mountPath: /usr/share/filebeat/filebeat.yml
168 subPath: filebeat.yml
169 - name: {{ include "common.fullname" . }}-logs
170 mountPath: /var/log/onap
171 - name: {{ include "common.fullname" . }}-data-filebeat
172 mountPath: /usr/share/filebeat/data
ChrisC32172342020-10-02 16:39:13 +0200173 resources:
174 limits:
175 cpu: 100m
176 memory: 100Mi
177 requests:
178 cpu: 3m
179 memory: 20Mi
ChrisC742a7b22020-09-04 11:29:57 +0200180 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000181 - name: {{ include "common.fullname" . }}-localtime
182 hostPath:
183 path: /etc/localtime
184 - name: {{ include "common.fullname" . }}-filebeat-conf
185 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100186 name: {{ include "common.release" . }}-sdc-filebeat-configmap
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000187 - name: {{ include "common.fullname" . }}-data-filebeat
188 emptyDir: {}
189 - name: {{ include "common.fullname" . }}-logback
190 configMap:
191 name : {{ include "common.fullname" . }}-logging-configmap
192 - name: {{ include "common.fullname" . }}-environments
193 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100194 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000195 defaultMode: 0755
k.kedron2774ab12020-03-26 11:13:46 +0100196 - name: sdc-environments-output
197 emptyDir: { medium: "Memory" }
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000198 - name: {{ include "common.fullname" . }}-logs
199 emptyDir: {}
200 imagePullSecrets:
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +0000201 - name: "{{ include "common.namespace" . }}-docker-registry-key"