[GENERAL] Use readiness container v3.0.1
[oom.git] / kubernetes / sdc / charts / sdc-wfd-be / templates / job.yaml
index f4a68d7..9235cb4 100644 (file)
@@ -1,4 +1,5 @@
-# Copyright © 2018 Amdocs, Bell Canada
+# Copyright © 2017 Amdocs, AT&T, Bell Canada
+# Modifications Copyright © 2018  ZTE
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -12,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+{{ if .Values.initJob.enabled }}
 apiVersion: batch/v1
 kind: Job
 metadata:
@@ -20,7 +22,7 @@ metadata:
   labels:
     app: {{ include "common.name" . }}-job
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
+    release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
 spec:
   backoffLimit: 20
@@ -28,18 +30,18 @@ spec:
     metadata:
       labels:
         app: {{ include "common.name" . }}-job
-        release: {{ .Release.Name }}
+        release: {{ include "common.release" . }}
     spec:
       restartPolicy: Never
       initContainers:
       - name: {{ include "common.name" . }}-init-readiness
-        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
+        image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         command:
-        - /root/job_complete.py
+        - /app/ready.py
         args:
         - --job-name
-        - {{ .Release.Name }}-sdc-cs-config-cassandra
+        - {{ include "common.release" . }}-sdc-cs-config-cassandra
         env:
         - name: NAMESPACE
           valueFrom:
@@ -52,16 +54,17 @@ spec:
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         env:
         - name: CS_HOST
-          value: "sdc-cs"
+          value: "{{ .Values.global.cassandra.serviceName }}"
         - name: CS_PORT
-          value: "{{ .Values.config.cassandraThriftClientPort }}"
+          value: "{{ .Values.config.cassandraClientPort }}"
         - name: CS_AUTHENTICATE
-          value: "{{ .Values.config.cassandaAuthenticationEnabled }}"
+          value: "{{ .Values.config.cassandraAuthenticationEnabled }}"
         - name: CS_USER
           valueFrom:
-            secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: sdc_user}
+            secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
         - name: CS_PASSWORD
           valueFrom:
-            secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: sdc_password}
+            secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
+{{ end }}