Search code examples
dockerdnsconsul

Can we achieve Consul loadbalancing without haproxy?


Can we achieve the round-robin in consul? Below I have done some attempts to achieve but didn't succeed.

When I try with consul load balancing, by launching 2 container and registering with same name in consul. After this I did curl to DNS provided by consul (tomcat.test.service.consul) and its getting load balancing.

But when I hit DNS in browser it is not working. If there is only one container then it works, as soon as I launch new container (load balance) it's returning a blank page.

Please let me know if I am going wrong somewhere or if I use a wrong configuration?


Solution

  • I find the solution here with iptables

    https://tech.iheart.com/load-balancing-services-using-consul-and-iptables-204cde23b072