blob: 5f70991e6fcb1bbac2439bc2050a6206a65d7404 [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
20metadata:
21 name: {{ include "common.fullname" . }}-config-backend
22 namespace: {{ include "common.namespace" . }}
gummara72e6de2020-03-12 11:15:56 +000023 labels: {{- include "common.labels" . | nindent 4 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000024spec:
Mike Elliott6482f502018-04-30 15:02:43 -040025 backoffLimit: 20
Mandeep Khindaa1047f42018-03-22 02:12:15 +000026 template:
27 metadata:
28 labels:
gummara72e6de2020-03-12 11:15:56 +000029 app.kubernetes.io/name: {{ include "common.name" . }}-job
30 helm.sh/chart: {{ include "common.chart" . }}
31 app.kubernetes.io/instance: {{ include "common.release" . }}
32 app.kubernetes.io/managed-by: {{ .Release.Service }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000033 spec:
34 restartPolicy: Never
35 initContainers:
36 - name: {{ include "common.name" . }}-init-readiness
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010037 image: {{ include "repositoryGenerator.image.readiness" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000038 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
39 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020040 - /app/ready.py
Mandeep Khindaa1047f42018-03-22 02:12:15 +000041 args:
42 - --container-name
43 - sdc-be
ChrisC32172342020-10-02 16:39:13 +020044 - "-t"
45 - "35"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000046 env:
47 - name: NAMESPACE
48 valueFrom:
49 fieldRef:
50 apiVersion: v1
51 fieldPath: metadata.namespace
ChrisC32172342020-10-02 16:39:13 +020052 resources:
53 limits:
54 cpu: 100m
55 memory: 100Mi
56 requests:
57 cpu: 3m
58 memory: 20Mi
Mandeep Khindaa1047f42018-03-22 02:12:15 +000059 containers:
60 - name: {{ include "common.name" . }}-job
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010061 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.backendInitImage }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000062 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
63 volumeMounts:
64 - name: {{ include "common.fullname" . }}-environments
ChrisC7ab57312020-08-12 16:24:38 +020065 mountPath: /home/onap/chef-solo/environments/
MichaelMorrisb137f7e2020-03-15 17:44:48 +000066 - name: sdc-logs
Joanna Jeremiczfe52bf52021-04-21 14:31:29 +020067 mountPath: /home/onap/logs
Mandeep Khindaa1047f42018-03-22 02:12:15 +000068 env:
69 - name: ENVNAME
ChrisC742a7b22020-09-04 11:29:57 +020070 value: {{ .Values.env.name }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000071 - name: HOST_IP
72 valueFrom:
73 fieldRef:
74 fieldPath: status.podIP
ChrisC32172342020-10-02 16:39:13 +020075 resources:
76 limits:
77 cpu: 800m
78 memory: 1024Mi
79 requests:
80 cpu: 200m
81 memory: 200Mi
othman touijer2b764d02022-01-05 14:40:37 +010082 {{ include "common.waitForJobContainer" . | indent 6 | trim }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000083 volumes:
84 - name: {{ include "common.fullname" . }}-environments
85 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010086 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khindaa1047f42018-03-22 02:12:15 +000087 defaultMode: 0755
MichaelMorrisb137f7e2020-03-15 17:44:48 +000088 - name: sdc-logs
89 emptyDir: {}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000090 imagePullSecrets:
91 - name: "{{ include "common.namespace" . }}-docker-registry-key"
92 restartPolicy: Never