Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple health checks per service #245

Closed
tgross opened this issue Nov 17, 2016 · 4 comments
Closed

Allow multiple health checks per service #245

tgross opened this issue Nov 17, 2016 · 4 comments

Comments

@tgross
Copy link
Contributor

tgross commented Nov 17, 2016

We've had a few folks request the ability to have multiple health checks for a single service. In order to accomplish this, we'd need to separate the service definition from the health check. We'll make the following changes:

  • ContainerPilot maintains state for all services, which can be either HEALTHY or UNHEALTHY
  • a service in a HEALTHY will heartbeat to discovery every heartbeat seconds with a TTL of ttl.
  • a health check will poll every poll seconds, with a timeout of timeout. If any health check fails, the associated service is marked UNHEALTHY and a Fail message is sent to the discovery service
  • If any subsequent health check fails, the associated service is marked HEALTHY and a Pass message is sent to the discovery service.

The proposed configuration would be as follows. (Note this uses the new HCL syntax from #236 (comment)).

service "app" {
    port = 80
    tll = 10
    heartbeat = 3
}

health {
    service = "app"
    check = "/usr/bin/curl --fail -s -o /dev/null http://localhost/app"
    poll = 5
    timeout = "5s"
}
@fitz123
Copy link

fitz123 commented Nov 18, 2016

So you finally succumb to it)
Ok, will brake down big health scripts into small checks right into CP config file. At least it requires less files to be opened in an editor)

@tgross tgross self-assigned this Feb 28, 2017
@tgross tgross added the open PR label Mar 7, 2017
@tgross
Copy link
Contributor Author

tgross commented Mar 23, 2017

Partially released in https://github.com/joyent/containerpilot/releases/tag/3.0.0-dev.1. The configuration syntax changes to support it are coming next. Refer to RFD86 and the v3 roadmap in #283 for details.

@tgross tgross removed the open PR label Mar 23, 2017
@tgross
Copy link
Contributor Author

tgross commented Apr 7, 2017

Implemented in #316

@tgross tgross added the open PR label Apr 7, 2017
@tgross
Copy link
Contributor Author

tgross commented Apr 7, 2017

This feature has undergone some internal review and we've decided to cut it, as the semantics of multiple health checks for a service don't really make sense given that we can only report to Consul once.

@tgross tgross closed this as completed Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants