diff --git a/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-ext-svc.yaml b/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-ext-svc.yaml index 297e0e08..fa04e70e 100644 --- a/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-ext-svc.yaml +++ b/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-ext-svc.yaml @@ -22,6 +22,10 @@ metadata: {{- end }} spec: ports: + - name: health + port: 8088 + protocol: TCP + targetPort: health - name: http port: 28080 protocol: TCP diff --git a/packages/cloud2edge/templates/post-install-job.yaml b/packages/cloud2edge/templates/post-install-job.yaml index 8802c088..11ceef72 100644 --- a/packages/cloud2edge/templates/post-install-job.yaml +++ b/packages/cloud2edge/templates/post-install-job.yaml @@ -36,6 +36,24 @@ spec: helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" spec: restartPolicy: Never + initContainers: + - name: "wait-for-services" + image: "curlimages/curl:7.68.0" + command: + - /bin/sh + - -c + - | + set -x + + while [[ "$(curl -sL -w "%{http_code}\n" "http://{{ .Release.Name }}-service-device-registry-ext:8088/liveness" -o /dev/null)" != "200" ]]; do + echo '.' + sleep 10 + done + + while [[ "$(curl -sL -w "%{http_code}\n" "http://{{ .Release.Name }}-ditto-nginx:8080/health" -o /dev/null)" != "200" ]]; do + echo '.' + sleep 10 + done containers: - name: "post-install" image: "curlimages/curl:7.68.0"