I tried very hard to configure canary deploy to AmazonECS/Fargate. This is how I implemented this.
Full version of the deploy script is here. HiromuMasuda/ecs-deploy
App Architecture on ECS
Main app is DSP, and datadog and flume are run with DSP. Request from SSP goes to ELB and is distributed to DSPs in three tasks.
About Deployment
Deploy flow is shown below. First, do canary deploy to check whether the latest version of image works well.
Canary Deploy
- Build latest image from Dockerfile.
- Push the image to ECR with timestamp and git commit hash tags.
- Make new revision of task definition with the image.
- Run one task with the task definition. This task is separated from service.
- Add the private IP of the task to target group.
Canary Rollback
- Stop and destroy the canary deployed task.
- Remove the IP from target group.
Deploy
- Update service using the latest revision of task definition.
- Stop and destroy the canary deployed task.
- Remove the IP from target group.
Rollback
- Update service using the previous revision of task definition.
Top comments (0)