Containers on AWS: ECS, Fargate, ECR & EKS Flashcards
Amazon ECS - EC2 Launch Type
Elastic Container Service
Launch docker containers on AWS
= Launch ECS Tasks on ECS clusters
EC2 Launch Type - Provision & maintain the infrastructure (EC2 instances)
Each EC2 instance needs ECS agent to register in the ECS cluster
AWS starts/stops containers
ECS Architecture - EC2 Launch Type
ECS Cluster -> EC2 instances -> ECS Agent in instances -> each new container is placed in EC2 instance
ECS - Fargate Launch Type
Launch docker containers on AWS
No provisioning infrastructure
Serverless
Just create task definitions
AWS runs ECS Tasks for you based on CPU / RAM you need
To scale - increase number of tasks
ECS - IAM Roles for ECS
EC2 instance profile (EC2 launch type only)
- used by ECS
- makes API calls to ECS
- send container logs to CLoudWatch
- pull docker image from ECR
- reference sensitive data in secrets manager or SSM parameter store.
ECS Task Role
- allows each task to have specific role
- use different roles for different ECS Services you run
ECS Load Balancer Integrations
ALB in front of the ECS Cluster which holds EC2 instances
Which Load Balancer is recommended for ECS?
Application Load balancer for most use cases
Network Load Balancer for high throughput/high performance use or to pair with AWS private Link
Data Volumes (EFS) for ECS
EFS is able to be used with an ECS Cluster, works for both EC2 and Fargate launch types, and it mounts directly onto the EC2 instance & Fargate
Benefit of using EFS with ECS?
Tasks running in any AZ will share the same data in EFS system
Ultimate combo for ECS and data volume?
Fargate and EFS = serverless
Use cases for EFS in ECS?
multi AZ persistent shared storage for containers
What can you NOT do with S3 and ECS?
cannot use S3 as a mounted file system
ECS Service Auto Scaling
auto increase/decrease desired number of ECS tasks
ECS auto scaling uses AWS app Auto Scaling
- ECS service Average CPU Utilisation
- ECS Service Average Memory Utilisation - Scale on RAM
- ALB Request count per target - metric coming from ALB
What is ECS Target Tracking?
scale based on target value for a specific CloudWatch metric
What is ECS Step scaling
scale on specified CLoudWatch Alarm
Scheduled scaling in ECS
scale based on a specific date/time (predictable changes)