Open jkao97 opened 4 years ago
You can add labels to the hosts you want to use::
docker node update --label-add <label-name>=<label-value> <node>
for example:
docker node update --label-add whitelisted=yes node-1
Then you can use the label for the placement constrinat like this:
node.labels.<label-name>==<label-value>
for example:
node.labels.whitelisted==yes
Documentation states we can specify placement with, for example,
node.role!=manager;node.hostname!=node-2
. Is there a way to whitelist instead of blacklist where jobs can be assigned to?Something like
node.hostname==node-2
works but I'm looking for a way to enable on multiple nodes. I've tried something likenode.hostname==node-2;node.hostname==node-3
, but this doesn't seem to work (job just gets stuck in queue).