blob: 7adc9e8c3df5cc849ceaa8735237b7e079e2e8bb [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:
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010027 initContainers:
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"
efiacor3422fe92022-07-12 13:19:53 +010034 {{- if not .Values.global.kafka.useKafka }}
Sylvain Desbureaux29903c32021-12-06 14:39:02 +010035 - --container-name
36 - "message-router"
efiacor3422fe92022-07-12 13:19:53 +010037 {{- end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000038 env:
39 - name: NAMESPACE
40 valueFrom:
41 fieldRef:
42 apiVersion: v1
43 fieldPath: metadata.namespace
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010044 image: {{ include "repositoryGenerator.image.readiness" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000045 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
ChrisC32172342020-10-02 16:39:13 +020046 resources:
47 limits:
Andreas Geissler47537432024-02-27 08:55:23 +010048 cpu: "100m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010049 memory: "500Mi"
ChrisC32172342020-10-02 16:39:13 +020050 requests:
Andreas Geissler47537432024-02-27 08:55:23 +010051 cpu: "3m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010052 memory: "20Mi"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000053 - name: {{ include "common.name" . }}-job-completion
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010054 image: {{ include "repositoryGenerator.image.readiness" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000055 imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
56 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020057 - /app/ready.py
Mandeep Khindaa1047f42018-03-22 02:12:15 +000058 args:
59 - --job-name
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010060 - {{ include "common.release" . }}-sdc-onboarding-be
Mandeep Khindaa1047f42018-03-22 02:12:15 +000061 env:
62 - name: NAMESPACE
63 valueFrom:
64 fieldRef:
65 apiVersion: v1
66 fieldPath: metadata.namespace
ChrisC32172342020-10-02 16:39:13 +020067 resources:
68 limits:
Andreas Geissler47537432024-02-27 08:55:23 +010069 cpu: "100m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010070 memory: "500Mi"
ChrisC32172342020-10-02 16:39:13 +020071 requests:
Andreas Geissler47537432024-02-27 08:55:23 +010072 cpu: "3m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010073 memory: "20Mi"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000074 containers:
75 - name: {{ include "common.name" . }}
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010076 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000077 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010078 ports: {{ include "common.containerPorts" . | nindent 12 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000079 {{ if eq .Values.liveness.enabled true }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000080 livenessProbe:
Yang Xue5d5e682019-06-19 18:20:31 -040081 httpGet:
shrek2000f336f6d2020-02-25 16:11:26 +020082 path: /sdc2/rest/healthCheck
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +020083 port: {{ .Values.service.internalPort }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000084 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
85 periodSeconds: {{ .Values.liveness.periodSeconds }}
Yang Xu85608542019-06-16 23:25:32 -040086 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +020087 successThreshold: {{ .Values.liveness.successThreshold }}
88 failureThreshold: {{ .Values.liveness.failureThreshold }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000089 {{ end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000090 readinessProbe:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +020091 httpGet:
92 path: /sdc2/rest/healthCheck
93 port: {{ .Values.service.internalPort }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000094 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
95 periodSeconds: {{ .Values.readiness.periodSeconds }}
Yang Xu85608542019-06-16 23:25:32 -040096 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +020097 successThreshold: {{ .Values.readiness.successThreshold }}
98 failureThreshold: {{ .Values.readiness.failureThreshold }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +020099 startupProbe:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200100 httpGet:
101 path: /sdc2/rest/healthCheck
102 port: {{ .Values.service.internalPort }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +0200103 initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }}
104 periodSeconds: {{ .Values.startup.periodSeconds }}
105 timeoutSeconds: {{ .Values.startup.timeoutSeconds }}
106 successThreshold: {{ .Values.startup.successThreshold }}
107 failureThreshold: {{ .Values.startup.failureThreshold }}
gummara72e6de2020-03-12 11:15:56 +0000108 resources: {{ include "common.resources" . | nindent 12 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000109 env:
110 - name: ENVNAME
ChrisC742a7b22020-09-04 11:29:57 +0200111 value: {{ .Values.env.name }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000112 - name: JAVA_OPTIONS
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000113 value: {{ .Values.config.javaOptions }}
114 - name: cassandra_ssl_enabled
115 value: {{ .Values.config.cassandraSslEnabled | quote }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000116 - name: HOST_IP
117 valueFrom:
118 fieldRef:
119 fieldPath: status.podIP
efiacor3422fe92022-07-12 13:19:53 +0100120 {{- if .Values.global.kafka.useKafka }}
121 - name: SASL_JAAS_CONFIG
efiacor2f1c2a22022-11-29 11:39:41 +0000122 valueFrom:
123 secretKeyRef:
124 name: {{ include "common.name" . }}-ku
125 key: sasl.jaas.config
efiacor3422fe92022-07-12 13:19:53 +0100126 - name: USE_KAFKA
127 value: {{ .Values.global.kafka.useKafka | quote }}
128 {{- end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000129 volumeMounts:
othman touijer2b764d02022-01-05 14:40:37 +0100130 - name: sdc-environments
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200131 mountPath: /app/jetty/chef-solo/environments/
othman touijer2b764d02022-01-05 14:40:37 +0100132 - name: localtime
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000133 mountPath: /etc/localtime
134 readOnly: true
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000135 - name: logs
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000136 mountPath: /var/log/onap
othman touijer2b764d02022-01-05 14:40:37 +0100137 - name: logback
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000138 mountPath: /tmp/logback.xml
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000139 subPath: logback.xml
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000140 lifecycle:
141 postStart:
142 exec:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200143 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 +0000144 # side car containers
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000145 {{ include "common.log.sidecar" . | nindent 8 }}
farida azmy1383b4c2021-04-06 12:33:31 +0200146 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Andreas Geisslerdd34ead2023-03-20 17:16:45 +0100147 volumes:
othman touijer2b764d02022-01-05 14:40:37 +0100148 - name: localtime
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000149 hostPath:
150 path: /etc/localtime
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000151 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
othman touijer2b764d02022-01-05 14:40:37 +0100152 - name: logback
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000153 configMap:
154 name : {{ include "common.fullname" . }}-logging-configmap
othman touijer2b764d02022-01-05 14:40:37 +0100155 - name: sdc-environments
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000156 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100157 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000158 defaultMode: 0755
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000159 - name: logs
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000160 emptyDir: {}
Andreas Geisslerbd0d31a2024-03-20 09:51:32 +0100161 {{- include "common.imagePullSecrets" . | nindent 6 }}