swarmkit icon indicating copy to clipboard operation
swarmkit copied to clipboard

PlacementPreference SpreadOver only nodes with label when possible

Open mustafa1024m opened this issue 6 years ago • 4 comments

Allow placement preferences only to nodes with the specified label, as long as possible. The current scheduling behavior can cause scheduling problems. From: https://github.com/docker/swarmkit/blob/master/design/topology.md "Nodes that are missing the label used by SpreadOver will still receive task assignments. As a group, they will receive tasks in equal proportion to any of the other groups identified by a specific label value. In a sense, a missing label is the same as having the label with a null value attached to it"

If I have two nodes with label X and a third without a label, running 3 service instances will put an instance on each node, the solution in the above document is to use constraints, which will prevent the service from running if only node 3 is up. I think the best way is to prevent spreading to the null labeled nodes, this will allow running services according to the preferences as long as possible, if satisfying these preferences is not possible, the service will run on nodes without the label.

mustafa1024m avatar Mar 23 '19 13:03 mustafa1024m

/cc @dperny @aaronlehmann

thaJeztah avatar Mar 24 '19 11:03 thaJeztah

I'm having the same issue; I'd like to have a "preferred" server and a fallback server if the former fails. Is there any way to do it? If not, is there any planning to support the fix this issue proposes? Thanks in advance!

alextousss avatar Jul 01 '19 21:07 alextousss

I'm having the same issue; I'd like to have a "preferred" server and a fallback server if the former fails. Is there any way to do it? If not, is there any planning to support the fix this issue proposes? Thanks in advance!

Similar issue here, if anyone has a solution to offer, it would be greatly appreciated !

flopon avatar Jul 17 '19 11:07 flopon

I'm having the same issue; I'd like to have a "preferred" server and a fallback server if the former fails. Is there any way to do it? If not, is there any planning to support the fix this issue proposes? Thanks in advance!

Similar issue here, if anyone has a solution to offer, it would be greatly appreciated !

I'm currently looking to fork SwarmKit as we have no answer. I also asked the question on SwarmKit's IRC channel but got no answer. I'll do a PR if I succeed.

alextousss avatar Jul 18 '19 17:07 alextousss