blob: 2eb1aba21b6c79b44d994b0b55e0eb0b5e60b4db [file] [log] [blame]
Jakub Latusekd8eaff62020-10-21 13:36:29 +02001{{/*
Mandeep Khindab1f9efe2018-03-28 19:01:55 +00002# Copyright © 2017 Amdocs, AT&T, Bell Canada
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00003# Modifications Copyright © 2018 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
gummara72e6de2020-03-12 11:15:56 +000018apiVersion: apps/v1
Mandeep Khindaa1047f42018-03-22 02:12:15 +000019kind: Deployment
gummara72e6de2020-03-12 11:15:56 +000020metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000021spec:
gummara72e6de2020-03-12 11:15:56 +000022 selector: {{- include "common.selectors" . | nindent 4 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000023 replicas: {{ .Values.replicaCount }}
24 template:
gummara72e6de2020-03-12 11:15:56 +000025 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000026 spec:
ChrisC742a7b22020-09-04 11:29:57 +020027 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000028 - name: {{ include "common.name" . }}-readiness
29 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020030 - /app/ready.py
Mandeep Khindaa1047f42018-03-22 02:12:15 +000031 args:
32 - --container-name
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000033 - "sdc-onboarding-be"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000034 env:
35 - name: NAMESPACE
36 valueFrom:
37 fieldRef:
38 apiVersion: v1
39 fieldPath: metadata.namespace
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010040 image: {{ include "repositoryGenerator.image.readiness" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000041 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
ChrisC32172342020-10-02 16:39:13 +020042 resources:
43 limits:
44 cpu: 100m
45 memory: 100Mi
46 requests:
47 cpu: 3m
48 memory: 20Mi
Mandeep Khindaa1047f42018-03-22 02:12:15 +000049 - name: {{ include "common.name" . }}-job-completion
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010050 image: {{ include "repositoryGenerator.image.readiness" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000051 imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
52 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020053 - /app/ready.py
Mandeep Khindaa1047f42018-03-22 02:12:15 +000054 args:
55 - --job-name
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010056 - {{ include "common.release" . }}-sdc-onboarding-be-cassandra-init
Mandeep Khindaa1047f42018-03-22 02:12:15 +000057 env:
58 - name: NAMESPACE
59 valueFrom:
60 fieldRef:
61 apiVersion: v1
62 fieldPath: metadata.namespace
ChrisC32172342020-10-02 16:39:13 +020063 resources:
64 limits:
65 cpu: 100m
66 memory: 100Mi
67 requests:
68 cpu: 3m
69 memory: 20Mi
ChrisC742a7b22020-09-04 11:29:57 +020070 {{- if .Values.global.aafEnabled }}
k.kedron2774ab12020-03-26 11:13:46 +010071 - name: {{ include "common.name" . }}-update-config
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010072 image: {{ include "repositoryGenerator.image.envsubst" . }}
k.kedron2774ab12020-03-26 11:13:46 +010073 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
74 command:
75 - sh
76 args:
ChrisC742a7b22020-09-04 11:29:57 +020077 - "-c"
78 - |
79 export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0)
80 export KEYSTORE_PASS=$cadi_keystore_password_p12
81 export KEYMANAGER_PASS=$cadi_keystore_password_p12
82 export TRUSTSTORE_PASS=$cadi_truststore_password
83 cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.keystoreFile }} /config-output
84 cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.truststoreFile }} /config-output
85 cd /config-input && \
86 for PFILE in `find . -not -type d | grep -v -F ..`
87 do
88 envsubst <${PFILE} >/config-output/${PFILE}
89 chmod 0755 /config-output/${PFILE}
90 done
ChrisC32172342020-10-02 16:39:13 +020091 resources:
92 limits:
93 cpu: 100m
94 memory: 100Mi
95 requests:
96 cpu: 3m
97 memory: 20Mi
ChrisC742a7b22020-09-04 11:29:57 +020098 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
k.kedron2774ab12020-03-26 11:13:46 +010099 - name: {{ include "common.fullname" . }}-environments
100 mountPath: /config-input/
101 - name: sdc-environments-output
102 mountPath: /config-output/
ChrisC742a7b22020-09-04 11:29:57 +0200103 {{- end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000104 containers:
105 - name: {{ include "common.name" . }}
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +0100106 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000107 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
ChrisC742a7b22020-09-04 11:29:57 +0200108 {{- if .Values.global.aafEnabled }}
109 command:
110 - sh
111 args:
112 - "-c"
113 - |
114 sed -i '/trustStorePassword/d' ${JETTY_BASE}/startup.sh
115 ${JETTY_BASE}/startup.sh
116 {{- end }}
gummara72e6de2020-03-12 11:15:56 +0000117 ports: {{ include "common.containerPorts" . | nindent 10 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000118 {{ if eq .Values.liveness.enabled true }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000119 livenessProbe:
Yang Xue5d5e682019-06-19 18:20:31 -0400120 httpGet:
shrek2000f336f6d2020-02-25 16:11:26 +0200121 path: /sdc2/rest/healthCheck
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200122 port: {{ .Values.service.internalPort }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000123 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
124 periodSeconds: {{ .Values.liveness.periodSeconds }}
Yang Xu85608542019-06-16 23:25:32 -0400125 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +0200126 successThreshold: {{ .Values.liveness.successThreshold }}
127 failureThreshold: {{ .Values.liveness.failureThreshold }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000128 {{ end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000129 readinessProbe:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200130 httpGet:
131 path: /sdc2/rest/healthCheck
132 port: {{ .Values.service.internalPort }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000133 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
134 periodSeconds: {{ .Values.readiness.periodSeconds }}
Yang Xu85608542019-06-16 23:25:32 -0400135 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +0200136 successThreshold: {{ .Values.readiness.successThreshold }}
137 failureThreshold: {{ .Values.readiness.failureThreshold }}
138 resources: {{ include "common.resources" . | nindent 12 }}
139 startupProbe:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200140 httpGet:
141 path: /sdc2/rest/healthCheck
142 port: {{ .Values.service.internalPort }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +0200143 initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }}
144 periodSeconds: {{ .Values.startup.periodSeconds }}
145 timeoutSeconds: {{ .Values.startup.timeoutSeconds }}
146 successThreshold: {{ .Values.startup.successThreshold }}
147 failureThreshold: {{ .Values.startup.failureThreshold }}
gummara72e6de2020-03-12 11:15:56 +0000148 resources: {{ include "common.resources" . | nindent 12 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000149 env:
150 - name: ENVNAME
ChrisC742a7b22020-09-04 11:29:57 +0200151 value: {{ .Values.env.name }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000152 - name: JAVA_OPTIONS
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000153 value: {{ .Values.config.javaOptions }}
154 - name: cassandra_ssl_enabled
155 value: {{ .Values.config.cassandraSslEnabled | quote }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000156 - name: HOST_IP
157 valueFrom:
158 fieldRef:
159 fieldPath: status.podIP
160 volumeMounts:
k.kedron2774ab12020-03-26 11:13:46 +0100161 - name: sdc-environments-output
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200162 mountPath: /app/jetty/chef-solo/environments/
ChrisC742a7b22020-09-04 11:29:57 +0200163 - name: sdc-environments-output
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200164 mountPath: /app/jetty/chef-solo/cookbooks/sdc-catalog-be/files/default/org.onap.sdc.p12
k.kedron2774ab12020-03-26 11:13:46 +0100165 subPath: org.onap.sdc.p12
ChrisC742a7b22020-09-04 11:29:57 +0200166 - name: sdc-environments-output
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200167 mountPath: /app/jetty/chef-solo/cookbooks/sdc-catalog-be/files/default/org.onap.sdc.trust.jks
k.kedron2774ab12020-03-26 11:13:46 +0100168 subPath: org.onap.sdc.trust.jks
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000169 - name: {{ include "common.fullname" . }}-localtime
170 mountPath: /etc/localtime
171 readOnly: true
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000172 - name: logs
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000173 mountPath: /var/log/onap
174 - name: {{ include "common.fullname" . }}-logback
175 mountPath: /tmp/logback.xml
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000176 subPath: logback.xml
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000177 lifecycle:
178 postStart:
179 exec:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200180 command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/app/jetty/config/catalog-be/; 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 +0000181 # side car containers
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000182 {{ include "common.log.sidecar" . | nindent 8 }}
farida azmy1383b4c2021-04-06 12:33:31 +0200183 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
ChrisC742a7b22020-09-04 11:29:57 +0200184 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000185 - name: {{ include "common.fullname" . }}-localtime
186 hostPath:
187 path: /etc/localtime
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000188 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000189 - 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 Khinda403c1c12018-04-19 23:15:43 +0000195 defaultMode: 0755
k.kedron2774ab12020-03-26 11:13:46 +0100196 - name: sdc-environments-output
197 emptyDir: { medium: "Memory" }
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000198 - name: logs
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000199 emptyDir: {}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000200 imagePullSecrets:
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +0000201 - name: "{{ include "common.namespace" . }}-docker-registry-key"