Use new constraints template
This commit is contained in:
parent
90798be9b4
commit
762de78b9f
|
@ -7,11 +7,7 @@ job "[[ .instance ]]" {
|
|||
|
||||
count = [[ $c.count ]]
|
||||
|
||||
# Ensure all instances run on different nodes
|
||||
constraint {
|
||||
operator = "distinct_hosts"
|
||||
value = "true"
|
||||
}
|
||||
[[ template "common/constraints" $c ]]
|
||||
|
||||
# Wait a few seconds between service deregistration from consul catalog and task kill
|
||||
shutdown_delay = "6s"
|
||||
|
|
|
@ -42,6 +42,11 @@ elasticsearch:
|
|||
# Publish the node addr in the metadata of the service
|
||||
addr: 'es-${NOMAD_ALLOC_INDEX}.[[ .instance ]][[ .consul.suffix ]].service.[[ .consul.domain ]]'
|
||||
|
||||
nomad:
|
||||
constraints:
|
||||
- operator: distinct_hosts
|
||||
value: true
|
||||
|
||||
# Resource allocation
|
||||
resources:
|
||||
cpu: 300
|
||||
|
|
Loading…
Reference in New Issue