blob: e9614438cfff1c904814ea9c350a0cf34e3f1ae4 [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
Mandeep Khindaa1047f42018-03-22 02:12:15 +000018apiVersion: batch/v1
19kind: Job
Andreas Geisslerdd34ead2023-03-20 17:16:45 +010020metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000021spec:
Mike Elliott6482f502018-04-30 15:02:43 -040022 backoffLimit: 20
Mandeep Khindaa1047f42018-03-22 02:12:15 +000023 template:
24 metadata:
25 labels:
gummara72e6de2020-03-12 11:15:56 +000026 app.kubernetes.io/name: {{ include "common.name" . }}-job
27 helm.sh/chart: {{ include "common.chart" . }}
28 app.kubernetes.io/instance: {{ include "common.release" . }}
29 app.kubernetes.io/managed-by: {{ .Release.Service }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000030 spec:
31 restartPolicy: Never
32 initContainers:
33 - name: {{ include "common.name" . }}-init-readiness
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010034 image: {{ include "repositoryGenerator.image.readiness" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000035 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
36 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020037 - /app/ready.py
Mandeep Khindaa1047f42018-03-22 02:12:15 +000038 args:
39 - --container-name
40 - sdc-be
ChrisC32172342020-10-02 16:39:13 +020041 - "-t"
42 - "35"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000043 env:
44 - name: NAMESPACE
45 valueFrom:
46 fieldRef:
47 apiVersion: v1
48 fieldPath: metadata.namespace
ChrisC32172342020-10-02 16:39:13 +020049 resources:
50 limits:
Andreas Geissler47537432024-02-27 08:55:23 +010051 cpu: "100m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010052 memory: "500Mi"
ChrisC32172342020-10-02 16:39:13 +020053 requests:
Andreas Geissler47537432024-02-27 08:55:23 +010054 cpu: "3m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010055 memory: "20Mi"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000056 containers:
57 - name: {{ include "common.name" . }}-job
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010058 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.backendInitImage }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000059 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60 volumeMounts:
61 - name: {{ include "common.fullname" . }}-environments
ChrisC7ab57312020-08-12 16:24:38 +020062 mountPath: /home/onap/chef-solo/environments/
MichaelMorrisb137f7e2020-03-15 17:44:48 +000063 - name: sdc-logs
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +020064 mountPath: /home/onap/logs
Mandeep Khindaa1047f42018-03-22 02:12:15 +000065 env:
66 - name: ENVNAME
ChrisC742a7b22020-09-04 11:29:57 +020067 value: {{ .Values.env.name }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000068 - name: HOST_IP
69 valueFrom:
70 fieldRef:
71 fieldPath: status.podIP
ChrisC32172342020-10-02 16:39:13 +020072 resources:
73 limits:
Andreas Geissler47537432024-02-27 08:55:23 +010074 cpu: "800m"
75 memory: "1Gi"
ChrisC32172342020-10-02 16:39:13 +020076 requests:
Andreas Geissler47537432024-02-27 08:55:23 +010077 cpu: "200m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010078 memory: "200Mi"
othman touijer2b764d02022-01-05 14:40:37 +010079 {{ include "common.waitForJobContainer" . | indent 6 | trim }}
vladimir turokd8044182023-07-27 16:28:36 +020080 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000081 volumes:
82 - name: {{ include "common.fullname" . }}-environments
83 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010084 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khindaa1047f42018-03-22 02:12:15 +000085 defaultMode: 0755
MichaelMorrisb137f7e2020-03-15 17:44:48 +000086 - name: sdc-logs
87 emptyDir: {}
Andreas Geisslerbd0d31a2024-03-20 09:51:32 +010088 {{- include "common.imagePullSecrets" . | nindent 6 }}