blob: 5a5fcd6f75bd7174cfc13ea37116a6ce68327781 [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"
Sylvain Desbureaux29903c32021-12-06 14:39:02 +010034 - --container-name
35 - "message-router"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000036 env:
37 - name: NAMESPACE
38 valueFrom:
39 fieldRef:
40 apiVersion: v1
41 fieldPath: metadata.namespace
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010042 image: {{ include "repositoryGenerator.image.readiness" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000043 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
ChrisC32172342020-10-02 16:39:13 +020044 resources:
45 limits:
46 cpu: 100m
47 memory: 100Mi
48 requests:
49 cpu: 3m
50 memory: 20Mi
Mandeep Khindaa1047f42018-03-22 02:12:15 +000051 - name: {{ include "common.name" . }}-job-completion
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010052 image: {{ include "repositoryGenerator.image.readiness" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000053 imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
54 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020055 - /app/ready.py
Mandeep Khindaa1047f42018-03-22 02:12:15 +000056 args:
57 - --job-name
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010058 - {{ include "common.release" . }}-sdc-onboarding-be-cassandra-init
Mandeep Khindaa1047f42018-03-22 02:12:15 +000059 env:
60 - name: NAMESPACE
61 valueFrom:
62 fieldRef:
63 apiVersion: v1
64 fieldPath: metadata.namespace
ChrisC32172342020-10-02 16:39:13 +020065 resources:
66 limits:
67 cpu: 100m
68 memory: 100Mi
69 requests:
70 cpu: 3m
71 memory: 20Mi
ChrisC742a7b22020-09-04 11:29:57 +020072 {{- if .Values.global.aafEnabled }}
k.kedron2774ab12020-03-26 11:13:46 +010073 - name: {{ include "common.name" . }}-update-config
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010074 image: {{ include "repositoryGenerator.image.envsubst" . }}
k.kedron2774ab12020-03-26 11:13:46 +010075 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
76 command:
77 - sh
78 args:
ChrisC742a7b22020-09-04 11:29:57 +020079 - "-c"
80 - |
81 export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0)
82 export KEYSTORE_PASS=$cadi_keystore_password_p12
83 export KEYMANAGER_PASS=$cadi_keystore_password_p12
84 export TRUSTSTORE_PASS=$cadi_truststore_password
85 cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.keystoreFile }} /config-output
86 cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.truststoreFile }} /config-output
87 cd /config-input && \
88 for PFILE in `find . -not -type d | grep -v -F ..`
89 do
90 envsubst <${PFILE} >/config-output/${PFILE}
91 chmod 0755 /config-output/${PFILE}
92 done
ChrisC32172342020-10-02 16:39:13 +020093 resources:
94 limits:
95 cpu: 100m
96 memory: 100Mi
97 requests:
98 cpu: 3m
99 memory: 20Mi
ChrisC742a7b22020-09-04 11:29:57 +0200100 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
k.kedron2774ab12020-03-26 11:13:46 +0100101 - name: {{ include "common.fullname" . }}-environments
102 mountPath: /config-input/
103 - name: sdc-environments-output
104 mountPath: /config-output/
ChrisC742a7b22020-09-04 11:29:57 +0200105 {{- end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000106 containers:
107 - name: {{ include "common.name" . }}
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +0100108 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000109 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
ChrisC742a7b22020-09-04 11:29:57 +0200110 {{- if .Values.global.aafEnabled }}
111 command:
112 - sh
113 args:
114 - "-c"
115 - |
116 sed -i '/trustStorePassword/d' ${JETTY_BASE}/startup.sh
117 ${JETTY_BASE}/startup.sh
118 {{- end }}
gummara72e6de2020-03-12 11:15:56 +0000119 ports: {{ include "common.containerPorts" . | nindent 10 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000120 {{ if eq .Values.liveness.enabled true }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000121 livenessProbe:
Yang Xue5d5e682019-06-19 18:20:31 -0400122 httpGet:
shrek2000f336f6d2020-02-25 16:11:26 +0200123 path: /sdc2/rest/healthCheck
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200124 port: {{ .Values.service.internalPort }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000125 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
126 periodSeconds: {{ .Values.liveness.periodSeconds }}
Yang Xu85608542019-06-16 23:25:32 -0400127 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +0200128 successThreshold: {{ .Values.liveness.successThreshold }}
129 failureThreshold: {{ .Values.liveness.failureThreshold }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000130 {{ end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000131 readinessProbe:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200132 httpGet:
133 path: /sdc2/rest/healthCheck
134 port: {{ .Values.service.internalPort }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000135 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
136 periodSeconds: {{ .Values.readiness.periodSeconds }}
Yang Xu85608542019-06-16 23:25:32 -0400137 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +0200138 successThreshold: {{ .Values.readiness.successThreshold }}
139 failureThreshold: {{ .Values.readiness.failureThreshold }}
140 resources: {{ include "common.resources" . | nindent 12 }}
141 startupProbe:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200142 httpGet:
143 path: /sdc2/rest/healthCheck
144 port: {{ .Values.service.internalPort }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +0200145 initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }}
146 periodSeconds: {{ .Values.startup.periodSeconds }}
147 timeoutSeconds: {{ .Values.startup.timeoutSeconds }}
148 successThreshold: {{ .Values.startup.successThreshold }}
149 failureThreshold: {{ .Values.startup.failureThreshold }}
gummara72e6de2020-03-12 11:15:56 +0000150 resources: {{ include "common.resources" . | nindent 12 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000151 env:
152 - name: ENVNAME
ChrisC742a7b22020-09-04 11:29:57 +0200153 value: {{ .Values.env.name }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000154 - name: JAVA_OPTIONS
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000155 value: {{ .Values.config.javaOptions }}
156 - name: cassandra_ssl_enabled
157 value: {{ .Values.config.cassandraSslEnabled | quote }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000158 - name: HOST_IP
159 valueFrom:
160 fieldRef:
161 fieldPath: status.podIP
162 volumeMounts:
k.kedron2774ab12020-03-26 11:13:46 +0100163 - name: sdc-environments-output
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200164 mountPath: /app/jetty/chef-solo/environments/
ChrisC742a7b22020-09-04 11:29:57 +0200165 - name: sdc-environments-output
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200166 mountPath: /app/jetty/chef-solo/cookbooks/sdc-catalog-be/files/default/org.onap.sdc.p12
k.kedron2774ab12020-03-26 11:13:46 +0100167 subPath: org.onap.sdc.p12
ChrisC742a7b22020-09-04 11:29:57 +0200168 - name: sdc-environments-output
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200169 mountPath: /app/jetty/chef-solo/cookbooks/sdc-catalog-be/files/default/org.onap.sdc.trust.jks
k.kedron2774ab12020-03-26 11:13:46 +0100170 subPath: org.onap.sdc.trust.jks
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000171 - name: {{ include "common.fullname" . }}-localtime
172 mountPath: /etc/localtime
173 readOnly: true
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000174 - name: logs
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000175 mountPath: /var/log/onap
176 - name: {{ include "common.fullname" . }}-logback
177 mountPath: /tmp/logback.xml
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000178 subPath: logback.xml
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000179 lifecycle:
180 postStart:
181 exec:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200182 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 +0000183 # side car containers
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000184 {{ include "common.log.sidecar" . | nindent 8 }}
farida azmy1383b4c2021-04-06 12:33:31 +0200185 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
ChrisC742a7b22020-09-04 11:29:57 +0200186 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000187 - name: {{ include "common.fullname" . }}-localtime
188 hostPath:
189 path: /etc/localtime
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000190 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000191 - name: {{ include "common.fullname" . }}-logback
192 configMap:
193 name : {{ include "common.fullname" . }}-logging-configmap
194 - name: {{ include "common.fullname" . }}-environments
195 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100196 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000197 defaultMode: 0755
k.kedron2774ab12020-03-26 11:13:46 +0100198 - name: sdc-environments-output
199 emptyDir: { medium: "Memory" }
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000200 - name: logs
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000201 emptyDir: {}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000202 imagePullSecrets:
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +0000203 - name: "{{ include "common.namespace" . }}-docker-registry-key"