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

Support max per key constraint #1146

Closed
autocracy opened this issue May 4, 2016 · 13 comments
Closed

Support max per key constraint #1146

autocracy opened this issue May 4, 2016 · 13 comments

Comments

@autocracy
Copy link

The simple version of this is that each rack with in our datacenter will have its own separate meta.rack attribute. By example, we might have 10 task groups to be run, but with a maximum of 3 scheduled on any given rack.

@dadgar
Copy link
Contributor

dadgar commented May 6, 2016

Hey,

This is a great idea. Global constraints like this is something we want in the future but are not actively working on in the short term.

@timperrett
Copy link

@dadgar any chance to bump this up? Spreading things evenly among racks, coupled with nomad's aggressive preference to bin-pack, makes this a tough spot for services requiring redundancy.

@dvusboy
Copy link

dvusboy commented Jul 22, 2017

So, neither distinct_host nor distinct_property would work? The latter one can be used to cover anything from different racks to different availability zones, depending on how you set up your agents.

@jippi
Copy link
Contributor

jippi commented Jul 22, 2017

I would love to have distinct_property on aws.az with limit of 3

to never run more than3 allocs on the job per az - or even better for my usecase

split_property on aws.az where nomad will do best effort to split allocs between the AZ's in my cluster like an AWS ASG does

@autocracy
Copy link
Author

At the time this was filed, distinct_property didn't exist. If changed to max_property with a check like https://github.com/hashicorp/nomad/pull/2418/files#diff-b141e83fa6e3c9f720ea4148a0134a4eR285 where the number is the value rather than 0, we might have it.

@jippi
Copy link
Contributor

jippi commented Jul 22, 2017

That would be so badass !

@timperrett
Copy link

Agreed this would be splendid. Use case is similar to what @jippi highlights with split_property: to say I want X container count, but i want them split as fairly as possible over a set of AZs (or racks).

@autocracy my reading of your comment is that it would solve @jippi's first case, but not the case I just stated (which seems like a case most people running services would want). Is that accurate?

@dvusboy
Copy link

dvusboy commented Jul 24, 2017

@jippi When you say distinct_property on aws.az with limit of 3, you're not saying count = 3, right? You may have count = 12, but you want the tasks to be distributed to no more than 3 distinct aws.az, right? Bin-packing those 4 instances within a single AZ is OK?

@jippi
Copy link
Contributor

jippi commented Jul 31, 2017

@dvusboy yes :)

@dadgar
Copy link
Contributor

dadgar commented Jul 31, 2017

@timperrett Sure. Will try to get this in 0.6.1

@timperrett
Copy link

@dadgar you sir, are a gent! that would be awesome!!!

@dvusboy
Copy link

dvusboy commented Jul 31, 2017

And it's not just Alex, all the Nomad devs have been extremely responsive and helpful.

dadgar added a commit that referenced this issue Jul 31, 2017
This PR enhances the distinct_property constraint such that a limit can
be specified in the RTarget/value parameter. This allows constraints
such as:

```
constraint {
  distinct_property = "${meta.rack}"
  value = "2"
}
```

This restricts any given rack from running more than 2 allocations from
the task group.

Fixes #1146
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants