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

[ECS] [request]: Take Docker image HEALTHCHECK into account when available #1041

Open
michaelwittig opened this issue Aug 18, 2020 · 7 comments
Labels
ECS Amazon Elastic Container Service Fargate AWS Fargate Proposed Community submitted issue

Comments

@michaelwittig
Copy link

michaelwittig commented Aug 18, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Tell us about your request
Use the HEALTHCHECK defined in the Docker image instead of forcing us to repeat ourself and add the same information to the task definition once again.

Which service(s) is this request for?
Fargate, ECS

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
In my Dockerfile, I have configured a HEALTHCHECK. Unfortunately, ECS doesn't pick up this information. I see that the healtchecks are performed in the container logs but ECS does not seem to fetch this information. It would be so much easier if ECS would just use the information that is already available.

Are you currently working around this issue?
I just don't use healthchecks. Configuring them in CloudFormation for 3 containers with parameters is just crazy (15 parameters needed out of 60 available...).

@michaelwittig michaelwittig added the Proposed Community submitted issue label Aug 18, 2020
@mwarkentin
Copy link

@michaelwittig
Copy link
Author

@mwarkentin It is only supported if you define the healthcheck in the container definition. This feature request is about supporting it without repeating the healthcheck definition that Docker already knows about.

@mwarkentin
Copy link

Ah, thanks - didn't realize that.

@joebowbeer
Copy link
Contributor

joebowbeer commented Aug 22, 2020

Not an issue. See #1443 (comment)

I think the "right" thing to do is for users to remove HEALTHCHECKs from their Dockerfiles and move them to docker-compose and ECS task defs as needed:

https://nickjanetakis.com/blog/docker-tip-85-define-healthcheck-in-your-docker-compose-file

The Dockerfile HEALTHCHECK (which was added for Swarm) is automatically disabled in Kubernetes since v1.8:

kubernetes/kubernetes#50703

AWS added the ECS_DISABLE_DOCKER_HEALTH_CHECK parameter to optionally disable this in ECS:

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html

I suggest removing HEALTHCHECKs from Dockerfiles. Failing that, add ECS_DISABLE_DOCKER_HEALTH_CHECK to the ECS task defs to prevent the useless Dockerfile HEALTHCHECKs from running.

@kduvzc
Copy link

kduvzc commented Nov 23, 2021

This issue is more than a year old. Will it ever be tackled?

@npassaro
Copy link

@joebowbeer I know that the issue is old but I did not follow your response.

ECS supposedly supports it by default but doesn't actually show it on the interface so it seems to me it is a bug, or am I missing a lot of somethings? 😄 I think it is really a useful tool and if your deployment needs a different approach you can override the command by the underlying platform (ECS, K8s, etc).

@joebowbeer
Copy link
Contributor

joebowbeer commented Nov 10, 2022

@npassaro I'm saying that this is a misfeature that does not have legs. It doesn't make sense for ECS to improve support for a feature that is for all practical purposes deprecated. That's my view considering EKS and Kubernetes in addition to ECS.

I assume that containerd and other CRI runtimes ignore this healthcheck as well.

According to one respondent, this assumption is correct.

@ollypom ollypom added Fargate AWS Fargate ECS Amazon Elastic Container Service labels Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ECS Amazon Elastic Container Service Fargate AWS Fargate Proposed Community submitted issue
Projects
None yet
Development

No branches or pull requests

6 participants