blob: dcb17d0ba286059d5b921c859e59c9f5c0918772 [file] [log] [blame]
Jakub Latusekd8eaff62020-10-21 13:36:29 +02001{{/*
Mandeep Khindab1f9efe2018-03-28 19:01:55 +00002# Copyright © 2017 Amdocs, Bell Canada
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00003# Modifications Copyright © 2018 AT&T, ZTE
Mandeep Khindab1f9efe2018-03-28 19:01:55 +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 Khindab1f9efe2018-03-28 19:01:55 +000017
kwasiel59cc6a42020-07-23 10:02:49 +000018apiVersion: apps/v1
Mandeep Khindaa1047f42018-03-22 02:12:15 +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 Khindaa1047f42018-03-22 02:12:15 +000027 heritage: {{ .Release.Service }}
28spec:
kwasiel59cc6a42020-07-23 10:02:49 +000029 selector:
30 matchLabels:
31 app: {{ include "common.name" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +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 Khindaa1047f42018-03-22 02:12:15 +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 Desbureaux0a1eaf32020-11-19 17:56:08 +010041 image: {{ include "repositoryGenerator.image.readiness" . }}
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-be-config-backend
ChrisC32172342020-10-02 16:39:13 +020048 - "-t"
49 - "35"
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000050 env:
51 - name: NAMESPACE
52 valueFrom:
53 fieldRef:
54 apiVersion: v1
55 fieldPath: metadata.namespace
ChrisC32172342020-10-02 16:39:13 +020056 resources:
57 limits:
58 cpu: 100m
59 memory: 100Mi
60 requests:
61 cpu: 3m
62 memory: 20Mi
ChrisC742a7b22020-09-04 11:29:57 +020063 {{- if .Values.global.aafEnabled }}
k.kedron2774ab12020-03-26 11:13:46 +010064 - name: {{ include "common.name" . }}-update-config
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010065 image: {{ include "repositoryGenerator.image.envsubst" . }}
k.kedron2774ab12020-03-26 11:13:46 +010066 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
67 command:
ChrisC742a7b22020-09-04 11:29:57 +020068 - sh
k.kedron2774ab12020-03-26 11:13:46 +010069 args:
ChrisC742a7b22020-09-04 11:29:57 +020070 - "-c"
71 - |
72 export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0)
73 export KEYSTORE_PASS=$cadi_keystore_password_p12
74 export KEYMANAGER_PASS=$cadi_keystore_password_p12
75 export TRUSTSTORE_PASS=$cadi_truststore_password
76 cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.keystoreFile }} /config-output
77 cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.truststoreFile }} /config-output
78 cd /config-input && \
79 for PFILE in `find . -not -type d | grep -v -F ..`
80 do
81 envsubst <${PFILE} >/config-output/${PFILE}
82 chmod 0755 /config-output/${PFILE}
83 done
84 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
k.kedron2774ab12020-03-26 11:13:46 +010085 - name: {{ include "common.fullname" . }}-environments
86 mountPath: /config-input/
87 - name: sdc-environments-output
88 mountPath: /config-output/
ChrisC32172342020-10-02 16:39:13 +020089 resources:
90 limits:
91 cpu: 100m
92 memory: 100Mi
93 requests:
94 cpu: 3m
95 memory: 20Mi
ChrisC742a7b22020-09-04 11:29:57 +020096 {{- end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000097 containers:
98 - name: {{ include "common.name" . }}
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010099 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000100 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
ChrisC742a7b22020-09-04 11:29:57 +0200101 {{- if .Values.global.aafEnabled }}
102 command:
103 - sh
104 args:
105 - "-c"
106 - |
107 sed -i '/trustStorePassword/d' ${JETTY_BASE}/startup.sh
108 ${JETTY_BASE}/startup.sh
109 {{- end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000110 ports:
111 - containerPort: {{ .Values.service.internalPort }}
112 - containerPort: {{ .Values.service.internalPort2 }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000113 {{ if eq .Values.liveness.enabled true }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000114 livenessProbe:
115 tcpSocket:
k.kedronc784bbd2019-09-05 18:28:16 +0200116 port: {{ .Values.service.internalPort2 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000117 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
118 periodSeconds: {{ .Values.liveness.periodSeconds }}
Brian Freeman6142d942019-10-02 09:50:19 -0500119 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +0200120 successThreshold: {{ .Values.liveness.successThreshold }}
121 failureThreshold: {{ .Values.liveness.failureThreshold }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000122 {{ end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000123 readinessProbe:
124 tcpSocket:
k.kedronc784bbd2019-09-05 18:28:16 +0200125 port: {{ .Values.service.internalPort2 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000126 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
127 periodSeconds: {{ .Values.readiness.periodSeconds }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +0200128 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
129 successThreshold: {{ .Values.readiness.successThreshold }}
130 failureThreshold: {{ .Values.readiness.failureThreshold }}
131 startupProbe:
132 tcpSocket:
133 port: {{ .Values.service.internalPort2 }}
134 initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }}
135 periodSeconds: {{ .Values.startup.periodSeconds }}
136 timeoutSeconds: {{ .Values.startup.timeoutSeconds }}
137 successThreshold: {{ .Values.startup.successThreshold }}
138 failureThreshold: {{ .Values.startup.failureThreshold }}
ChrisC32172342020-10-02 16:39:13 +0200139 resources: {{ include "common.resources" . | nindent 12 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000140 env:
141 - name: ENVNAME
ChrisC742a7b22020-09-04 11:29:57 +0200142 value: {{ .Values.env.name }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000143 - name: HOST_IP
144 valueFrom:
145 fieldRef:
146 fieldPath: status.podIP
147 - name: JAVA_OPTIONS
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000148 value: {{ .Values.config.javaOptions }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000149 volumeMounts:
k.kedron2774ab12020-03-26 11:13:46 +0100150 - name: sdc-environments-output
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200151 mountPath: /app/jetty/chef-solo/environments/
ChrisC742a7b22020-09-04 11:29:57 +0200152 - name: sdc-environments-output
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200153 mountPath: /app/jetty/chef-solo/cookbooks/sdc-catalog-fe/files/default/org.onap.sdc.p12
k.kedron2774ab12020-03-26 11:13:46 +0100154 subPath: org.onap.sdc.p12
ChrisC742a7b22020-09-04 11:29:57 +0200155 - name: sdc-environments-output
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200156 mountPath: /app/jetty/chef-solo/cookbooks/sdc-catalog-fe/files/default/org.onap.sdc.trust.jks
k.kedron2774ab12020-03-26 11:13:46 +0100157 subPath: org.onap.sdc.trust.jks
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000158 - name: {{ include "common.fullname" . }}-localtime
159 mountPath: /etc/localtime
160 readOnly: true
161 - name: {{ include "common.fullname" . }}-logs
162 mountPath: /var/log/onap
shrikantawachar0c84bc32019-01-16 13:12:21 +0530163 - name: {{ include "common.fullname" . }}-configs
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200164 mountPath: /app/jetty/config/catalog-fe/plugins-configuration.yaml
shrikantawachar0c84bc32019-01-16 13:12:21 +0530165 subPath: plugins-configuration.yaml
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000166 - name: {{ include "common.fullname" . }}-logback
167 mountPath: /tmp/logback.xml
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000168 subPath: logback.xml
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000169 lifecycle:
170 postStart:
171 exec:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200172 command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/app/jetty/config/catalog-fe/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000173 # side car containers
174 - name: {{ include "common.name" . }}-filebeat-onap
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +0100175 image: {{ include "repositoryGenerator.image.logging" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000176 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
177 volumeMounts:
178 - name: {{ include "common.fullname" . }}-filebeat-conf
179 mountPath: /usr/share/filebeat/filebeat.yml
180 subPath: filebeat.yml
181 - name: {{ include "common.fullname" . }}-logs
182 mountPath: /var/log/onap
183 - name: {{ include "common.fullname" . }}-data-filebeat
184 mountPath: /usr/share/filebeat/data
ChrisC32172342020-10-02 16:39:13 +0200185 resources:
186 limits:
187 cpu: 100m
188 memory: 100Mi
189 requests:
190 cpu: 3m
191 memory: 20Mi
farida azmy1383b4c2021-04-06 12:33:31 +0200192 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
ChrisC742a7b22020-09-04 11:29:57 +0200193 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000194 - name: {{ include "common.fullname" . }}-localtime
195 hostPath:
196 path: /etc/localtime
197 - name: {{ include "common.fullname" . }}-filebeat-conf
198 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100199 name: {{ include "common.release" . }}-sdc-filebeat-configmap
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000200 - name: {{ include "common.fullname" . }}-data-filebeat
201 emptyDir: {}
shrikantawachar0c84bc32019-01-16 13:12:21 +0530202 - name: {{ include "common.fullname" . }}-configs
203 configMap:
204 name : {{ include "common.fullname" . }}-plugins-configmap
205 defaultMode: 0777
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000206 - name: {{ include "common.fullname" . }}-logback
207 configMap:
208 name : {{ include "common.fullname" . }}-logging-configmap
209 - name: {{ include "common.fullname" . }}-environments
210 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100211 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000212 defaultMode: 0755
k.kedron2774ab12020-03-26 11:13:46 +0100213 - name: sdc-environments-output
214 emptyDir: { medium: "Memory" }
215 - name: {{ include "common.fullname" . }}-logs
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000216 emptyDir: {}
217 imagePullSecrets:
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +0000218 - name: "{{ include "common.namespace" . }}-docker-registry-key"