2. What is ECS?
⊙ Container service compatible with Docker (similar to
Kubernetes).
⊙ Docker image hosting (similar to Docker Hub).
⊙ Container auto-recovery, load balancing, deployments,
monitoring, and logging.
16. New Feature Workflow
1. docker build -t avow-ui .
2. docker run -P -d -t avow-ui
3. Test and debug
5. aws ecr get-login --region
us-east-1
6. Docker tag avow-ui:latest
123.dkr.ecr.us-east-1.amazonaws.co
m/avow-ui:latest
7. Docker push
123.dkr.ecr.us-east-1.amazonaws.co
m/avow-ui:latest
Local ECS
4. Create a new task revision
8. Update service task definition
9. Automatic rolling deployment
17. New ECS Cluster Gotcha
⊙ Only applicable if you’re not using the first-run wizard or if you
already have an ELB or ASG in place.
⊙ The ASG of EC2 hosts that run the containers do not know what
ECS cluster they belong to.
⊙ Forced to add this to the ASG user data:
#!/usr/bin/env bash
echo ECS_CLUSTER=avow >> /etc/ecs/ecs.config
*http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html
18. Limitations of ECS/ELB: Port Mapping
⊙ Currently port mapping is one-to-one from ELB to ECS.
⊙ Ideally ECS would bind each task to a random port and do the
mapping automatically for you (essentially service discovery).
19. Limitations of ECS: Scale Tasks
⊙ Before May 18, 2016 you could automatically scale the number
of nodes in your ECS cluster, but could not scale the number of
tasks on a container.
⊙ Now you can scale based upon CloudWatch metrics in a single-
or multi-availability zone.
20. Hindsight is 20/20
⊙ If you’re hosting static files do so on S3 with CloudFront.
⊙ They are incredibly cheap, scale seamlessly, and your content is
edge cached (although invalidation, proper cache busting, and
rolling back changes are a nuisance).
⊙ If SSL is necessary do not purchase a static IP for S3
($600/month), but rather install an SSL cert (free through AWS
Cert Manager) on your CloudFront distribution.