diff --git a/CHANGELOG.md b/CHANGELOG.md index d75e97038..863f7e2d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ IMPROVEMENTS: * client: Allow task's to be run as particular user [GH-950, GH-978] * client: `artifact` block now supports downloading paths relative to the task's directory [GH-944] + * discovery: Support script based health checks [GH-986] BUG FIXES: * core: Fix issue where in-place updated allocation double counted resources diff --git a/website/source/docs/jobspec/servicediscovery.html.md b/website/source/docs/jobspec/servicediscovery.html.md index 0a9d21b39..23680ad7e 100644 --- a/website/source/docs/jobspec/servicediscovery.html.md +++ b/website/source/docs/jobspec/servicediscovery.html.md @@ -75,6 +75,14 @@ group "database" { interval = "10s" timeout = "2s" } + check { + type = "script" + name = "check_table" + cmd = "/usr/local/bin/check_mysql_table_status" + args = ["--verbose"] + interval = "60s" + timeout = "5s" + } } resources { cpu = 500 @@ -111,8 +119,10 @@ group "database" { with Consul. * `check`: A check block defines a health check associated with the service. - Multiple check blocks are allowed for a service. Nomad currently supports - only the `http` and `tcp` Consul Checks. + Multiple check blocks are allowed for a service. Nomad supports the `script`, + `http` and `tcp` Consul Checks. Script checks are not supported for the qemu + driver since the Nomad client doesn't have access to the file system of a + tasks using the Qemu driver. ### Check Syntax @@ -134,8 +144,15 @@ group "database" { * `protocol`: This indicates the protocol for the http checks. Valid options are `http` and `https`. We default it to `http` +* `command`: This is the command that the Nomad client runs for doing script based + health check. + +* `args`: Additional arguments to the `command` for script based health checks. + ## Assumptions +* Consul 0.6.4 or later is needed for using the Script checks. + * Consul 0.6.0 or later is needed for using the TCP checks. * The service discovery feature in Nomad depends on operators making sure that