[COMMON] Harmonize resource settings
[oom.git] / kubernetes / sdc / components / sdc-be / templates / job.yaml
index f1bdabb..bdb6821 100644 (file)
@@ -1,3 +1,4 @@
+{{/*
 # Copyright © 2017 Amdocs, AT&T, Bell Canada
 # Modifications Copyright © 2018 ZTE
 #
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+*/}}
 
 apiVersion: batch/v1
 kind: Job
-metadata:
-  name: {{ include "common.fullname" . }}-config-backend
-  namespace: {{ include "common.namespace" . }}
-  labels: {{- include "common.labels" . | nindent 4 }}
+metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
 spec:
   backoffLimit: 20
   template:
@@ -32,28 +31,37 @@ spec:
       restartPolicy: Never
       initContainers:
       - name: {{ include "common.name" . }}-init-readiness
-        image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
+        image: {{ include "repositoryGenerator.image.readiness" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         command:
         - /app/ready.py
         args:
         - --container-name
         - sdc-be
+        - "-t"
+        - "35"
         env:
         - name: NAMESPACE
           valueFrom:
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
+        resources:
+          limits:
+            cpu: "100m"
+            memory: "0.5Gi"
+          requests:
+            cpu: "3m"
+            memory: "0.02Gi"
       containers:
       - name: {{ include "common.name" . }}-job
-        image: "{{ include "common.repository" . }}/{{ .Values.backendInitImage }}"
+        image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.backendInitImage }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         volumeMounts:
         - name: {{ include "common.fullname" . }}-environments
           mountPath: /home/onap/chef-solo/environments/
         - name: sdc-logs
-          mountPath: /var/lib/jetty/logs
+          mountPath: /home/onap/logs
         env:
         - name: ENVNAME
           value: {{ .Values.env.name }}
@@ -61,6 +69,15 @@ spec:
           valueFrom:
             fieldRef:
               fieldPath: status.podIP
+        resources:
+          limits:
+            cpu: "800m"
+            memory: "1Gi"
+          requests:
+            cpu: "200m"
+            memory: "0.2Gi"
+      {{ include "common.waitForJobContainer" . | indent 6 | trim }}
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes:
         - name: {{ include "common.fullname" . }}-environments
           configMap:
@@ -70,4 +87,3 @@ spec:
           emptyDir: {}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
-      restartPolicy: Never