Amazon ECS¶
It is container orchestration service. 💡 You are still responsible for maintaining the underlying EC2 instances.
ECS Components¶
- Cluster: consists of services
- Service: consists of identical tasks
- managed by ECS service scheduler
- scale out and scale in
- availability Zone-aware
- Task: consist of containers
- You can run task without service:
- managed by ECS task Scheduler
- run once or at intervals
- optimal for batch jobs
- You can run task without service:
ECS Options:¶
- run your tasks and services on a serverless infrastructure that's managed by AWS Fargate 2023103015443030 AWS Fargate
- For more control over your infrastructure, you can run your tasks and services on a cluster of EC2 instances that you manage.
- you need to install the Amazon ECS container agent on your EC2 instances.
- 💡 an EC2 instance with the container agent installed is often called a container instance.
- What you can do:
- run and stop containers
- get cluster state
- scale in and out
- assign permissions
- schedule the placement of containers across your cluster
- achieve availability requirements
- other..
- You need to create json file described a task. For example:
{ "family": "webserver", "containerDefinitions": [ { "name": "web", "image": "nginx", "memory": "100", "cpu": "99" } ], "requiresCompatibilities": [ "FARGATE" ], "networkMode": "awsvpc", "memory": "512", "cpu": "256" }
Task/Service placement¶
- cluster constraints
- CPU, memory and networking requirements
- custom constraints
- filter for location, instance type, AMI, or other attribute constraints
- task/service placement strategies.Best effort. You can use several strategies.
- random
- binpack
- spread
- task/service placement constraints. Binding.
- distinctInstance
- memberOf
ECR¶
- fully managed cloud-based docker image registry
- Scalable and HA
- Secure
- At rest encryption
- IAM-based access controls
- Fully integrated with ECS and docker CLI
References¶
- https://explore.skillbuilder.aws/learn/course/external/view/elearning/1851/aws-technical-essentials?da=sec&sec=prep Module 2
- Amazon ECS Primer course
- AWS website:Â Amazon Elastic Container Service (Amazon ECS)(opens in a new tab)
- External website:Â Github: Amazon ECS Agent(opens in a new tab)
- AWS developer guide:Â Amazon ECS Container Instances(opens in a new tab)
- External website:Â Coursera course: Building Containerized Applications on AWS(opens in a new tab)