Merge "Mavenized image creation for readiness-check"
[oom.git] / kubernetes / aaf / charts / aaf-sms / templates / deployment.yaml
index 4bdb84f..a461b2e 100644 (file)
@@ -30,10 +30,27 @@ spec:
         app: {{ include "common.name" . }}
         release: {{ .Release.Name }}
     spec:
+      initContainers:
+      - image:  "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        name: {{ include "common.name" . }}-readiness
+        command:
+        - /root/ready.py
+        args:
+        - --container-name
+        - "aaf-sms-vault"
+        - --container-name
+        - "aaf-sms-vault-backend"
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
       containers:
       - image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}
-        imagePullPolicy: {{ .Values.pullPolicy }}
         command: ["/sms/bin/sms"]
         workingDir: /sms/
         ports:
@@ -64,7 +81,7 @@ spec:
           - mountPath: /sms/auth
             name: {{ include "common.fullname" . }}-auth
         resources:
-{{ toYaml .Values.resources | indent 12 }}
+{{ include "common.resources" . | indent 10 }}
         {{- if .Values.nodeSelector }}
         nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 10 }}
@@ -81,7 +98,11 @@ spec:
         configMap:
           name: {{ include "common.fullname" . }}
       - name: {{ include "common.fullname" . }}-auth
+      {{- if .Values.persistence.enabled }}
         persistentVolumeClaim:
           claimName: {{ include "common.fullname" . }}
+      {{- else }}
+        emptyDir: {}
+      {{- end }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"