Move Blocky and Exporters away from system to service jobs

This is because service jobs do not get rescheduled when allocs fail
This commit is contained in:
IamTheFij 2024-05-30 11:41:40 -07:00
parent e88c7c250d
commit 90b7740343
2 changed files with 21 additions and 3 deletions

View File

@ -5,16 +5,25 @@ variable "config_data" {
job "blocky" { job "blocky" {
datacenters = ["dc1"] datacenters = ["dc1"]
type = "system" type = "service"
priority = 100 priority = 100
constraint {
distinct_hosts = true
}
update { update {
max_parallel = 1 max_parallel = 1
# TODO: maybe switch to service job from system so we can use canary and autorollback # TODO: maybe switch to service job from system so we can use canary and autorollback
# auto_revert = true auto_revert = true
min_healthy_time = "60s"
healthy_deadline = "5m"
} }
group "blocky" { group "blocky" {
# TODO: This must be updated to match the nubmer of servers (possibly grabbed from TF)
# I am moving away from `system` jobs because of https://github.com/hashicorp/nomad/issues/12023
count = 3
network { network {
mode = "bridge" mode = "bridge"
@ -62,6 +71,11 @@ job "blocky" {
path = "/" path = "/"
interval = "10s" interval = "10s"
timeout = "3s" timeout = "3s"
check_restart {
limit = 3
grace = "5m"
}
} }
} }

View File

@ -1,8 +1,12 @@
job "exporters" { job "exporters" {
datacenters = ["dc1"] datacenters = ["dc1"]
type = "system" type = "service"
priority = 55
group "promtail" { group "promtail" {
# TODO: This must be updated to match the nubmer of servers (possibly grabbed from TF)
# I am moving away from `system` jobs because of https://github.com/hashicorp/nomad/issues/12023
count = 3
network { network {
mode = "bridge" mode = "bridge"