Having followed this great guide on lxd and haproxy, I’ve only managed to get haproxy working if I use the IP of the container and not the container name…
For example, this line in a backend section works fine server apache_00 10.174.73.237:80 check
But using the container name or the container’s hostname doesn’t work. The container name returns error 503 from haproxy and the container hostname gives a page not redirecting error.
It’s not a show-stopper but I was surprised to find that Ubuntu 16.04 is using haproxy version 1.6.3, while Debian 9 uses 1.7.5-2.
So I guess I’m curious as to how @simos managed to use the container’s names in the tutorial?
Yeah, I can ping container 1 from container 2 no problem… I tested this from the ha-proxy container and it pinged my other containers on the same host no problem…
Check whether the semantics changed between there major versions of HAproxy.
I suppose that you have restarted the HAProxy service several times. If you still get the error, then it is likely some other issue unrelated to containers.
For example, you may be trying to use the PROXY protocol and you do not terminate the connections.
If all fail, try to follow the guide as described with Ubuntu and the bit by bit to your setup.
Hi @simos , thank you for this… my workaround is fine for now, using IP addresses is fine given the relatively small number of containers I’ve got running…
I’ll return to this if I need container names in the future!