ECS, ECR and Fargate Flashcards
(35 cards)
Amazon ECS
Simplifies process of running, managing and scaling containerised applications by providing manager service that takes care of it for you
ECS - EC2 Launch Type
Containerised applications run on a cluster of EC2 instances that you manage
ECS - Fargate Launch Type
Provides a serverless experience where you don’t need to manage instances; AWS automatically provisions and scales the compute resources needed for your tasks
EC2 Instance Profile
Provides permissions to the EC2 instances themselves, EC2 launch type only
ECS Task Role
Allows each task to have a specific role, defined in the task definition
Amazon EFS
Elastic file system, share data across multiple compute instances, works for EC2 and Fargate launch types
Can Amazon S3 be mounted as a file system for ECS?
No
ECS Auto Scaling uses AWS Application Scaling which is based on…
- ECS service avg CPU utilisation
- ECS service avg Memory utilisation
- ALB request count per target
Target tracking
Scale based on target value for specific CloudWatch metric
Step scaling
Scale based on specified CloudWatch Alarm
Scheduled scaling
Scale based on specified date/time for predictable changes
ECS service auto scaling is done at the ______ level whereas EC2 auto scaling is done at the ______ level
task, instance
ECS Cluster Capacity PRovider
Used to automatically provision and scale infrastructure for your ECS tasks (preferred)
ECS Rolling updates
When updating from v1 to v2, can control how many tasks can be started and stopped and in which order (set minimum and maximum percentage of healthy instances)
Dynamic Host Port Mapping
ALB finds the right port on your EC2 instances for you, occurs when you define only the container port in the task definition
Load balancing in Fargate
Each task has a unique private IP, only define the container port (host port is not applicable)
Where do you define IAM role for ECS task?
In the task definition
ECS Environment Variables
hardcoded (eg. URLs), SSM parameter store, secrets manager, or load directly from amazon s3 bucket
ECS Data Volumes / Bind Mounts
Share data between multiple containers in the same Task Definition (works for EC2 and fargate tasks)
Sidecar container pattern
Sidecar container is used to send metrics/logs to other destinations (needs to read from shared storage)
Task roles
Allow container to make API calls to AWS services
What is an essential container?
If the container fails or is killed, all tasks will be stopped
ECS Task Placement
When a task of type EC2 is launched, ECS must determine where to place it with constraints of CPU, memory and available port (only for ECS with EC2, not fargate)
Binpack Task Placement Strategy
Place tasks based on the least available amount of CPU or memory, minimises number of instances in use (saves money)