wikier wikier - 10 days ago 7
HTTP Question

How to use a HTTP HEAD request as health check for Marathon?

Look like the protocols

HTTP
or
MESOS_HTTP
only do
GET
request.

This works:

"healthChecks": [
{
"protocol": "COMMAND",
"command": "curl -I http://0.0.0.0:5000/",
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
}
],


But I found it to much for such simple tasks... I would expect something simpler, something like
"method":"HEAD"
:

"healthChecks": [
{
"protocol": "HTTP",
"path": "/",
"portIndex": 5000,
"method": "HEAD",
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
}
],

Answer

If you need/want HTTP HEAD based health checks then COMMAND-based are your only option. The HTTP-based support GET only. See also the Marathon docs for more details.