Merge "Bump version of readiness image"
[oom.git] / kubernetes / oof / charts / oof-has / charts / oof-has-data / templates / deployment.yaml
index 4314227..054d181 100755 (executable)
@@ -21,7 +21,7 @@ metadata:
   labels:
     app: {{ include "common.name" . }}
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
+    release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
 spec:
   replicas: {{ .Values.replicaCount }}
@@ -29,14 +29,15 @@ spec:
     metadata:
       labels:
         app: {{ include "common.name" . }}
-        release: {{ .Release.Name }}
+        release: {{ include "common.release" . }}
     spec:
       initContainers:
-      - command:
+      - name: {{ include "common.name" . }}-readiness
+        command:
         - /root/ready.py
         args:
         - --container-name
-        - oof-has-music
+        - music-springboot
         env:
         - name: NAMESPACE
           valueFrom:
@@ -45,7 +46,56 @@ spec:
               fieldPath: metadata.namespace
         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        name: {{ include "common.name" . }}-readiness
+
+      - name: {{ include "common.name" . }}-onboard-readiness
+        command:
+        - /root/job_complete.py
+        args:
+        - -j
+        - "{{ include "common.release" . }}-oof-has-onboard"
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+
+      - name: {{ include "common.name" . }}-health-readiness
+        command:
+        - /root/job_complete.py
+        args:
+        - -j
+        - "{{ include "common.release" . }}-oof-has-healthcheck"
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+
+      - name: {{ include "common.name" . }}-data-sms-readiness
+        command:
+        - sh
+        - -c
+        - resp="FAILURE";
+          until [ $resp = "200" ]; do
+          resp=$(curl -s -o /dev/null -k --write-out %{http_code} https://aaf-sms.{{ include "common.namespace" . }}:10443/v1/sms/domain/has/secret);
+          echo $resp;
+          sleep 2;
+          done
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        image: "{{ .Values.global.dockerHubRepository }}/{{ .Values.global.curlImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+
       containers:
         - name: {{ include "common.name" . }}
           image: "{{ include "common.repository" . }}/{{ .Values.global.image.optf_has }}"
@@ -82,11 +132,11 @@ spec:
             name: {{ .Values.global.commonConfigPrefix }}-config
             subPath: conductor.conf
           - mountPath: /usr/local/bin/log.conf
-            name: {{ .Values.global.commonConfigPrefix }}-config 
+            name: {{ .Values.global.commonConfigPrefix }}-config
             subPath: log.conf
           - mountPath: /usr/local/bin/healthy.sh
             name: {{ .Values.global.commonConfigPrefix }}-config
-            subPath: healthy.sh 
+            subPath: healthy.sh
           - mountPath: /usr/local/bin/aai_cert.cer
             name: {{ .Values.global.commonConfigPrefix }}-config
             subPath: aai_cert.cer
@@ -97,7 +147,7 @@ spec:
             name: {{ .Values.global.commonConfigPrefix }}-config
             subPath: AAF_RootCA.cer
           resources:
-{{ toYaml .Values.resources | indent 12 }}
+{{ include "common.resources" . | indent 12 }}
         {{- if .Values.nodeSelector }}
         nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 10 }}
@@ -119,7 +169,7 @@ spec:
             - key: log.conf
               path: log.conf
             - key: healthy.sh
-              path: healthy.sh 
+              path: healthy.sh
             - key: aai_cert.cer
               path: aai_cert.cer
             - key: aai_key.key