Skip to content

Commit

Permalink
fix(fabio,promtail): ensure system jobs are restarted (#11)
Browse files Browse the repository at this point in the history
Signed-off-by: Bruce Becker <[email protected]>
  • Loading branch information
brucellino authored Jul 11, 2022
1 parent 5ed3c0e commit d78262d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
6 changes: 6 additions & 0 deletions fabio.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ job "fabio" {
static = 9998
}
}
restart {
attempts = 3
interval = "10m"
delay = "15s"
mode = "delay"
}

task "fabio" {
artifact {
Expand Down
17 changes: 5 additions & 12 deletions promtail.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
# https://www.nomadproject.io/docs/job-specification/job
#
job "promtail" {

meta {
auto-backup = true
backup-schedule = "@daily"
backup-target-db = "postgres"
}
datacenters = ["dc1"]
type = "system"

constraint {
attribute = "${node.class}"
operator = "regexp"
Expand Down Expand Up @@ -49,19 +51,10 @@ job "promtail" {
}

restart {
# The number of attempts to run the job within the specified interval.
attempts = 2
interval = "30m"

# The "delay" parameter specifies the duration to wait before restarting
# a task after it has failed.
attempts = 3
interval = "10m"
delay = "15s"

# The "mode" parameter controls what happens when a task has restarted
# "attempts" times within the interval. "delay" mode delays the next
# restart until the next interval. "fail" mode does not restart the task
# if "attempts" has been hit within the interval.
mode = "fail"
mode = "delay"
}

ephemeral_disk {
Expand Down

0 comments on commit d78262d

Please sign in to comment.