diff options
author | 2021-03-06 21:03:37 +0000 | |
---|---|---|
committer | 2021-03-08 08:50:35 +0000 | |
commit | 9481aad815189d6251d36c11e3f901f9179dab40 (patch) | |
tree | 1107071085d49cf8da9021ebdd5944b130ce3cf5 /terraform-ci-infra/1n_nmd/minio | |
parent | 25b6f92f64abf9478a6bf9de81494d90402f8919 (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/minio')
-rw-r--r-- | terraform-ci-infra/1n_nmd/minio/conf/nomad/minio.hcl | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/terraform-ci-infra/1n_nmd/minio/conf/nomad/minio.hcl b/terraform-ci-infra/1n_nmd/minio/conf/nomad/minio.hcl index a2df44f666..3889b51a9f 100644 --- a/terraform-ci-infra/1n_nmd/minio/conf/nomad/minio.hcl +++ b/terraform-ci-infra/1n_nmd/minio/conf/nomad/minio.hcl @@ -12,9 +12,7 @@ job "${job_name}" { # "service". For a full list of job types and their differences, please see # the online documentation. # - # For more information, please see the online documentation at: - # - # https://www.nomadproject.io/docs/jobspec/schedulers.html + # https://www.nomadproject.io/docs/jobspec/schedulers # type = "service" @@ -81,32 +79,38 @@ job "${job_name}" { # the same Nomad client. Any task within a group will be placed on the same # client. # - # For more information and examples on the "group" stanza, please see - # the online documentation at: - # - # https://www.nomadproject.io/docs/job-specification/group.html + # https://www.nomadproject.io/docs/job-specification/group # group "prod-group1-minio" { # The "count" parameter specifies the number of the task groups that should # be running under this group. This value must be non-negative and defaults # to 1. - count = ${group_count} + count = ${group_count} # https://www.nomadproject.io/docs/job-specification/volume %{ if use_host_volume } volume "prod-volume1-minio" { - type = "host" - read_only = false - source = "${host_volume}" + type = "host" + read_only = false + source = "${host_volume}" } %{ endif } + # 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 "task" stanza creates an individual unit of work, such as a Docker # container, web application, or batch processing. # - # For more information and examples on the "task" stanza, please see - # the online documentation at: - # # https://www.nomadproject.io/docs/job-specification/task.html # task "prod-task1-minio" { @@ -134,7 +138,7 @@ job "${job_name}" { # documentation for more information. config { image = "${image}" - dns_servers = [ "$${attr.unique.network.ip-address}" ] + dns_servers = [ "172.17.0.1" ] network_mode = "host" command = "server" args = [ "${host}:${port}${data_dir}" ] @@ -161,10 +165,7 @@ job "${job_name}" { # The service stanza instructs Nomad to register a service with Consul. # - # For more information and examples on the "task" stanza, please see - # the online documentation at: - # - # https://www.nomadproject.io/docs/job-specification/service.html + # https://www.nomadproject.io/docs/job-specification/service # service { name = "${service_name}" @@ -197,10 +198,7 @@ job "${job_name}" { # This ensures the task will execute on a machine that contains enough # resource capacity. # - # For more information and examples on the "resources" stanza, please see - # the online documentation at: - # - # https://www.nomadproject.io/docs/job-specification/resources.html + # https://www.nomadproject.io/docs/job-specification/resources # resources { cpu = ${cpu} @@ -212,10 +210,7 @@ job "${job_name}" { # your job will be provisioned on, Nomad will provide your tasks with # network configuration when they start up. # - # For more information and examples on the "template" stanza, please see - # the online documentation at: - # - # https://www.nomadproject.io/docs/job-specification/network.html + # https://www.nomadproject.io/docs/job-specification/network # network { port "http" { |