docker-archive / dockercloud-haproxy

HAproxy image that autoreconfigures itself when used in Docker Cloud
https://cloud.docker.com/
651 stars 187 forks source link

Resolution too early #225

Open blop opened 6 years ago

blop commented 6 years ago

Sometimes, when scaling a service, HAProxy gets restarted with a new configuration but the docker dns seems not ready it to resolve the container name.

This makes HAProxy to fail starting properly. I added : EXTRA_DEFAULT_SETTINGS: "default-server init-addr last\\,libc\\,none"

So that even if the backend hostname does not resolve, it would resolve to none and start anyway. But then HAProxy keeps that backend in a "MAINTanance" status, and it won't come up after by itself, unless HAProxy is restarted. I'll create an issue for this to be fixed in HAProxy as well.

I suggest you setup the "default-server init-addr" with the none fallback ("last,libc,none") per default in the dockercloud-haproxy image.