A developer is designing a deployment strategy for a high-traffic microservice running on Amazon ECS (Fargate). The service has a desired count of 8 tasks. Due to strict vCPU and memory service quotas in the AWS region, the deployment process must never run more than the 8 desired tasks at any point during the update. Additionally, to handle baseline traffic and prevent downtime, at least 4 healthy tasks must remain in service throughout the deployment. Which deployment strategy and configuration should the developer choose to meet these requirements?
- An ECS rolling update with the minimum healthy percent set to 50% and the maximum percent set to 100%.Answer
- BAn ECS rolling update with the minimum healthy percent set to 100% and the maximum percent set to 150%.
- CAn AWS CodeDeploy Blue/Green deployment with a Canary traffic-shifting configuration.
- DAn ECS rolling update with the minimum healthy percent set to 0% and the maximum percent set to 100%.
Answer
An ECS rolling update with the minimum healthy percent set to 50% and the maximum percent set to 100%.
The correct strategy is a rolling update with the minimum healthy percent set to 50% and the maximum percent set to 100%. In Amazon ECS, setting the minimum healthy percent to 50% with a desired task count of 8 guarantees that at least 4 tasks (8 * 0.50) will remain running and healthy at all times during the deployment, preventing downtime. Setting the maximum percent to 100% restricts the total number of tasks to 8 (8 * 1.00), ensuring the service never exceeds the desired task count and respects the strict resource quotas. ECS will stop 4 old tasks first to make room under the 100% limit, start 4 new tasks, wait for them to become healthy, and then repeat the process for the remaining tasks.
Step-by-Step Solution
Key Concept
Configuring rolling update parameters (minimumHealthyPercent and maximumPercent) in Amazon ECS to control deployment capacity limits and maintain service availability.
Estimated Time:2m 0s