Use new constraints template

This commit is contained in:
Daniel Berteaud 2024-02-20 15:39:03 +01:00
parent 89d47a023a
commit 1229b2a3d1
4 changed files with 11 additions and 9 deletions

View File

@ -10,12 +10,14 @@ job "traefik" {
count = 2
shutdown_delay = "6s"
# Force different instances to run on distinct nodes
constraint {
operator = "distinct_hosts"
value = "true"
}
network {
mode = "bridge"
port "http" {
@ -116,7 +118,7 @@ job "traefik" {
template {
data = <<_EOF
log:
level: INFO
level: DEBUG
accessLog:
bufferingSize: 100

View File

@ -1,5 +1,5 @@
log:
level: INFO
level: DEBUG
accessLog:
bufferingSize: 100

View File

@ -8,11 +8,7 @@ job "[[ .instance ]]" {
count = [[ .traefik.count ]]
shutdown_delay = "6s"
# Force different instances to run on distinct nodes
constraint {
operator = "distinct_hosts"
value = "true"
}
[[ template "common/constraints" $c ]]
network {
mode = "bridge"

View File

@ -19,9 +19,13 @@ traefik:
# Number of traefik instances
count: 2
# Set a high priority for the job
nomad:
# Set a high priority for the job
priority: 70
# Ensure we run on distinct hosts
constraints:
- operator: distinct_hosts
value: true
api:
traefik: