Reatart failing services

Restart services that fail checks
This commit is contained in:
IamTheFij 2024-02-18 07:49:16 -08:00
parent f2f415aeac
commit 64a085ef80
2 changed files with 12 additions and 6 deletions

View File

@ -1,12 +1,13 @@
module "minitor" { module "minitor" {
source = "./service" source = "./service"
name = "minitor" name = "minitor"
image = "iamthefij/minitor-go:1.4.1" image = "iamthefij/minitor-go:1.4.1"
args = ["-metrics", "-config=$${NOMAD_TASK_DIR}/config.yml"] args = ["-metrics", "-config=$${NOMAD_TASK_DIR}/config.yml"]
service_port = 8080 service_port = 8080
use_wesher = var.use_wesher service_check = null
prometheus = true use_wesher = var.use_wesher
prometheus = true
env = { env = {
TZ = "America/Los_Angeles", TZ = "America/Los_Angeles",

View File

@ -120,6 +120,11 @@ job "${name}" {
path = "${service_check.path}" path = "${service_check.path}"
interval = "${service_check.interval}" interval = "${service_check.interval}"
timeout = "${service_check.timeout}" timeout = "${service_check.timeout}"
check_restart {
limit = 5
grace = "90s"
}
} }
%{~ endif ~} %{~ endif ~}
} }