Docker Swarm Scheduling, preventing replicated container from doubling up on host

We have a Docker swarm with 5 nodes. We have a stack that has a scale of 4 … Is there anyway to set the placement preferences on the stack to prevent the containers from running on the same node?

Example… If we lose 2 of the nodes (going from 5 to 3) we don’t would rather have the stack either drop to 3 replicas (automatically) or report it as unhealthy and run 3 of 4 replicas. We can’t have the same container run on the same node.

1 Like