How does cattle deal with multiple stacks with load balancer services

Trying to understand how rancher cattle would handle the following:
2 stacks with identical services, and each stack has a load balancer config using http on the same port, but with different hostname settings. Is Rancher able to distribute traffic correctly in this scenario?

A single ip:port combination is only going to be tied to one container (balancer). So you can’t really create the situation you’re asking about, if both stacks have a balancer asking for the same port(s) they would get scheduled to different hosts and be available by different public IPs.

It is possible to make a single balancer service which can then route traffic based on hostname to services that exist in multiple stacks. This is a fairly common pattern. You can also use selectors to have services automatically define their port rules (hostname mappings) so that the balancer config doesn’t have to change every time a new service is added.

Yup, that makes sense. Were also using the shared lb pattern, I’m just trying to understand the system better. Thanks!