Merge pull request #14559 from hashicorp/docs-nsd-check-watcher
docs: add documentation for nomad service check restarts
This commit is contained in:
commit
afc815c0c7
|
@ -63,8 +63,7 @@ job "example" {
|
||||||
- `args` `(array<string>: [])` - Specifies additional arguments to the
|
- `args` `(array<string>: [])` - Specifies additional arguments to the
|
||||||
`command`. This only applies to script-based health checks.
|
`command`. This only applies to script-based health checks.
|
||||||
|
|
||||||
- `check_restart` - See [`check_restart` stanza][check_restart_stanza]. Only
|
- `check_restart` - See [`check_restart` stanza][check_restart_stanza].
|
||||||
supported in the Consul service provider.
|
|
||||||
|
|
||||||
- `command` `(string: <varies>)` - Specifies the command to run for performing
|
- `command` `(string: <varies>)` - Specifies the command to run for performing
|
||||||
the health check. The script must exit: 0 for passing, 1 for warning, or any
|
the health check. The script must exit: 0 for passing, 1 for warning, or any
|
||||||
|
|
|
@ -15,14 +15,13 @@ description: |-
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
As of Nomad 0.7 the `check_restart` stanza instructs Nomad when to restart
|
The `check_restart` stanza instructs Nomad when to restart tasks with unhealthy
|
||||||
tasks with unhealthy service checks. When a health check in Consul has been
|
service checks. When a health check in Nomad or Consul has been unhealthy for the `limit`
|
||||||
unhealthy for the `limit` specified in a `check_restart` stanza, it is
|
specified in a `check_restart` stanza, it is restarted according to the task group's
|
||||||
restarted according to the task group's [`restart` policy][restart_stanza]. The
|
[`restart` policy][restart_stanza]. The `check_restart` settings apply to
|
||||||
`check_restart` settings apply to [`check`s][check_stanza], but may also be
|
[`check`s][check_stanza], but may also be placed on [`service`s][service_stanza]
|
||||||
placed on [`service`s][service_stanza] to apply to all checks on a service.
|
to apply to all checks on a service. If `check_restart` is set on both the check
|
||||||
If `check_restart` is set on both the check and service, the stanzas are
|
and service, the stanzas are merged with the check values taking precedence.
|
||||||
merged with the check values taking precedence.
|
|
||||||
|
|
||||||
```hcl
|
```hcl
|
||||||
job "mysql" {
|
job "mysql" {
|
||||||
|
@ -78,7 +77,9 @@ job "mysql" {
|
||||||
before checking its health.
|
before checking its health.
|
||||||
|
|
||||||
- `ignore_warnings` `(bool: false)` - By default checks with both `critical`
|
- `ignore_warnings` `(bool: false)` - By default checks with both `critical`
|
||||||
and `warning` statuses are considered unhealthy. Setting `ignore_warnings = true` treats a `warning` status like `passing` and will not trigger a restart.
|
and `warning` statuses are considered unhealthy. Setting `ignore_warnings = true`
|
||||||
|
treats a `warning` status like `passing` and will not trigger a restart. Only
|
||||||
|
available in the Consul service provider.
|
||||||
|
|
||||||
## Example Behavior
|
## Example Behavior
|
||||||
|
|
||||||
|
@ -102,8 +103,9 @@ check_restart {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
After the grace period if the script check fails, it has 180 seconds (`60s interval * 3 limit`) to pass before a restart is triggered. Once a restart is
|
After the grace period if the script check fails, it has 180 seconds (`60s interval * 3 limit`)
|
||||||
triggered the task group's [`restart` policy][restart_stanza] takes control:
|
to pass before a restart is triggered. Once a restart is triggered the task group's
|
||||||
|
[`restart` policy][restart_stanza] takes control:
|
||||||
|
|
||||||
```hcl
|
```hcl
|
||||||
restart {
|
restart {
|
||||||
|
|
Loading…
Reference in New Issue