Load balancing docker swarm using Ha Proxy Load balancing docker swarm using Ha Proxy docker docker

Load balancing docker swarm using Ha Proxy


If you get a 503 Service Not Available, then your health check fails.

From your configuration, HAProxy will use OPTIONS http://10.10.0.12:8443/ which will fail: your backend accept HTTPS connections. To fix that, tell HAProxy to use HTTPS:

 server swarm  10.10.0.12:8443 check inter 5000 ssl verify none

Note: you can enable the stat page with

listen haproxy_admin  bind 127.0.0.1:22002  mode http  stats enable  stats uri /

That should help you debug further issues.

Edit:

The stat page shows L7STS/404, that's the http code HAProxy gets. HAProxy currently checks https://10.10.0.12:8443/ while you test https://10.10.0.12:8443/docs/index.html. Perhaps you should use this url in your check:

option httpchk OPTIONS /docs/index.html