Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placement constraint whitelists #87

Open
jkao97 opened this issue Aug 19, 2020 · 1 comment
Open

Placement constraint whitelists #87

jkao97 opened this issue Aug 19, 2020 · 1 comment

Comments

@jkao97
Copy link

jkao97 commented Aug 19, 2020

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 like node.hostname==node-2;node.hostname==node-3, but this doesn't seem to work (job just gets stuck in queue).

@gutschet
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants