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.
This commit is contained in:
Waqar Ahmed
2020-12-12 02:34:19 +05:00
parent 2fb46e619c
commit f3fddff354
@@ -39,7 +39,7 @@ spec:
initContainers: initContainers:
- name: init-postgresdb - name: init-postgresdb
image: busybox:latest 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 }} imagePullPolicy: {{ .Values.image.pullPolicy }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}