From f3fddff354c30cbb36c74386dc20fd728214e7e6 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Sat, 12 Dec 2020 02:34:19 +0500 Subject: [PATCH] Use nc instead of nslookup while waiting for postgres to come up Using nslookup, the wait time for nextcloud pod to come up can be up to 1-5 minutes. This is reduced with nc to 5-10 seconds. --- test/nextcloud/1.0.0/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/nextcloud/1.0.0/templates/deployment.yaml b/test/nextcloud/1.0.0/templates/deployment.yaml index 6f0f36b4d5e..e73c7f366de 100644 --- a/test/nextcloud/1.0.0/templates/deployment.yaml +++ b/test/nextcloud/1.0.0/templates/deployment.yaml @@ -39,7 +39,7 @@ spec: initContainers: - name: init-postgresdb image: busybox:latest - command: ['sh', '-c', "until nslookup {{ template "nextcloud.fullname" . }}-postgres; do echo waiting for postgres; sleep 2; done"] + command: ['sh', '-c', "until nc -w 5 -vz {{ template "nextcloud.fullname" . }}-postgres 5432; do echo waiting for postgres; sleep 2; done"] imagePullPolicy: {{ .Values.image.pullPolicy }} containers: - name: {{ .Chart.Name }}