Add distinct_hosts constraints

This commit is contained in:
Daniel Berteaud 2024-02-21 10:10:41 +01:00
parent cda2aad1c4
commit d33d4d88b8
3 changed files with 20 additions and 3 deletions

View File

@ -2,12 +2,22 @@ job "lemonldap-ng" {
datacenters = ["dc1"]
region = "global"
priority = 60
group "lemonldap-ng" {
count = 1
count = 1
shutdown_delay = "6s"
constraint {
operator = "distinct_hosts"
value = "true"
}
network {
mode = "bridge"

View File

@ -6,6 +6,9 @@ job "[[ .instance ]]" {
[[- $c := merge .llng.engine .llng . ]]
count = [[ $c.count ]]
shutdown_delay = "6s"
[[ template "common/constraints" $c ]]
network {
mode = "bridge"

View File

@ -4,10 +4,14 @@ instance: lemonldap-ng
llng:
# A lot of services depends on lemonldap
# so make it a bit higher priority than normal
nomad:
# A lot of services depends on lemonldap
# so make it a bit higher priority than normal
priority: 60
# Ensure we run different alloc on different hosts
constraints:
- operator: distinct_hosts
value: true
# The same engine can run portal, manager and handler
# The settings below are for the uwsgi engine itself