Consul: Local health endpoint

Created on 9 Nov 2016  路  5Comments  路  Source: hashicorp/consul

I want to use Consul to provide healthchecks for Amazon ELBs. Basically, I wanted to set the ELB healthcheck to query an instance's health by hitting some Consul HTTP endpoint. The /v1/agent endpoint seems close to what I want, but there doesn't seem to be a /v1/agent/service/<service_id>/health endpoint. Does such an endpoint exist (maybe I am looking in the wrong place)?

themhealth-checks typenhancement

Most helpful comment

We would definitely be interested by having /v1/agent/service/<service id>/health return 200, 429 or 500.

That would allow to configure complex checks on consul side and expose a very simple interface for our loadbalancer (which would delegate healthchecks to consul).

All 5 comments

Hi @joshuaspence we don't currently have an agent-level endpoint to pull the health of an agent. There's https://www.consul.io/docs/agent/http/health.html#health_node but that'll end up going up to the Consul servers, and the HTTP status code doesn't indicate the state of the health checks. This looks like a possible dup of https://github.com/hashicorp/consul/issues/1468.

+1
How can I use consul with an ELB? I want to have the elb take out the instance if I put it in maintenance mode.

Would the upstream be interested in a pull request for this functionality?

We would definitely be interested by having /v1/agent/service/<service id>/health return 200, 429 or 500.

That would allow to configure complex checks on consul side and expose a very simple interface for our loadbalancer (which would delegate healthchecks to consul).

@joshuaspence
I wanted the same functionality, so I developed a sidecar that can be used to accomplish this: Consulate. The first version is done and I'm testing it in my dev environment this week. Would love any feedback!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

powerman picture powerman  路  3Comments

eshujiushiwo picture eshujiushiwo  路  3Comments

lmb picture lmb  路  4Comments

wing731 picture wing731  路  3Comments

atomantic picture atomantic  路  4Comments