open-nomad/client/allocrunner
Tim Gross 0f29dcc935
support script checks for task group services (#6197)
In Nomad prior to Consul Connect, all Consul checks work the same
except for Script checks. Because the Task being checked is running in
its own container namespaces, the check is executed by Nomad in the
Task's context. If the Script check passes, Nomad uses the TTL check
feature of Consul to update the check status. This means in order to
run a Script check, we need to know what Task to execute it in.

To support Consul Connect, we need Group Services, and these need to
be registered in Consul along with their checks. We could push the
Service down into the Task, but this doesn't work if someone wants to
associate a service with a task's ports, but do script checks in
another task in the allocation.

Because Nomad is handling the Script check and not Consul anyways,
this moves the script check handling into the task runner so that the
task runner can own the script check's configuration and
lifecycle. This will allow us to pass the group service check
configuration down into a task without associating the service itself
with the task.

When tasks are checked for script checks, we walk back through their
task group to see if there are script checks associated with the
task. If so, we'll spin off script check tasklets for them. The
group-level service and any restart behaviors it needs are entirely
encapsulated within the group service hook.
2019-09-03 15:09:04 -04:00
..
interfaces client: cleanup and document context uses 2019-03-12 15:03:54 -07:00
state stale allocation data leads to incorrect (and even negative) metrics (#5637) 2019-05-07 15:54:36 -04:00
taskrunner support script checks for task group services (#6197) 2019-09-03 15:09:04 -04:00
alloc_runner.go Write to client store while holding lock 2019-08-26 13:45:58 -04:00
alloc_runner_hooks.go connect: add unix socket to proxy grpc for envoy (#6232) 2019-09-03 08:43:38 -07:00
alloc_runner_test.go Don't persist allocs of destroyed alloc runners 2019-08-25 11:21:28 -04:00
alloc_runner_unix_test.go connect: register group services with Consul 2019-08-20 12:25:10 -07:00
allocdir_hook.go client: cleanup and document context uses 2019-03-12 15:03:54 -07:00
config.go client: do not restart dead tasks until server is contacted (try 2) 2019-05-14 10:53:27 -07:00
consulsock_hook.go connect: add unix socket to proxy grpc for envoy (#6232) 2019-09-03 08:43:38 -07:00
consulsock_hook_test.go connect: add unix socket to proxy grpc for envoy (#6232) 2019-09-03 08:43:38 -07:00
groupservice_hook.go connect: register group services with Consul 2019-08-20 12:25:10 -07:00
groupservice_hook_test.go connect: add unix socket to proxy grpc for envoy (#6232) 2019-09-03 08:43:38 -07:00
health_hook.go add default update stanza and max_parallel=0 disables deployments (#6191) 2019-09-02 10:30:09 -07:00
health_hook_test.go client: cleanup and document context uses 2019-03-12 15:03:54 -07:00
migrate_hook.go client: cleanup and document context uses 2019-03-12 15:03:54 -07:00
network_hook.go ar: plumb client config for networking into the network hook 2019-07-31 01:04:06 -04:00
network_hook_test.go ar: plumb client config for networking into the network hook 2019-07-31 01:04:06 -04:00
network_manager_linux.go ar: ensure network forwarding is allowed for bridged allocs (#6196) 2019-08-28 10:51:34 -04:00
network_manager_linux_test.go ar: rearrange network hook to support building on windows 2019-07-31 01:03:19 -04:00
network_manager_nonlinux.go ar: ensure network forwarding is allowed for bridged allocs (#6196) 2019-08-28 10:51:34 -04:00
networking.go ar: plumb client config for networking into the network hook 2019-07-31 01:04:06 -04:00
networking_bridge_linux.go ar: ensure network forwarding is allowed for bridged allocs (#6196) 2019-08-28 10:51:34 -04:00
testing.go client: do not restart dead tasks until server is contacted (try 2) 2019-05-14 10:53:27 -07:00
upstream_allocs_hook.go client: cleanup and document context uses 2019-03-12 15:03:54 -07:00
util.go allocrunnerv2 -> allocrunner 2018-10-16 16:56:56 -07:00