Skip to content

Commit

Permalink
infra: Fix random 502s
Browse files Browse the repository at this point in the history
  • Loading branch information
schneefux committed Mar 26, 2024
1 parent eef4913 commit d6e73eb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deployment/jobs/conf/traefik.toml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
trustedIPs = ["127.0.0.1/32"]

[log]
level = "INFO"
#level = "INFO"
level = "DEBUG"

[api]
dashboard = true
Expand Down
36 changes: 36 additions & 0 deletions deployment/jobs/invalid-service-cleaner.nomad
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# workaround for zombie service instances
# https://github.com/hashicorp/nomad/issues/16616#issuecomment-1748006168

job "nomad-invalid-services-cleaner" {
type = "batch"

periodic {
prohibit_overlap = true
cron = "0/10 * * * * *"
time_zone = "Europe/Berlin"
}

group "services_cleaner" {
task "cleaner" {
driver = "docker"

config {
image = "ghcr.io/icyleaf/nomad-invalid-services-cleaner:0.1"
}

template {
destination = "secrets/.env"
env = true
data = <<-EOF
ONESHOT = true
NOMAD_ENDPOINT = http://{{ env "attr.unique.network.ip-address" }}:4646
EOF
}

resources {
cpu = 50
memory = 50
}
}
}
}

0 comments on commit d6e73eb

Please sign in to comment.