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

[Feature request] client-level constraints #8663

Open
Legogris opened this issue Aug 13, 2020 · 4 comments
Open

[Feature request] client-level constraints #8663

Legogris opened this issue Aug 13, 2020 · 4 comments

Comments

@Legogris
Copy link

Legogris commented Aug 13, 2020

There are many scenarios where one would like to ensure that a particular node only receives either a certain job(s) or task group(s). As I see it, there is no way of restricting nodes to particular job(s) or task group(s) without introducing constraints in some way on job definitions themselves (e.g. using meta or node_class). There are workarounds, for example restricting those jobs to use different drivers that are only used for those jobs, but that's more of a hacky workaround that will only work for certain cases.

It'd be great if the client stanza had some mechanism to whitelist certain jobs or task groups - be it by a constraint stanza, requiring certain meta fields, or even just a whitelist of job or task group names.

@tgross
Copy link
Member

tgross commented Aug 13, 2020

Hi @Legogris!

One way I've done this is to have those clients in a different datacenter (but still joined to the same set of servers). Because datacenter is already a required field in the jobspec, it gives you a very coarse-grained control.

@Legogris
Copy link
Author

@tgross Thanks for the suggestion, that's not a bad idea. There's no impact to having this differ from consul dc for nomad clusters on consul, right?

@tgross
Copy link
Member

tgross commented Aug 13, 2020

There's no impact to having this differ from consul dc for nomad clusters on consul, right?

Right! A Consul datacenter is actually semantically closer to a Nomad region, so typically you'll end up with one Consul DC per Nomad region.

@pznamensky
Copy link

Nevertheless the "datacenter" workaround is not a good decision for all cases: #2299 (comment)

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

No branches or pull requests

3 participants