From 8b7dcadeed7d680730a5adf85a06d8169680a035 Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Thu, 2 Aug 2018 17:19:27 -0700 Subject: Add readiness step for deployment Using an initContainer and to start SMS only after vault and consul have already started. This prevents restarts of the sms container. Issue-ID: AAF-421 Change-Id: Ied3264711d5d931a1d18523eadcc84e188ededa5 Signed-off-by: Kiran Kamineni --- .../aaf-sms/charts/aaf-sms-quorumclient/values.yaml | 2 +- charts/aaf-sms/templates/deployment.yaml | 19 ++++++++++++++++++- charts/aaf-sms/values.yaml | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/charts/aaf-sms/charts/aaf-sms-quorumclient/values.yaml b/charts/aaf-sms/charts/aaf-sms-quorumclient/values.yaml index c5fd489..768f89f 100644 --- a/charts/aaf-sms/charts/aaf-sms-quorumclient/values.yaml +++ b/charts/aaf-sms/charts/aaf-sms-quorumclient/values.yaml @@ -28,7 +28,7 @@ global: ################################################################# # application image repository: nexus3.onap.org:10001 -image: onap/aaf/smsquorumclient:2.0.0 +image: onap/aaf/smsquorumclient:latest pullPolicy: Always # flag to enable debugging - application support required diff --git a/charts/aaf-sms/templates/deployment.yaml b/charts/aaf-sms/templates/deployment.yaml index 4bdb84f..58fe72f 100644 --- a/charts/aaf-sms/templates/deployment.yaml +++ b/charts/aaf-sms/templates/deployment.yaml @@ -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 }}" - name: {{ include "common.name" . }} imagePullPolicy: {{ .Values.pullPolicy }} + name: {{ include "common.name" . }} command: ["/sms/bin/sms"] workingDir: /sms/ ports: diff --git a/charts/aaf-sms/values.yaml b/charts/aaf-sms/values.yaml index b75038c..df2b6ab 100644 --- a/charts/aaf-sms/values.yaml +++ b/charts/aaf-sms/values.yaml @@ -28,7 +28,7 @@ global: ################################################################# # application image repository: nexus3.onap.org:10001 -image: onap/aaf/sms:2.0.0 +image: onap/aaf/sms:latest pullPolicy: Always # flag to enable debugging - application support required -- cgit 1.2.3-korg