Docker Community Forums

Share and learn in the Docker community.

Swarm: Placement preferences order can't be used

In the swarm placement-preferences section https://docs.docker.com/engine/swarm/services/#placement-preferemces, it states that “You can specify multiple placement preferences, and they are processed in the order they are encountered”.
However due to the previous statement - “Nodes which are missing the label used to spread still receive task assignments”, the placement preferences order don’t have any effect.

For example, in case there are less prioritized application servers which the app should run on them only after other servers are full:

node0 with label fast
node1 with label fast
node2 with label slow

If the placement preferences prefers the fast server, like:
–placement-pref spread=node.labels.fast
–placement-pref spread=node.labels.slow

Due to the “Nodes which are missing the label used to spread still receive task assignments”, the preferences won’t be used and all replicas will be spread equally on all nodes.