際際滷

際際滷Share a Scribd company logo
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Getting started with Amazon Elastic
ContainerService (ECS)
Container Orchestration & Management on AWS
Ioannis Polyzos
Senior Solutions Architect
Amazon Web Services (AWS)
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
? Containers
? Amazon ECR
? Amazon ECS
? Demo
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
First things first´
? What are containers and why
are customers using them?
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why arecompanies
adoptingcontainers?
? 2022, Amazon Web Services, Inc. or its Affiliates.
? Accelerate software development
? Build modern applications
? Automate operations at web scale
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
? 2022, Amazon Web Services, Inc. or its Affiliates.
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Managing many containers is hard
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
? 2022, Amazon Web Services, Inc. or its Affiliates.
Amazon Elastic
ContainerRegistry
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon ECR
F U L L Y - M A N A G E D C O N T A I N E R A R T I F A C T R E G I S T R Y
AWS Cloud
Availability Zone
VPC
Availability Zone Availability Zone
AmazonECR
Compute
Push
Pull
Amazon EKS Amazon ECS AWS Fargate
On premises and
other clouds
Managed and scalable
infrastructure
Highly available,
high performance
Security with encrypted
images and vulnerability
scans
Authenticated access,
centralized IAM control
Docker and OCI compliant to
pull anywhere
Nativeintegration to AWS orchestrators and compute
Container images, Helm
charts, OCI artifacts
Amazon EC2
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AmazonElastic
Container Service
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scheduling and Orchestration
Cluster Manager Placement Engine
ECS
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
? 2022, Amazon Web Services, Inc. or its Affiliates.
Getting started with Amazon ECS
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS constructs
Cluster
? Resourcegrouping and isolation
? IAM permissions boundary
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS constructs
Cluster
? Resourcegrouping and isolation
? IAM permissions boundary
Container
Instance
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS constructs
Cluster
? Resourcegrouping and isolation
? IAM permissions boundary
Task
? Running instanceof a task
definition
? One or morecontainers
Task definition
? Templateused by Amazon ECS to
launch tasks
? Parallels to docker run parameters
? Defines requirements:
? CPU/Memory
? Container image(s)
? Logging
? IAM role
? Etc.
Container 1 Container 1
{ ; }
JSON
Container
Instance
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS constructs
Cluster
? Resourcegrouping and isolation
? IAM permissions boundary
Service
? Maintains desired # of running
tasks
? Replaces unhealthy tasks
? ELB integration
Task
? Running instanceof a task
definition
? One or morecontainers
Task definition
? Templateused by Amazon ECS to
launch tasks
? Parallels to docker run parameters
? Defines requirements:
? CPU/Memory
? Container image(s)
? Logging
? IAM role
? Etc.
Container 1
Container 1
Container 1
Container 1 Container 1
{ ; }
JSON
Container
Instance
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Taskdefinition
{
"containerDefinitions": [
{
"memory": 128,
"portMappings": [
{
"hostPort": 80,
"containerPort": 80,
"protocol": "tcp"
}
],
"essential": true,
"name": "nginx-container",
"image": "nginx",
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "ecs-log-streaming",
"awslogs-region": "us-west-2",
"awslogs-stream-prefix": "fargate-task-1"
}
},
continued´
"cpu": 0
}
],
"networkMode": "awsvpc",
"executionRoleArn":
"arn:aws:iam::123456789012:role/ecsTas
kExecutionRole",
"memory": "2048",
"cpu": "1024",
"requiresCompatibilities": [
"FARGATE"
],
"family": "example_task_1"
}
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Deploying on ECS: Tasks vs Services
On-Demand Workloads
ECS task scheduler
Run once or at intervals
Batch jobs
RunTask API
StartTask (custom)
Long-Running Apps
ECS service scheduler
Health management
Scale-up and scale-down
AZ aware
Grouped containers
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Taskplacement
Cluster Constraints
Custom Constraints
Placement Strategies
Apply Filter
Satisfy CPU,memory, and networking requirements
Filter forlocation,instance-type, AMI, orother
custom attribute constraints
Identify instances that meet spread or binpack
placement strategy
Select final container instances forplacement
Amazon ECS powers Amazon
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Fargate
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Without Fargate, you end up managing more than just containers
EC2 Instance
ECS
Agent
Container
Rungime
OS
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
DEMO
? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you for attending!
Ioannis Polyzos
Senior Solutions Architect
ipolyzos@amazon.com
@ipolyzos

More Related Content

Getting started with Amazon ECS

  • 1. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Getting started with Amazon Elastic ContainerService (ECS) Container Orchestration & Management on AWS Ioannis Polyzos Senior Solutions Architect Amazon Web Services (AWS)
  • 2. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda ? Containers ? Amazon ECR ? Amazon ECS ? Demo
  • 3. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. First things first´ ? What are containers and why are customers using them?
  • 4. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why arecompanies adoptingcontainers? ? 2022, Amazon Web Services, Inc. or its Affiliates. ? Accelerate software development ? Build modern applications ? Automate operations at web scale
  • 5. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. ? 2022, Amazon Web Services, Inc. or its Affiliates.
  • 6. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Managing many containers is hard
  • 7. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. ? 2022, Amazon Web Services, Inc. or its Affiliates. Amazon Elastic ContainerRegistry
  • 8. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is Amazon ECR F U L L Y - M A N A G E D C O N T A I N E R A R T I F A C T R E G I S T R Y AWS Cloud Availability Zone VPC Availability Zone Availability Zone AmazonECR Compute Push Pull Amazon EKS Amazon ECS AWS Fargate On premises and other clouds Managed and scalable infrastructure Highly available, high performance Security with encrypted images and vulnerability scans Authenticated access, centralized IAM control Docker and OCI compliant to pull anywhere Nativeintegration to AWS orchestrators and compute Container images, Helm charts, OCI artifacts Amazon EC2
  • 9. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. AmazonElastic Container Service
  • 10. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scheduling and Orchestration Cluster Manager Placement Engine ECS
  • 11. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. ? 2022, Amazon Web Services, Inc. or its Affiliates.
  • 13. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS constructs Cluster ? Resourcegrouping and isolation ? IAM permissions boundary
  • 14. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS constructs Cluster ? Resourcegrouping and isolation ? IAM permissions boundary Container Instance
  • 15. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS constructs Cluster ? Resourcegrouping and isolation ? IAM permissions boundary Task ? Running instanceof a task definition ? One or morecontainers Task definition ? Templateused by Amazon ECS to launch tasks ? Parallels to docker run parameters ? Defines requirements: ? CPU/Memory ? Container image(s) ? Logging ? IAM role ? Etc. Container 1 Container 1 { ; } JSON Container Instance
  • 16. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS constructs Cluster ? Resourcegrouping and isolation ? IAM permissions boundary Service ? Maintains desired # of running tasks ? Replaces unhealthy tasks ? ELB integration Task ? Running instanceof a task definition ? One or morecontainers Task definition ? Templateused by Amazon ECS to launch tasks ? Parallels to docker run parameters ? Defines requirements: ? CPU/Memory ? Container image(s) ? Logging ? IAM role ? Etc. Container 1 Container 1 Container 1 Container 1 Container 1 { ; } JSON Container Instance
  • 17. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Taskdefinition { "containerDefinitions": [ { "memory": 128, "portMappings": [ { "hostPort": 80, "containerPort": 80, "protocol": "tcp" } ], "essential": true, "name": "nginx-container", "image": "nginx", "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "ecs-log-streaming", "awslogs-region": "us-west-2", "awslogs-stream-prefix": "fargate-task-1" } }, continued´ "cpu": 0 } ], "networkMode": "awsvpc", "executionRoleArn": "arn:aws:iam::123456789012:role/ecsTas kExecutionRole", "memory": "2048", "cpu": "1024", "requiresCompatibilities": [ "FARGATE" ], "family": "example_task_1" }
  • 18. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deploying on ECS: Tasks vs Services On-Demand Workloads ECS task scheduler Run once or at intervals Batch jobs RunTask API StartTask (custom) Long-Running Apps ECS service scheduler Health management Scale-up and scale-down AZ aware Grouped containers
  • 19. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Taskplacement Cluster Constraints Custom Constraints Placement Strategies Apply Filter Satisfy CPU,memory, and networking requirements Filter forlocation,instance-type, AMI, orother custom attribute constraints Identify instances that meet spread or binpack placement strategy Select final container instances forplacement
  • 21. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Fargate
  • 22. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Without Fargate, you end up managing more than just containers EC2 Instance ECS Agent Container Rungime OS
  • 23. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. DEMO
  • 24. ? 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you for attending! Ioannis Polyzos Senior Solutions Architect ipolyzos@amazon.com @ipolyzos