Use new constraints template

This commit is contained in:
Daniel Berteaud 2024-02-20 15:50:57 +01:00
parent 90798be9b4
commit 762de78b9f
2 changed files with 6 additions and 5 deletions

View File

@ -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"

View File

@ -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