blob: 6c392ef24c7286a7db3a66db60fa5f31338aae8c [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
othman touijer2b764d02022-01-05 14:40:37 +01004# Modifications Copyright © 2021 Orange
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +00005#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
Jakub Latusekd8eaff62020-10-21 13:36:29 +020017*/}}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000018
kwasiel59cc6a42020-07-23 10:02:49 +000019apiVersion: apps/v1
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000020kind: Deployment
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010021metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000022spec:
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010023 selector: {{- include "common.selectors" . | nindent 4 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000024 replicas: {{ .Values.replicaCount }}
25 template:
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010026 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000027 spec:
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010028 initContainers:
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000029 - name: {{ include "common.name" . }}-job-completion
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010030 image: {{ include "repositoryGenerator.image.readiness" . }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000031 imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
32 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020033 - /app/ready.py
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000034 args:
35 - --job-name
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010036 - {{ include "common.release" . }}-sdc-onboarding-be
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000037 env:
38 - name: NAMESPACE
39 valueFrom:
40 fieldRef:
41 apiVersion: v1
42 fieldPath: metadata.namespace
ChrisC32172342020-10-02 16:39:13 +020043 resources:
44 limits:
45 cpu: 100m
46 memory: 100Mi
47 requests:
48 cpu: 3m
49 memory: 20Mi
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000050 containers:
51 - name: {{ include "common.name" . }}
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010052 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000053 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010054 ports: {{ include "common.containerPorts" . | nindent 12 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000055 {{ if eq .Values.liveness.enabled true }}
56 livenessProbe:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +020057 httpGet:
58 path: /onboarding-api/v1.0/healthcheck
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010059 port: {{ .Values.service.internalPort }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000060 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
61 periodSeconds: {{ .Values.liveness.periodSeconds }}
Brian Freeman6142d942019-10-02 09:50:19 -050062 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +020063 successThreshold: {{ .Values.liveness.successThreshold }}
64 failureThreshold: {{ .Values.liveness.failureThreshold }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000065 {{ end }}
66 readinessProbe:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +020067 httpGet:
68 path: /onboarding-api/v1.0/healthcheck
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010069 port: {{ .Values.service.internalPort }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000070 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
71 periodSeconds: {{ .Values.readiness.periodSeconds }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +020072 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
73 successThreshold: {{ .Values.readiness.successThreshold }}
74 failureThreshold: {{ .Values.readiness.failureThreshold }}
75 startupProbe:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +020076 httpGet:
77 path: /onboarding-api/v1.0/healthcheck
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010078 port: {{ .Values.service.internalPort }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +020079 initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }}
80 periodSeconds: {{ .Values.startup.periodSeconds }}
81 timeoutSeconds: {{ .Values.startup.timeoutSeconds }}
82 successThreshold: {{ .Values.startup.successThreshold }}
83 failureThreshold: {{ .Values.startup.failureThreshold }}
ChrisC32172342020-10-02 16:39:13 +020084 resources: {{ include "common.resources" . | nindent 12 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000085 env:
86 - name: ENVNAME
ChrisC742a7b22020-09-04 11:29:57 +020087 value: {{ .Values.env.name }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000088 - name: JAVA_OPTIONS
89 value: {{ .Values.config.javaOptions }}
90 - name: SDC_CLUSTER_NAME
ChrisC742a7b22020-09-04 11:29:57 +020091 value: "SDC-CS-{{ .Values.env.name }}"
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000092 - name: cassandra_ssl_enabled
93 value: {{ .Values.config.cassandraSslEnabled | quote }}
94 - name: HOST_IP
95 valueFrom:
96 fieldRef:
97 fieldPath: status.podIP
98 - name: SDC_USER
99 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100100 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000101 - name: SDC_PASSWORD
102 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100103 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
kooper543d3aa2019-05-02 10:27:15 +0000104 - name: SDC_CERT_DIR
Andreas Geisslerdd34ead2023-03-20 17:16:45 +0100105 value: ""
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000106 volumeMounts:
othman touijer2b764d02022-01-05 14:40:37 +0100107 - name: sdc-environments
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200108 mountPath: /app/jetty/chef-solo/environments/
othman touijer2b764d02022-01-05 14:40:37 +0100109 - name: localtime
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000110 mountPath: /etc/localtime
111 readOnly: true
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000112 - name: logs
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000113 mountPath: /var/log/onap
othman touijer2b764d02022-01-05 14:40:37 +0100114 - name: logback
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000115 mountPath: /tmp/logback.xml
116 subPath: logback.xml
117 lifecycle:
118 postStart:
119 exec:
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +0200120 command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/app/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 +0000121 # side car containers
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000122 {{ include "common.log.sidecar" . | nindent 8 }}
farida azmy1383b4c2021-04-06 12:33:31 +0200123 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Andreas Geisslerdd34ead2023-03-20 17:16:45 +0100124 volumes:
othman touijer2b764d02022-01-05 14:40:37 +0100125 - name: localtime
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000126 hostPath:
127 path: /etc/localtime
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000128 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
othman touijer2b764d02022-01-05 14:40:37 +0100129 - name: logback
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000130 configMap:
131 name : {{ include "common.fullname" . }}-logging-configmap
othman touijer2b764d02022-01-05 14:40:37 +0100132 - name: sdc-environments
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000133 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100134 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000135 defaultMode: 0755
Maciej Wereski771ec2a2021-10-14 13:59:12 +0000136 - name: logs
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000137 emptyDir: {}
138 imagePullSecrets:
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +0000139 - name: "{{ include "common.namespace" . }}-docker-registry-key"