Load balancing strategies

I have been evaluating Rancher for some time now and I’m super happy with it.
The only thing that I don’t quite get yet is how to handle load balancing without singe point of failure.

Lets say that I have 3 hosts, node1.2 and 3.
And lets say that I run some microservice on all of these hosts.

If I set up a loadblancer vis Rancher pointing to the instances of this service. then the balancer will run on one of my hosts.
if that host goes down, then no one can reach the underlying services.

IMO Consul handles this in a better way as you run a Consul agent on each host, and the name resolution and load balancing happens via that local agent.
If one node goes down, everyone else can still resolve and balance over the other nodes.

Am I misinterpreting here, can I do the same nativly in Rancher?
Or if not, can Consul co-exist with Rancher, e.g. use Consul as a DNS server for each instance?
(Im aware that we have Consul in the Rancher Catalog, but it is not clear if you can use the name resolution too)

Sorry, I can’t write more to answer your question today, but here are some references where this was discussed.

Hi @rogeralsing .

For outside traffic into your rancher “cluster”, etlweather pretty much covered it… you will probably want to run an LB on all servers and use a keepalived solution with floating ip or ips. If you are running 100% on amazon you can use ELBs instead to send traffic to one of the 3 hosts…

For internal services, if you dont use a load balancer for them, they will resolve in round-robin fashion to the services available… ex: if you have 5 containers running on the 3 hosts, it will give you rr dns on all 5… For now there is no way to use/prefer “local” services afaik… Rancher removes “dead” container mappings from its DNS resolution if a container or host goes away. I believe this is done centrally on the Rancher instance, however, so you need to also make sure you have Rancher itself setup with HA…

1 Like