From 58e382e14563b0b21a5e71dc9c16258c1be99a47 Mon Sep 17 00:00:00 2001 From: Mathias Magnusson Date: Mon, 30 Jun 2025 19:05:35 +0200 Subject: add zero-downtime deployments & update nginx versions well it's not quite zero-downtime because it seems that for a while the old task has stopped but has not yet been removed from traefik, so for a few seconds half the requests get back "bad gateway" --- jobs/faeltkullen.nomad.hcl | 8 +++++++- jobs/files.nomad.hcl | 8 +++++++- jobs/homepage/homepage.nomad.hcl | 10 +++++++--- jobs/raytracer.nomad.hcl | 8 +++++++- jobs/rr.nomad.hcl | 8 +++++++- 5 files changed, 35 insertions(+), 7 deletions(-) diff --git a/jobs/faeltkullen.nomad.hcl b/jobs/faeltkullen.nomad.hcl index a5065fe..422346b 100644 --- a/jobs/faeltkullen.nomad.hcl +++ b/jobs/faeltkullen.nomad.hcl @@ -6,6 +6,12 @@ job "faeltkullen" { } } + update { + canary = 1 + auto_revert = true + auto_promote = true + } + volume "files" { type = "host" source = "static-files" @@ -38,7 +44,7 @@ job "faeltkullen" { } config { - image = "nginx:1.25-alpine" + image = "nginx:1.29-alpine" ports = ["http"] volumes = [ diff --git a/jobs/files.nomad.hcl b/jobs/files.nomad.hcl index 2bb2b00..3d8227d 100644 --- a/jobs/files.nomad.hcl +++ b/jobs/files.nomad.hcl @@ -6,6 +6,12 @@ job "files" { } } + update { + canary = 1 + auto_revert = true + auto_promote = true + } + volume "files" { type = "host" source = "static-files" @@ -38,7 +44,7 @@ job "files" { } config { - image = "nginx:1.25-alpine" + image = "nginx:1.29-alpine" ports = ["http"] volumes = [ diff --git a/jobs/homepage/homepage.nomad.hcl b/jobs/homepage/homepage.nomad.hcl index dc1be71..f859314 100644 --- a/jobs/homepage/homepage.nomad.hcl +++ b/jobs/homepage/homepage.nomad.hcl @@ -1,13 +1,17 @@ job "homepage" { group "web" { - count = 1 - network { port "http" { to = 80 } } + update { + canary = 1 + auto_revert = true + auto_promote = true + } + service { name = "homepage" port = "http" @@ -29,7 +33,7 @@ job "homepage" { } config { - image = "nginx:1.25-alpine" + image = "nginx:1.29-alpine" ports = ["http"] volumes = [ diff --git a/jobs/raytracer.nomad.hcl b/jobs/raytracer.nomad.hcl index 4a528e5..2578b35 100644 --- a/jobs/raytracer.nomad.hcl +++ b/jobs/raytracer.nomad.hcl @@ -6,6 +6,12 @@ job "raytracer" { } } + update { + canary = 1 + auto_revert = true + auto_promote = true + } + volume "files" { type = "host" source = "static-files" @@ -38,7 +44,7 @@ job "raytracer" { } config { - image = "nginx:1.25-alpine" + image = "nginx:1.29-alpine" ports = ["http"] volumes = [ diff --git a/jobs/rr.nomad.hcl b/jobs/rr.nomad.hcl index 9c00e3b..0517103 100644 --- a/jobs/rr.nomad.hcl +++ b/jobs/rr.nomad.hcl @@ -6,6 +6,12 @@ job "rr" { } } + update { + canary = 1 + auto_revert = true + auto_promote = true + } + volume "files" { type = "host" source = "static-files" @@ -38,7 +44,7 @@ job "rr" { } config { - image = "nginx:1.25-alpine" + image = "nginx:1.29-alpine" ports = ["http"] volumes = [ -- cgit v1.2.3