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

Docker HealthCheck Broken #240

Open
akashgangil opened this issue May 31, 2017 · 1 comment
Open

Docker HealthCheck Broken #240

akashgangil opened this issue May 31, 2017 · 1 comment

Comments

@akashgangil
Copy link

akashgangil commented May 31, 2017

For healthchecks that specify "COMMAND" protocol in marathon, the healthcheck command is executed inside the docker container. (when using docker conatinerizer). So marathon-consul should map it to a "Docker check" instead of "Script check" in consul. The former executes the command inside the docker container while the later executes it on the host.

We need to add the docker container id in the body when making the request to consul and the shell.

Script Check:

{
  "check": {
    "id": "mem-util",
    "name": "Memory utilization",
    "script": "/usr/local/bin/check_mem.py",
    "interval": "10s",
    "timeout": "1s"
  }
}

Docker Check:

{
"check": {
    "id": "mem-util",
    "name": "Memory utilization",
    "docker_container_id": "f972c95ebf0e",
    "shell": "/bin/bash",
    "script": "/usr/local/bin/check_mem.py",
    "interval": "10s"
  }
}
@janisz
Copy link
Contributor

janisz commented May 31, 2017

I'd love to support Docker Check but I think it's not possible right now. There is no mapping between Marathon Task ID and Docker container ID. Docker images could be run by Mesos Contenerizer and this check will fail so this mapping should be optional or in case Mesos Containerizer use mesos attach/exec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants