Is it possible to disable healthcheck for a specific app
Opened this issue · 4 comments
Hello,
I am aware of the -H --health-check
option but I am looking for a way to disable health check for specific apps, I guess it should be possible using a proper HAPROXY_0_BACKEND_HTTP_HEALTHCHECK_OPTIONS
label but I cannot find a hint on how to achieve that in the documentation.
Sorry if the question has already been asked somewhere.
Thank you in advance.
@soualid Simply omit the healthChecks
parameter from your Marathon app's definition?
@paambaati I can't because I need marathon to keep restarting the application if its health check fails maxConsecutiveFailures
times, but actually, using marathon-lb in sse
mode remove the application from the haproxy configuration at the first failure (when the application switch to an Unhealthy
state while it is still running and available).
It could be useful to make this behavior configurable, not sure it is actually feasible without hard coding the ports configuration in marathon as well as in the HAPROXY_HEAD
file of marathon-lb.
@soualid See this: https://github.com/mesosphere/marathon-lb/blob/master/Longhelp.md#haproxy_backend_server_options
So, use template like:
"labels": {
"HAPROXY_0_BACKEND_SERVER_OPTIONS": " server {serverName} {host_ipv4}:{port}{cookieOptions}{otherOptions}\n"
}
Above template don't make healthcheck option for the haproxy in marathon-lb.
Thank you @minyk but I think it will not work when using the sse
mode that will remove the backend totally from the haproxy configuration if no healthy backend is available.
In fact, I would like to have a flag that make marathon-lb keep unhealthy backend in the haproxy configuration.
It would be especially useful for single instance applications, which are actually made inaccessible by marathon-lb immediately when a healthcheck fails, even if the maxConsecutiveFailures
is greater than 1 for this application definition in marathon.