Skip to content

Commit f8a04d1

Browse files
hc-github-team-nomad-coretgrossaimeeu
authored
Backport of docs: expand check.address_mode to show valid values (#26920) (#26926)
The documentation for the health check `address_mode` field refers back to the service `address_mode` field for valid values, but this is somewhat misleading. Checks don't support the `"auto"` mode, and although this is mentioned in the text it's easy to miss or forget once you've clicked away to the service docs. The text of the service `address_mode` options also specifically refers to advertisement, which is typically going to be what a user is trying to avoid when setting the check to a non-default mode. And the `check.address_mode` text refers to both `service.address` and `service.address_mode` in such a way that it can be confused as a typo. Bring over the valid mode descriptions from services and clean them up to refer to the checks and not advertisement in this context. Ref: #26900 Co-authored-by: Tim Gross <[email protected]> Co-authored-by: Aimee Ukasick <[email protected]>
1 parent cc3f72c commit f8a04d1

File tree

1 file changed

+32
-8
lines changed
  • website/content/docs/job-specification

1 file changed

+32
-8
lines changed

website/content/docs/job-specification/check.mdx

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,37 @@ job "example" {
5151

5252
### `check` Parameters
5353

54-
- `address_mode` `(string: "host")` - Same as `address_mode` on `service`.
55-
Unlike services, checks do not have an `auto` address mode as there's no way
56-
for Nomad to know which is the best address to use for checks. Consul needs
57-
access to the address for any HTTP or TCP checks. See
58-
[below for details.](#using-driver-address-mode) Unlike `port`, this setting
59-
is _not_ inherited from the `service`.
60-
If the service `address` is set and the check `address_mode` is not set, the
61-
service `address` value will be used for the check address.
54+
- `address_mode` `(string: "host")` - Specifies which address (host, alloc,
55+
alloc IPv6 or driver-specific) this service should use to make checks, similar
56+
to `address_mode` on `service`. When the service uses the Consul provider,
57+
Consul needs access to the address for any HTTP or TCP checks. Unlike `port`,
58+
this setting is **not** inherited from the `service`. If the service `address`
59+
is set, the service `address_mode` is `"auto"`, and the check `address_mode`
60+
is not set, Nomad uses the service `address` value for the check address.
61+
62+
Valid options are:
63+
64+
- `alloc` - For allocations which create a network namespace, this address
65+
mode uses the IP address inside the namespace. Use only with "bridge" and
66+
"cni" [networking modes][network_mode]. You may specify a numeric port for
67+
situations where no port mapping is necessary. Set this mode only for checks
68+
which are defined in a "group" service block.
69+
70+
- `alloc_ipv6` - Same as `alloc` but use the IPv6 address in case of
71+
dual-stack or IPv6-only.
72+
73+
- `driver` - Use the IP specified by the driver, and the port specified in a
74+
port map. You may specify a numeric port since port maps aren't required by
75+
all network plugins. Useful for checking SDN and overlay network addresses.
76+
Task fails if driver network cannot be determined. Only implemented for
77+
Docker. Set this mode only for checks which are defined in a "task" service
78+
block. Refer to [Using driver address
79+
mode](/nomad/docs/job-specification/service#using-driver-address-mode) for
80+
an example of use.
81+
82+
- `host` - Use the host IP and the exposed port.
83+
84+
Note there is no `"auto"` mode for checks, unlike services.
6285

6386
- `args` `(array<string>: [])` - Specifies additional arguments to the
6487
`command`. This only applies to script-based health checks.
@@ -475,3 +498,4 @@ Output = nomad: Get "http://:9999/": dial tcp :9999: connect: connection re
475498
[service]: /nomad/docs/job-specification/service
476499
[service_task]: /nomad/docs/job-specification/service#task-1
477500
[on_update]: /nomad/docs/job-specification/service#on_update
501+
[network_mode]: /nomad/docs/job-specification/network#mode

0 commit comments

Comments
 (0)