From 3c149e6fd698a33ede81b56668cb87ce9da07631 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Sat, 26 Mar 2016 13:02:30 -0700 Subject: [PATCH 1/3] 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. From 77a244b80d7bacb8dc8fd238240e2c70e9513fd9 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Mon, 28 Mar 2016 10:06:44 -0700 Subject: [PATCH 2/3] Corrected docs --- website/source/docs/jobspec/servicediscovery.html.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/website/source/docs/jobspec/servicediscovery.html.md b/website/source/docs/jobspec/servicediscovery.html.md index 486b7ca36..ff12a4557 100644 --- a/website/source/docs/jobspec/servicediscovery.html.md +++ b/website/source/docs/jobspec/servicediscovery.html.md @@ -65,7 +65,7 @@ group "database" { type = "script" name = "check_table" cmd = "/usr/local/bin/check_mysql_table_status" - agrs = ["--verbose"] + args = ["--verbose"] interval = "60s" timeout = "5s" } @@ -137,7 +137,9 @@ group "database" { ## Assumptions -* Consul 0.6.4 or later is needed for using the TCP checks. +* 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 the Nomad client can reach the Consul agent. From e52cb8e65c5e90a61eb2a0a31ca98da33202520d Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Mon, 28 Mar 2016 14:25:15 -0700 Subject: [PATCH 3/3] Updated docs --- website/source/docs/jobspec/servicediscovery.html.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/source/docs/jobspec/servicediscovery.html.md b/website/source/docs/jobspec/servicediscovery.html.md index ff12a4557..38067cb88 100644 --- a/website/source/docs/jobspec/servicediscovery.html.md +++ b/website/source/docs/jobspec/servicediscovery.html.md @@ -130,10 +130,10 @@ 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 +* `command`: 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. +* `args`: Additional arguments to the `command` for script based health checks. ## Assumptions