[CONTRIB] Make AWX ServiceMesh compatibel

Changes in the job and service definitions for SM compatibility

Issue-ID: OOM-2981

Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
Change-Id: Ib70baa6a4aedd21e24e339cc724b7f5ea973fdde
diff --git a/kubernetes/contrib/components/awx/templates/job.yaml b/kubernetes/contrib/components/awx/templates/job.yaml
index f974f44..1ebe340 100644
--- a/kubernetes/contrib/components/awx/templates/job.yaml
+++ b/kubernetes/contrib/components/awx/templates/job.yaml
@@ -51,11 +51,16 @@
               apiVersion: v1
               fieldPath: metadata.namespace
       containers:
-      - command: ["/bin/sh","-c"]
-        args: ["/etc/tower/job-entrypoint.sh"]
+      - name: {{ include "common.name" . }}-mgnt
+        command:
+        - /bin/sh
+        - -cx
+        - |
+           {{- if include "common.onServiceMesh" . }}
+           echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
+           /etc/tower/job-entrypoint.sh
         image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image.task }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        name: {{ include "common.name" . }}-mgnt
         resources:
           requests:
             cpu: 1500m
@@ -78,7 +83,7 @@
           name: awx-secret-key
           readOnly: true
           subPath: SECRET_KEY
-
+      {{ include "common.waitForJobContainer" . | indent 6 | trim }}
       volumes:
       - configMap:
           defaultMode: 0777