summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Hwang <mhwang@research.att.com>2017-10-17 12:14:28 -0400
committerMichael Hwang <mhwang@research.att.com>2017-10-17 12:16:04 -0400
commit68b32f4862e0ce0909ce66c3f6718136988394b7 (patch)
tree08cb896180113f10a6d0496144516981eb116858
parentf76d9cb0268324188ffde8f2dd7298a0b92bcb79 (diff)
Add health checks for docker host and sch
Change-Id: I055d05e4c8475bd39077ce5df3834fd53641b322 Issue-Id: DCAEGEN2-142 Signed-off-by: Michael Hwang <mhwang@research.att.com>
-rw-r--r--blueprints/DockerBP.yaml-template15
-rw-r--r--blueprints/inventory.yaml-template6
2 files changed, 20 insertions, 1 deletions
diff --git a/blueprints/DockerBP.yaml-template b/blueprints/DockerBP.yaml-template
index a64525d..28f2180 100644
--- a/blueprints/DockerBP.yaml-template
+++ b/blueprints/DockerBP.yaml-template
@@ -132,6 +132,13 @@ inputs:
CONSUL_BIN_DIR=/opt/consul/bin
curl -Ss https://releases.hashicorp.com/consul/0.8.3/consul_0.8.3_linux_amd64.zip > $CONSUL_BIN_DIR/consul_0.8.3_linux_amd64.zip
unzip $CONSUL_BIN_DIR/consul_0.8.3_linux_amd64.zip -d $CONSUL_BIN_DIR
+ # NOTE: The health check for the docker host is a simple existence look up for
+ # registrator (name is hardcoded). It does not check if registrator is running.
+ # This would require a script health check which means we might need to turn on
+ # "enable_script_check".
+ # NOTE: At the time of this change, there is no issue but there could be a
+ # chicken-and-egg issue where the health check might depend upon future downstream
+ # nodes (registrator) that downstream node requires a *healthy* docker host.
cat <<EOF > /opt/consul/config/consul.json
{
"bind_addr" : "0.0.0.0",
@@ -156,7 +163,13 @@ inputs:
"name": "$REGNAME",
"address": "$MYPUB",
"port": 2376,
- "tags": $SERVICE_TAGS
+ "tags": $SERVICE_TAGS,
+ "checks": [
+ {
+ "http": "http://$MYPUB:2376/containers/registrator/json",
+ "interval": "30s"
+ }
+ ]
},
"node_meta": {
"fqdn": "$FQDN"
diff --git a/blueprints/inventory.yaml-template b/blueprints/inventory.yaml-template
index e0dbef6..7e209d9 100644
--- a/blueprints/inventory.yaml-template
+++ b/blueprints/inventory.yaml-template
@@ -83,6 +83,12 @@ node_templates:
isFilterInEmptyResources: false
dcaeInventoryClient:
uri: http://inventory:8080
+ docker_config:
+ healthcheck:
+ type: "docker"
+ interval: "30s"
+ timeout: "3s"
+ script: "/opt/health.sh"
image:
{ get_input: service_change_handler_image }
relationships: