From 3c149e6fd698a33ede81b56668cb87ce9da07631 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Sat, 26 Mar 2016 13:02:30 -0700 Subject: [PATCH] Added docs for script checks --- CHANGELOG.md | 1 + .../docs/jobspec/servicediscovery.html.md | 21 ++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) 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 7585d1c47..486b7ca36 100644 --- a/website/source/docs/jobspec/servicediscovery.html.md +++ b/website/source/docs/jobspec/servicediscovery.html.md @@ -61,6 +61,14 @@ group "database" { interval = "10s" timeout = "2s" } + check { + type = "script" + name = "check_table" + cmd = "/usr/local/bin/check_mysql_table_status" + agrs = ["--verbose"] + interval = "60s" + timeout = "5s" + } } resources { cpu = 500 @@ -97,8 +105,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 @@ -120,9 +130,14 @@ group "database" { * `protocol`: This indicates the protocol for the http checks. Valid options are `http` and `https`. We default it to `http` +* `cmd`: This is the command that the Nomad client runs for doing script based + health check. + +* `args`: Additional arguments to the `cmd` for script based health checks. + ## Assumptions -* Consul 0.6.0 or later is needed for using the TCP checks. +* Consul 0.6.4 or later is needed for using the TCP checks. * The service discovery feature in Nomad depends on operators making sure that the Nomad client can reach the Consul agent.