Docker Community Forums

Share and learn in the Docker community.

Docker service with node limit not working with update order start first

I have a Service, with a Limit of 1 task per node. When I try to update the service with the update order Start first the service doesn’t get updated, because the engine can’t find a node to place the new container on before killing the old one.

Is this the correct behavior because it feels kinda counter intuative to me. How do I update a service with a node limit then?

Using --mode=global would be awkward, or does this mode also support --replicas? I have been thinking that --replicas applies only to --mode=replicated.

Also, can I use --mode=global --constraint= to control how many nodes I want running only 1 replica?

I’ve assumed that --mode=global is intended to run 1 task on all nodes in the cluster and that you couldn’t control the number of replicas or constrain the scheduler.

From the logical perspective, it makes sense that rolling updates are not possible with the configuration combination you picked. They contradict each other. You have to loose either one of those settings OR delete the stack and re-deploy it.