我的任务是预热在ECS上部署的Docker容器中运行的ASP.Net Core应用。似乎使用Kubernetes,我们可以定义一个就绪检查路径,Kubernetes将首先向其发送请求,并且仅在该请求完成后才开始发送实际流量。
ECS是否具有等效功能?
关于此问题的引用,但可以在Kubernetes中解决:
https://blog.markvincze.com/running-asp-net-core-in-auto-scaling-containers-warm-up/
最佳答案
从今年开始,ECS确实使用了Docker HEALTHCHECK。
从3月8日的公告(https://aws.amazon.com/about-aws/whats-new/2018/03/amazon-ecs-supports-container-health-checks-and-task-health-mana/):
Amazon ECS integrates with Docker container health checks to allow you to explicitly define and monitor the health of each container. Using the HEALTHCHECK command, you can define which parameters to monitor for each container in your Task Definition. Running tasks (groups of running containers) are now assigned a health status based on the health of their essential containers, and the task's health status is integrated with the ECS service scheduler to automatically redeploy unhealthy tasks and conduct rolling-updates of services. You can check the health status of your tasks and containers in the ECS Console or with the ECS DescribeTasks API.
如果ECS确定您的任务不正常,它将为您替换任务。如果您碰巧同时也在使用AWS LB,则可以将LB配置为也进行运行状况检查,以确保将流量路由到运行状况良好的节点。 ECS不像kubernetes那样区分活跃性和就绪性。它仅具有“健康”检查概念。
关于docker - 亚马逊弹性容器服务-与ECS等效的Kubernetes事件/就绪检查,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50692536/