From dd46ca542fadcc7064109e16522a18fb197b2307 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 17 Apr 2024 22:54:11 +0200 Subject: [PATCH] Cleanup --- .../root/usr/local/bin/lemonldap-ng | 3 ++- example/lemonldap-ng.nomad.hcl | 19 +++++++++++++++++-- .../root/usr/local/bin/lemonldap-ng | 3 ++- lemonldap-ng.nomad.hcl | 9 +++------ variables.yml | 2 +- 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/example/images/lemonldap-ng/root/usr/local/bin/lemonldap-ng b/example/images/lemonldap-ng/root/usr/local/bin/lemonldap-ng index eaf76f9..3198f0c 100755 --- a/example/images/lemonldap-ng/root/usr/local/bin/lemonldap-ng +++ b/example/images/lemonldap-ng/root/usr/local/bin/lemonldap-ng @@ -21,4 +21,5 @@ exec uwsgi \ --workers ${LLNG_WORKERS} \ --cheaper-initial 2 \ --cheaper-algo spare \ - --cheaper-step 1 + --cheaper-step 1 \ + --need-app diff --git a/example/lemonldap-ng.nomad.hcl b/example/lemonldap-ng.nomad.hcl index bfaca36..563049d 100644 --- a/example/lemonldap-ng.nomad.hcl +++ b/example/lemonldap-ng.nomad.hcl @@ -12,6 +12,19 @@ job "lemonldap-ng" { shutdown_delay = "6s" + constraint { + operator = "distinct_hosts" + value = "true" + } + + + ephemeral_disk { + # Use minimal ephemeral disk + size = 101 + } + + + constraint { operator = "distinct_hosts" @@ -81,6 +94,7 @@ job "lemonldap-ng" { grace = "5m" } } + tags = [ "traefik.http.routers.lemonldap-ng-portal.rule=Host(`sso.example.org`) && !PathRegexp(`^/index\\.psgi/(config|sessions)`)", @@ -139,9 +153,10 @@ job "lemonldap-ng" { driver = "docker" config { - image = "danielberteaud/lemonldap-ng:2.18.2-2" + image = "danielberteaud/lemonldap-ng:2.18.2-3" readonly_rootfs = true - pids_limit = 200 + + pids_limit = 200 volumes = [ "secrets/lemonldap-ng.ini:/etc/lemonldap-ng/lemonldap-ng.ini:ro", "local/init-db.sh:/entrypoint.d/20-initdb.sh:ro", diff --git a/images/lemonldap-ng/root/usr/local/bin/lemonldap-ng b/images/lemonldap-ng/root/usr/local/bin/lemonldap-ng index eaf76f9..3198f0c 100755 --- a/images/lemonldap-ng/root/usr/local/bin/lemonldap-ng +++ b/images/lemonldap-ng/root/usr/local/bin/lemonldap-ng @@ -21,4 +21,5 @@ exec uwsgi \ --workers ${LLNG_WORKERS} \ --cheaper-initial 2 \ --cheaper-algo spare \ - --cheaper-step 1 + --cheaper-step 1 \ + --need-app diff --git a/lemonldap-ng.nomad.hcl b/lemonldap-ng.nomad.hcl index c1d9af9..da903ba 100644 --- a/lemonldap-ng.nomad.hcl +++ b/lemonldap-ng.nomad.hcl @@ -4,9 +4,7 @@ job "[[ .instance ]]" { group "lemonldap-ng" { [[- $c := merge .llng.engine .llng . ]] - - count = [[ $c.count ]] - shutdown_delay = "6s" +[[ template "common/group_start" $c ]] [[ template "common/constraints" $c ]] @@ -54,11 +52,10 @@ job "[[ .instance ]]" { [[ template "common/task.pgpooler" $c ]] task "lemonldap-ng" { - driver = [[ $c.nomad.driver | toJSON ]] + driver = "[[ $c.nomad.driver ]]" config { - image = [[ $c.image | toJSON ]] - readonly_rootfs = true +[[ template "common/image" $c ]] pids_limit = 200 volumes = [ "secrets/lemonldap-ng.ini:/etc/lemonldap-ng/lemonldap-ng.ini:ro", diff --git a/variables.yml b/variables.yml index 95a9480..6043e46 100644 --- a/variables.yml +++ b/variables.yml @@ -24,7 +24,7 @@ llng: version: 2.18.2 # Docker image to use - image: '[[ .docker.repo ]]lemonldap-ng:[[ .llng.engine.version ]]-2' + image: '[[ .docker.repo ]]lemonldap-ng:[[ .llng.engine.version ]]-3' # Resource allocation resources: