Merge pull request #3718 from hashicorp/b-3713-fix-check-restart

Fix service.check_restart stanza propagation
This commit is contained in:
Michael Schurter
2018-01-16 16:39:42 -08:00
committed by GitHub
8 changed files with 153 additions and 12 deletions

View File

@@ -10,6 +10,12 @@ description: |-
# `check_restart` Stanza
<table class="table table-bordered table-striped">
<tr>
<th width="120">Placement</th>
<td>
<code>job -> group -> task -> service -> **check_restart**</code>
</td>
</tr>
<tr>
<th width="120">Placement</th>
<td>
@@ -22,7 +28,10 @@ As of Nomad 0.7 the `check_restart` stanza instructs Nomad when to restart
tasks with unhealthy service checks. When a health check in Consul has been
unhealthy for the `limit` specified in a `check_restart` stanza, it is
restarted according to the task group's [`restart` policy][restart_stanza]. The
`check_restart` settings apply to [`check`s][check_stanza].
`check_restart` settings apply to [`check`s][check_stanza], but may also be
placed on [`service`s][service_stanza] to apply to all checks on a service.
If `check_restart` is set on both the check and service, the stanzas are
merged with the check values taking precedence.
```hcl
job "mysql" {
@@ -140,3 +149,4 @@ details.
[check_stanza]: /docs/job-specification/service.html#check-parameters "check stanza"
[restart_stanza]: /docs/job-specification/restart.html "restart stanza"
[service_stanza]: /docs/job-specification/service.html "service stanza"