Load balance dynamic target ports

In Rancher it’s possible to assign a random port to a service, which is great - I can run multiple services on my one dev host and that works fine. But how do I add a load balancer that knows about those random ports? The UI asks for a specific port, but it feels like Rancher should already know enough about what ports are being used to just pick them itself.


Load balancers talk to the target containers over the overlay network and use the actual port the container is listening on/exposing. You do not need to publish any ports on the target service, random or otherwise.

1 Like