mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 01:15:43 +03:00
Distinct Property supports arbitrary limit
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 https://github.com/hashicorp/nomad/issues/1146
This commit is contained in:
@@ -537,7 +537,9 @@ The `Constraint` object supports the following keys:
|
||||
omitted.
|
||||
|
||||
- `distinct_property` - If set, the scheduler selects nodes that have a
|
||||
distinct value of the specified property for each allocation. This can
|
||||
distinct value of the specified property. The `RTarget` specifies how
|
||||
many allocations are allowed to share the value of a property. The
|
||||
`RTarget` must be 1 or greater and if omitted, defaults to 1. This can
|
||||
be specified as a job constraint which applies the constraint to all
|
||||
task groups in the job, or as a task group constraint which scopes the
|
||||
effect to just that group. The constraint may not be specified at the
|
||||
|
||||
Reference in New Issue
Block a user