Health Check
A health_check
stanza allows the definition of a health check which must pass before the container is marked as successfully created. There are three different types of healthcheck http
, tcp
, and exec
, these are not mutually exclusive, it is possible to define more than one health check.
Health checks are executed sequentially, if one health check fails, the following checks are not executed. The execution order is http
, tcp
, exec
.
Attributes
Attributes are the properties of a resource that can be used to configure it.
Timeout timeout
required
string
The maximum duration to wait before marking the health check as failed. Expressed as a Go duration, e.g. `1s` = 1 second, `100ms` = 100 milliseconds.
HTTP Health Check block defining the address to check and expected status codes.
Can be specified more than once.
TCP Health Check block defining the address to test.
Can be specified more than once.
Exec Health Check block defining either a command to run in the current container, or a script to execute.
Can be specified more than once.
Computed Attributes
These attributes are computed when the config is parsed and applied, and are therefor only known at parsetime or runtime.
Meta ID meta.id
string
The full ID of the resource e.g. `resource.type.name`. This is computed from the full resource path:
Meta Type meta.type
string
The type of the resource. This taken from the type label of the resource definition.
Meta Name meta.name
string
The name of the resource. This taken from the name label of the resource definition.
Examples
Last updated