aboutsummaryrefslogtreecommitdiffstats
path: root/terraform-ci-infra/1n_nmd/alertmanager/conf/nomad
diff options
context:
space:
mode:
authorpmikus <pmikus@cisco.com>2021-03-06 21:03:37 +0000
committerPeter Mikus <pmikus@cisco.com>2021-03-08 08:50:35 +0000
commit9481aad815189d6251d36c11e3f901f9179dab40 (patch)
tree1107071085d49cf8da9021ebdd5944b130ce3cf5 /terraform-ci-infra/1n_nmd/alertmanager/conf/nomad
parent25b6f92f64abf9478a6bf9de81494d90402f8919 (diff)
Infra: Add reschedule policy
Add rechedule policy to jobs so in case of failure they will respawn in a endless loop Signed-off-by: pmikus <pmikus@cisco.com> Change-Id: I15698d9e147644e68bec549fc53474d421b25d9a
Diffstat (limited to 'terraform-ci-infra/1n_nmd/alertmanager/conf/nomad')
-rw-r--r--terraform-ci-infra/1n_nmd/alertmanager/conf/nomad/alertmanager.hcl23
1 files changed, 23 insertions, 0 deletions
diff --git a/terraform-ci-infra/1n_nmd/alertmanager/conf/nomad/alertmanager.hcl b/terraform-ci-infra/1n_nmd/alertmanager/conf/nomad/alertmanager.hcl
index 40d84e337a..6b0d669d0e 100644
--- a/terraform-ci-infra/1n_nmd/alertmanager/conf/nomad/alertmanager.hcl
+++ b/terraform-ci-infra/1n_nmd/alertmanager/conf/nomad/alertmanager.hcl
@@ -71,6 +71,17 @@ job "${job_name}" {
%{ endif }
}
+ # The reschedule stanza specifies the group's rescheduling strategy. If
+ # specified at the job level, the configuration will apply to all groups
+ # within the job. If the reschedule stanza is present on both the job and the
+ # group, they are merged with the group stanza taking the highest precedence
+ # and then the job.
+ reschedule {
+ delay = "30s"
+ delay_function = "constant"
+ unlimited = true
+ }
+
# The "group" stanza defines a series of tasks that should be co-located on
# the same Nomad client. Any task within a group will be placed on the same
# client.
@@ -86,6 +97,18 @@ job "${job_name}" {
# to 1.
count = ${group_count}
+ # The restart stanza configures a tasks's behavior on task failure. Restarts
+ # happen on the client that is running the task.
+ #
+ # https://www.nomadproject.io/docs/job-specification/restart
+ #
+ restart {
+ interval = "30m"
+ attempts = 40
+ delay = "15s"
+ mode = "delay"
+ }
+
# The constraint allows restricting the set of eligible nodes. Constraints
# may filter on attributes or client metadata.
#