2023-10-23 19:59:41 +00:00
|
|
|
job "fixers" {
|
|
|
|
|
|
|
|
type = "batch"
|
|
|
|
|
|
|
|
periodic {
|
|
|
|
cron = "*/15 * * * * *"
|
|
|
|
prohibit_overlap = true
|
|
|
|
}
|
|
|
|
|
2024-05-28 19:18:27 +00:00
|
|
|
meta = {
|
|
|
|
"diun.enable" = false
|
|
|
|
}
|
|
|
|
|
2024-04-22 16:06:58 +00:00
|
|
|
group "orphaned_services" {
|
2023-10-23 19:59:41 +00:00
|
|
|
task "orphaned_services" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
2023-12-29 15:35:07 +00:00
|
|
|
image = "iamthefij/nomad-service-fixers:0.1.1"
|
2023-10-23 19:59:41 +00:00
|
|
|
command = "/scripts/nomad_orphan_services.py"
|
2023-11-06 22:41:54 +00:00
|
|
|
args = ["--delete"]
|
2023-10-23 19:59:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
env = {
|
|
|
|
NOMAD_ADDR = "http+unix://%2Fsecrets%2Fapi.sock"
|
|
|
|
}
|
|
|
|
|
|
|
|
identity {
|
|
|
|
env = true
|
|
|
|
}
|
2024-03-23 04:07:07 +00:00
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 50
|
|
|
|
memory = 100
|
|
|
|
}
|
2023-10-23 19:59:41 +00:00
|
|
|
}
|
2024-04-22 16:06:58 +00:00
|
|
|
}
|
2023-10-23 19:59:41 +00:00
|
|
|
|
2024-04-22 16:06:58 +00:00
|
|
|
group "missing_services" {
|
2023-10-23 19:59:41 +00:00
|
|
|
task "missing_services" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
2024-05-28 19:18:27 +00:00
|
|
|
image = "iamthefij/nomad-service-fixers:0.1.1"
|
2023-10-23 19:59:41 +00:00
|
|
|
command = "/scripts/nomad_missing_services.py"
|
2023-11-06 22:41:54 +00:00
|
|
|
args = ["--restart"]
|
2023-10-23 19:59:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
env = {
|
|
|
|
NOMAD_ADDR = "http+unix://%2Fsecrets%2Fapi.sock"
|
|
|
|
}
|
|
|
|
|
|
|
|
identity {
|
|
|
|
env = true
|
|
|
|
}
|
2024-03-23 04:07:07 +00:00
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 50
|
|
|
|
memory = 100
|
|
|
|
}
|
2023-10-23 19:59:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|