Ingress load balancing


I’m trying to replicate the setup on slide 22 of the presentation What’s new in Docker 1.12.

Basically I set up 3 nodes and scheduled a service with 2 replicas and an exposed port. One of the nodes obviously won’t get any tasks, and when I try to connect to it I get a “connection refused” error. The presentation slide implies that the connection would be automatically redirected to one of the nodes that have running tasks for the service.

Do I have to do anything else to get that to work?


Hi Andre,

I was facing the same issue with 1.12-rc2 version, I was using custom network(overlay) and creating a service with “–network” option, the requests were routed to the same service instance.

Then, I have removed the services and custom network, and created services without network options(default network, ingress), and then it started routing request to two services in round robin fashion.

Not sure if you have to do anything else to get it work with custom overlay network.

Note - I am using nginx in front of services(1 instance of nginx, 2 instances of web service)


Thanks Anil.

I got it to work with a new swarm created from scratch. I believe I tried with and without a --network parameter and both worked.

What didn’t work, strangely, was when I had multiple masters using the promote sub command. Then the load balancing seems to break.

1 Like