Skip to content

Docker HealthCheck Broken #240

@akashgangil

Description

@akashgangil

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"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions