Load Balancer and port conflicts

HI all,

Struggling a little with understanding how the rancher load balancers work, I have a pretty simple setup, an api service, and nginx for static files.
I want to load balance my api service, but how can I do this without the ports conflicting?

Right now my load balancer receives on :80/api and routes to api:3000, if I scale this up though, there is a conflict as the new container tries to get port 3000 as well.

Am I missing something?

Think I just figured it out, make sure you don’t have an external port on the api service, rancher looks like it automatically gives a port to your service.

Containers are accessible on the internal overlay network without publishing ports to the host. So yes, you have a limited number of balancer containers and then the services behind then vang have any scale since they use no host ports.

Yup, I didn’t realise that rancher internally will link the port, I was using EXPOSE in my dockerfile, and naturally, getting conflicts when I went to scale.