Merge "[UUI] Service Mesh Compliance for UUI"
[oom.git] / kubernetes / sdc / components / sdc-be / templates / job.yaml
1 {{/*
2 # Copyright © 2017 Amdocs, AT&T, Bell Canada
3 # Modifications Copyright © 2018 ZTE
4 #
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.
16 */}}
17
18 apiVersion: batch/v1
19 kind: Job
20 metadata:
21   name: {{ include "common.fullname" . }}-config-backend
22   namespace: {{ include "common.namespace" . }}
23   labels: {{- include "common.labels" . | nindent 4 }}
24 spec:
25   backoffLimit: 20
26   template:
27     metadata:
28       labels:
29         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 }}
33     spec:
34       restartPolicy: Never
35       initContainers:
36       - name: {{ include "common.name" . }}-init-readiness
37         image: {{ include "repositoryGenerator.image.readiness" . }}
38         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
39         command:
40         - /app/ready.py
41         args:
42         - --container-name
43         - sdc-be
44         - "-t"
45         - "35"
46         env:
47         - name: NAMESPACE
48           valueFrom:
49             fieldRef:
50               apiVersion: v1
51               fieldPath: metadata.namespace
52         resources:
53           limits:
54             cpu: 100m
55             memory: 100Mi
56           requests:
57             cpu: 3m
58             memory: 20Mi
59       containers:
60       - name: {{ include "common.name" . }}-job
61         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.backendInitImage }}
62         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
63         volumeMounts:
64         - name: {{ include "common.fullname" . }}-environments
65           mountPath: /home/onap/chef-solo/environments/
66         - name: sdc-logs
67           mountPath: /home/onap/logs
68         env:
69         - name: ENVNAME
70           value: {{ .Values.env.name }}
71         - name: HOST_IP
72           valueFrom:
73             fieldRef:
74               fieldPath: status.podIP
75         resources:
76           limits:
77             cpu: 800m
78             memory: 1024Mi
79           requests:
80             cpu: 200m
81             memory: 200Mi
82       {{ include "common.waitForJobContainer" . | indent 6 | trim }}
83       volumes:
84         - name: {{ include "common.fullname" . }}-environments
85           configMap:
86             name: {{ include "common.release" . }}-sdc-environments-configmap
87             defaultMode: 0755
88         - name: sdc-logs
89           emptyDir: {}
90       imagePullSecrets:
91       - name: "{{ include "common.namespace" . }}-docker-registry-key"
92       restartPolicy: Never