aws / containers-roadmap

This is the public roadmap for AWS container services (ECS, ECR, Fargate, and EKS).
https://aws.amazon.com/about-aws/whats-new/containers/
Other
5.21k stars 319 forks source link

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

Open michaelwittig opened 4 years ago

michaelwittig commented 4 years ago

Community Note

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...).

mwarkentin commented 4 years ago

Isn't this supported per https://aws.amazon.com/about-aws/whats-new/2018/03/amazon-ecs-supports-container-health-checks-and-task-health-mana/

michaelwittig commented 4 years ago

@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 commented 4 years ago

Ah, thanks - didn't realize that.

joebowbeer commented 4 years ago

Not an issue. See https://github.com/aws/containers-roadmap/issues/1443#issuecomment-882124085

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:

https://github.com/kubernetes/kubernetes/issues/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 commented 2 years ago

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

npassaro commented 1 year ago

@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 commented 1 year ago

@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.