Open
Description
Folks, I observed an issue with init jobs config (for deployments relay on mongodb), specifically when mongoDB set to run in standalone architecture.
k8s do not create headless service for standalone mode, hence a service/endpoint should be referred in place of headless services.
Following need some logical handing for standalone mode.
until nc -z -w 2 {{ $.Release.Name }}-mongodb-headless {{ $mongodb_port }} && echo mongodb ok;
--->
until nc -z -w 2 {{ $.Release.Name }}-mongodb {{ $mongodb_port }} && echo mongodb ok;
`
{{- $mongodb_port := (int (index .Values "mongodb" "service" "port")) }}
- name: wait-for-db
image: busybox:1.28
command:
- 'sh'
- '-c'
- >
until nc -z -w 2 {{ $.Release.Name }}-mongodb-headless {{ $mongodb_port }} && echo mongodb ok;
do
echo 'Waiting for MongoDB Connection...'
sleep 2;
done
{{- end }}
{{- end -}}
let me know if anyone able to reproduce it.
Thanks