SlideShare a Scribd company logo
Amazon EC2 Container Service (ECS) &&
Amazon EC2 Container Registry (ECR)
- Dive Deep(?)
김기완, 솔루션스 아키텍트, 아마존웹서비스 코리아
Dec 14, 2015
Some Facts on Docker (Sample of 7,000 compaines)
5 times grow in
ONE year
2014.9 : 1.8% à
2015.9 : 8.3%
Some Facts on Docker (Sample of 7,000 compaines)
0% à 6% in ONE year!
Some Facts on Docker (Sample of 7,000 compaines)
Larger Companies Are
the Early Adopters
Server
Guest OS
Bins/Libs Bins/Libs
App2App1
Managing one resource is straightforward
Server
Guest OS
Bins/Libs Bins/Libs
App2App1
Managing one resource is straightforward
$ docker run myimage
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Managing a cluster is hard !!
Fleet management
• Monitor utilization
• Grow capacity
• Security
State Management
Availability Zone 1 Availability Zone 2
Amazon EC2 Container Service (ECS)
Architecture
Cluster Management Made Easy
• No cluster software to install and manage
• Manages cluster state
• Manages containers
• Control and monitoring
• Scale from one to tens of thousands of
containers
Flexible Container Placement
Applications
Batch jobs
Multiple schedulers
Designed for use with other AWS services
Elastic Load Balancing
Amazon Elastic Block Store
Amazon Virtual Private Cloud
AWS Identity and Access Management
AWS CloudTrail
Extensible
Comprehensive APIs
Open source agent
Custom schedulers
• Container Instance
• Cluster
• Task Definitions
• Tasks
• Service
Container
Instance
Container
Instance
…
Container
Instance
Cluster
Task
definition
Task
Service
Components
Overall Steps
• Create Cluster in ECS Console or CLI
• Prepare Cluster Instances
• Prepare Task Definitions
• Configure the scheduler (services, …)
Container Instances
#!/bin/bash
echo ECS_CLUSTER=containerday >> /etc/ecs/ecs.config
EOF
• Use ‘ecs-optimized’AMI
• One line in the user data section
Container Instances
{
"environment": [],
"name": "simple-demo",
"image": "my-demo",
"cpu": 10,
"memory": 500,
"portMappings": [
{
"containerPort": 80,
"hostPort": 80
}
],
"mountPoints": [
{
"sourceVolume": "my-vol",
"containerPath": "/var/www/my-
vol"
}
],
"entryPoint": [
"/usr/sbin/apache2",
"-D",
"FOREGROUND"
],
"essential": true
},
Task Definitions
[
{
"image": "mysql",
"name": "db",
"cpu": 10,
"memory": 500,
"essential": true,
"entryPoint": [
"/entrypoint.sh"
],
"environment": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "pass"
}
],
"portMappings": []
}
]
Essential to our Task
Create and mount volumes
Expose port 80 in container
to port 80 on host
10 CPU Units (1024 is full CPU),
500 Megabytes of Memory
Tasks
Container
Instance
Schedule
Shared Data Volume
PHPApp Time of day App
Shared Data Volume
PHPApp Time of
day App
Scheduling Amazon ECS Tasks
• The Amazon ECS schedulers leverage cluster state information provided by the
Amazon ECS API to make an appropriate placement decision.
• Services (Service Scheduler)
– Long running stateless services and applications
– Ensures that the specified number of tasks are constantly running and reschedules when a task fails
– ELB
– Can be dynamically changed (new task, # of desired tasks, …)
• Running Tasks (Runtask)
– Batch jobs
– Randomly distributes tasks across the cluster, but try to balance it
• The StartTask API
– Write or use your own schedulers
– AWS CLI, AWS SDK, and the Amazon ECS API
– List/Describe to get the state of your cluster, and using StartTask, place tasks on the appropriate container instance
Services (Service Scheduler)
• If a task in a service becomes unhealthy or unresponsive, the task is
killed and restarted. This process continues until your service reaches
the number of desired running tasks.
• You can optionally run your service behind a load balancer
• When the service scheduler launches new tasks, it attempts to balance
them across the Availability Zones in your cluster with the following
logic (AZ aware scheduling) :
– Determine which of the container instances in your cluster can support your service's task definition (for
example, they have the required CPU, memory, ports, and container instance attributes).
– Sort the valid container instances by the fewest number of running tasks for this service in the same
Availability Zone as the instance. For example, if zone Ahas one running service task and zones B and C
each have zero, valid container instances in either zone B or C are considered optimal for placement.
– Place the new service task on a valid container instance in an optimalAvailability Zone (based on the
previous steps), favoring container instances with the fewest number of running tasks for this service.
Service Load Balancer
Service Load Balancer
• One Load Balancer per service.
• One Load Balancer can support multiple ports, if containers in the
task definitions require multiple ports for the service. (e.g. a task
definition consists of Elasticsearch using port 3030 on the container
instance, with Logstash and Kibana using port 4040 on the container
instance, the same load balancer can route traffic to Elasticsearch and
Kibana through two listeners)
• Load balancer subnet configuration must include all subnets that your
container instances reside in.
• If a service’s task fails the load balancer health check criteria, the task
is killed and restarted. This process continues until your service
reaches the number of desired running tasks.
Updating a Service
• Change the number of tasks that are maintained by a service.
• Scale up or down. (as long as the container instances are available)
• If the Docker image is updated, create a new task definition with that
image, and deploy it to the service.
• The service scheduler creates a task with the new task definition
(provided there is an available container instance to place it on), and
after it reaches the RUNNING state, a task that is using the old task
definition is drained and stopped. This process continues until all of
the desired tasks in your service are using the new task definition.
Services
• Load Balance traffic across containers
• Automatically recover unhealthy containers
• Discover services
Shared Data Volume
PHP
App
Time of
day
App
Shared Data Volume
PHP
App
Time of
day
App
Shared Data Volume
PHP
App
Time of
day
App
Elastic Load Balancing
Update Service
• Scale up
• Scale down
Elastic Load Balancing
Shared Data Volume
PHP
App
Time of
day
App
Shared Data Volume
PHP
App
Time of
day
App
Shared Data Volume
PHP
App
Time of
day
App
Shared Data Volume
PHP
App
Time of
day
App
Update Service
• Deploy new version
• Drain connections
Elastic Load Balancing
Shared Data Volume
PHP
App
Time of
day
App
Shared Data Volume
PHP
App
Time of
day
App
Shared Data Volume
PHP
App
Time of
day
App
Running Tasks (RunTask)
• One-time or periodic batch job.
• If you want a specified number of tasks to always remain
running or if you want to place your tasks behind a load
balancer, you should use the Amazon ECS service
scheduler.
Task Life Cycle
Auto Scaling in ECS?
https://aws.amazon.com/blogs/compute/scali
ng-amazon-ecs-services-automatically-using-
amazon-cloudwatch-and-aws-lambda/
So, Happy Enough?
Some Facts on Docker (Sample of 7,000 compaines)
Hmmmm, Registry??
Remaining Pain-points
• “We don’t want to be in the business of hosting our own
infrastructure for a container registry”
• “Need a service that has better up time and can handle
hundreds of image pulls at once”
• “Need to keep images private with fine-grained access
control without managing certificates or credentials”
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
Overview
• Security
– IAM Resource-based Policies
– Images encrypted at transit and at rest
• Easily Manage & Deploy Images
– Tight Integration with ECS
– Standalone Service
– Integration with Docker Toolset
– Management Console & AWS CLI
• Reliability & Performance
– S3 Backed
– Regional Endpoints
– Expect to handle hundreds of concurrent pulls
Pricing
• $0.10 per GB/month Docker image storage
pricing
• Data transfer pass-through pricing (customary
AWS rates)
– Free data in
– Charge for data out to internet and data out from one region to
another
• 12-month free tier for 500MB image storage
Amazon ECR Default Service Limits
Resources Default Limit
Number of repositories per account 10
Number of images per repository 50
Number of layers per image 127 (Current Docker limit)
Layer size 1GiB
AWS Console for ECR
AWS Console for ECR
AWS Console for ECR
Demo
Q&A
THANK YOU!

More Related Content

What's hot (20)

PDF
비용 관점에서 AWS 클라우드 아키텍처 디자인하기::류한진::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PPTX
Microservices Architecture Part 2 Event Sourcing and Saga
Araf Karsh Hamid
 
PDF
Cloud-Native Observability
Tyler Treat
 
PDF
EKS vs GKE vs AKS - Evaluating Kubernetes in the Cloud
DevOps.com
 
PDF
AWS 상의 컨테이너 서비스 소개 ECS, EKS - 이종립 / Principle Enterprise Evangelist @베스핀글로벌
BESPIN GLOBAL
 
PPT
Auto Scaling on AWS
AustinWebArch
 
PDF
Devops - Microservice and Kubernetes
NodeXperts
 
PDF
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
AWSKRUG - AWS한국사용자모임
 
PDF
AWS Transit Gateway를 통한 Multi-VPC 아키텍처 패턴 - 강동환 솔루션즈 아키텍트, AWS :: AWS Summit ...
Amazon Web Services Korea
 
PDF
Deploy 22 microservices from scratch in 30 mins with GitOps
Opsta
 
PDF
시계열 예측 자동화를 위한 Amazon Forecast 기반 MLOps 파이프라인 구축하기 - 김주영, 이동민 AWS 솔루션즈 아키텍트 :...
Amazon Web Services Korea
 
PDF
Open shift 4 infra deep dive
Winton Winton
 
PDF
AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build...
Amazon Web Services Korea
 
PPTX
Power of Azure Devops
Azure Riyadh User Group
 
PDF
Kubernetes a comprehensive overview
Gabriel Carro
 
PPTX
Using AWS Well Architectured Framework for Software Architecture Evaluations ...
Alexandr Savchenko
 
PDF
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
EDB
 
PPSX
Elastic-Engineering
Araf Karsh Hamid
 
PDF
Kubernetes
erialc_w
 
PDF
AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)
Amazon Web Services Korea
 
비용 관점에서 AWS 클라우드 아키텍처 디자인하기::류한진::AWS Summit Seoul 2018
Amazon Web Services Korea
 
Microservices Architecture Part 2 Event Sourcing and Saga
Araf Karsh Hamid
 
Cloud-Native Observability
Tyler Treat
 
EKS vs GKE vs AKS - Evaluating Kubernetes in the Cloud
DevOps.com
 
AWS 상의 컨테이너 서비스 소개 ECS, EKS - 이종립 / Principle Enterprise Evangelist @베스핀글로벌
BESPIN GLOBAL
 
Auto Scaling on AWS
AustinWebArch
 
Devops - Microservice and Kubernetes
NodeXperts
 
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
AWSKRUG - AWS한국사용자모임
 
AWS Transit Gateway를 통한 Multi-VPC 아키텍처 패턴 - 강동환 솔루션즈 아키텍트, AWS :: AWS Summit ...
Amazon Web Services Korea
 
Deploy 22 microservices from scratch in 30 mins with GitOps
Opsta
 
시계열 예측 자동화를 위한 Amazon Forecast 기반 MLOps 파이프라인 구축하기 - 김주영, 이동민 AWS 솔루션즈 아키텍트 :...
Amazon Web Services Korea
 
Open shift 4 infra deep dive
Winton Winton
 
AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build...
Amazon Web Services Korea
 
Power of Azure Devops
Azure Riyadh User Group
 
Kubernetes a comprehensive overview
Gabriel Carro
 
Using AWS Well Architectured Framework for Software Architecture Evaluations ...
Alexandr Savchenko
 
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
EDB
 
Elastic-Engineering
Araf Karsh Hamid
 
Kubernetes
erialc_w
 
AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)
Amazon Web Services Korea
 

Viewers also liked (7)

PPTX
AWS Elastic Container Registry
Richard Boyd, II
 
PDF
EC2 컨테이너 서비스 고객사례 Vingle - 조휘철 소프트웨어 엔지니어 :: AWS Container Day
Amazon Web Services Korea
 
PDF
Continuous Integration with Docker - 송주영 선임 :: AWS Container Day
Amazon Web Services Korea
 
PDF
TerraformでECS+ECRする話
Satoshi Hirayama
 
PDF
도커의 기초 - 김상필 솔루션즈 아키텍트 :: AWS Container Day
Amazon Web Services Korea
 
PDF
도커 컨테이너 활용 사례 Codigm - 남 유석 개발팀장 :: AWS Container Day
Amazon Web Services Korea
 
PDF
Principles of microservices velocity
Sam Newman
 
AWS Elastic Container Registry
Richard Boyd, II
 
EC2 컨테이너 서비스 고객사례 Vingle - 조휘철 소프트웨어 엔지니어 :: AWS Container Day
Amazon Web Services Korea
 
Continuous Integration with Docker - 송주영 선임 :: AWS Container Day
Amazon Web Services Korea
 
TerraformでECS+ECRする話
Satoshi Hirayama
 
도커의 기초 - 김상필 솔루션즈 아키텍트 :: AWS Container Day
Amazon Web Services Korea
 
도커 컨테이너 활용 사례 Codigm - 남 유석 개발팀장 :: AWS Container Day
Amazon Web Services Korea
 
Principles of microservices velocity
Sam Newman
 
Ad

Similar to ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day (10)

PPTX
Tech connect aws
Blake Diers
 
PPT
Cloud & Native Cloud for Managers
Eitan Sela
 
PDF
intro elastic container service amazon aws
DanielJara92
 
PPTX
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
Weaveworks
 
PPTX
Introduction to Amazon EC2 Container Service and setting up build pipeline wi...
Swapnil Dahiphale
 
PDF
A 60-minute tour of AWS Compute (November 2016)
Julien SIMON
 
PDF
The AWS DevOps combo (January 2017)
Julien SIMON
 
PDF
Docker clusters on AWS with Amazon ECS and Kubernetes
Julien SIMON
 
PDF
EC2 Container Service
WhiteHedge Technologies Inc.
 
PPTX
New AWS Services for Bioinformatics
Lynn Langit
 
Tech connect aws
Blake Diers
 
Cloud & Native Cloud for Managers
Eitan Sela
 
intro elastic container service amazon aws
DanielJara92
 
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
Weaveworks
 
Introduction to Amazon EC2 Container Service and setting up build pipeline wi...
Swapnil Dahiphale
 
A 60-minute tour of AWS Compute (November 2016)
Julien SIMON
 
The AWS DevOps combo (January 2017)
Julien SIMON
 
Docker clusters on AWS with Amazon ECS and Kubernetes
Julien SIMON
 
EC2 Container Service
WhiteHedge Technologies Inc.
 
New AWS Services for Bioinformatics
Lynn Langit
 
Ad

More from Amazon Web Services Korea (20)

PDF
[D3T1S01] Gen AI를 위한 Amazon Aurora 활용 사례 방법
Amazon Web Services Korea
 
PDF
[D3T1S06] Neptune Analytics with Vector Similarity Search
Amazon Web Services Korea
 
PDF
[D3T1S03] Amazon DynamoDB design puzzlers
Amazon Web Services Korea
 
PDF
[D3T1S04] Aurora PostgreSQL performance monitoring and troubleshooting by use...
Amazon Web Services Korea
 
PDF
[D3T1S07] AWS S3 - 클라우드 환경에서 데이터베이스 보호하기
Amazon Web Services Korea
 
PDF
[D3T1S05] Aurora 혼합 구성 아키텍처를 사용하여 예상치 못한 트래픽 급증 대응하기
Amazon Web Services Korea
 
PDF
[D3T1S02] Aurora Limitless Database Introduction
Amazon Web Services Korea
 
PDF
[D3T2S01] Amazon Aurora MySQL 메이저 버전 업그레이드 및 Amazon B/G Deployments 실습
Amazon Web Services Korea
 
PDF
[D3T2S03] Data&AI Roadshow 2024 - Amazon DocumentDB 실습
Amazon Web Services Korea
 
PDF
AWS Modern Infra with Storage Roadshow 2023 - Day 2
Amazon Web Services Korea
 
PDF
AWS Modern Infra with Storage Roadshow 2023 - Day 1
Amazon Web Services Korea
 
PDF
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
Amazon Web Services Korea
 
PDF
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon Web Services Korea
 
PDF
Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...
Amazon Web Services Korea
 
PDF
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Amazon Web Services Korea
 
PDF
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
Amazon Web Services Korea
 
PDF
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Amazon Web Services Korea
 
PDF
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon Web Services Korea
 
PDF
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon Web Services Korea
 
PDF
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
Amazon Web Services Korea
 
[D3T1S01] Gen AI를 위한 Amazon Aurora 활용 사례 방법
Amazon Web Services Korea
 
[D3T1S06] Neptune Analytics with Vector Similarity Search
Amazon Web Services Korea
 
[D3T1S03] Amazon DynamoDB design puzzlers
Amazon Web Services Korea
 
[D3T1S04] Aurora PostgreSQL performance monitoring and troubleshooting by use...
Amazon Web Services Korea
 
[D3T1S07] AWS S3 - 클라우드 환경에서 데이터베이스 보호하기
Amazon Web Services Korea
 
[D3T1S05] Aurora 혼합 구성 아키텍처를 사용하여 예상치 못한 트래픽 급증 대응하기
Amazon Web Services Korea
 
[D3T1S02] Aurora Limitless Database Introduction
Amazon Web Services Korea
 
[D3T2S01] Amazon Aurora MySQL 메이저 버전 업그레이드 및 Amazon B/G Deployments 실습
Amazon Web Services Korea
 
[D3T2S03] Data&AI Roadshow 2024 - Amazon DocumentDB 실습
Amazon Web Services Korea
 
AWS Modern Infra with Storage Roadshow 2023 - Day 2
Amazon Web Services Korea
 
AWS Modern Infra with Storage Roadshow 2023 - Day 1
Amazon Web Services Korea
 
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
Amazon Web Services Korea
 
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon Web Services Korea
 
Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...
Amazon Web Services Korea
 
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Amazon Web Services Korea
 
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
Amazon Web Services Korea
 
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Amazon Web Services Korea
 
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon Web Services Korea
 
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon Web Services Korea
 
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
Amazon Web Services Korea
 

Recently uploaded (20)

PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
July Patch Tuesday
Ivanti
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Python basic programing language for automation
DanialHabibi2
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 

ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day

  • 1. Amazon EC2 Container Service (ECS) && Amazon EC2 Container Registry (ECR) - Dive Deep(?) 김기완, 솔루션스 아키텍트, 아마존웹서비스 코리아 Dec 14, 2015
  • 2. Some Facts on Docker (Sample of 7,000 compaines) 5 times grow in ONE year 2014.9 : 1.8% à 2015.9 : 8.3%
  • 3. Some Facts on Docker (Sample of 7,000 compaines) 0% à 6% in ONE year!
  • 4. Some Facts on Docker (Sample of 7,000 compaines) Larger Companies Are the Early Adopters
  • 6. Server Guest OS Bins/Libs Bins/Libs App2App1 Managing one resource is straightforward $ docker run myimage
  • 7. Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Managing a cluster is hard !!
  • 8. Fleet management • Monitor utilization • Grow capacity • Security
  • 9. State Management Availability Zone 1 Availability Zone 2
  • 10. Amazon EC2 Container Service (ECS)
  • 12. Cluster Management Made Easy • No cluster software to install and manage • Manages cluster state • Manages containers • Control and monitoring • Scale from one to tens of thousands of containers
  • 14. Designed for use with other AWS services Elastic Load Balancing Amazon Elastic Block Store Amazon Virtual Private Cloud AWS Identity and Access Management AWS CloudTrail
  • 15. Extensible Comprehensive APIs Open source agent Custom schedulers
  • 16. • Container Instance • Cluster • Task Definitions • Tasks • Service Container Instance Container Instance … Container Instance Cluster Task definition Task Service Components
  • 17. Overall Steps • Create Cluster in ECS Console or CLI • Prepare Cluster Instances • Prepare Task Definitions • Configure the scheduler (services, …)
  • 18. Container Instances #!/bin/bash echo ECS_CLUSTER=containerday >> /etc/ecs/ecs.config EOF • Use ‘ecs-optimized’AMI • One line in the user data section
  • 20. { "environment": [], "name": "simple-demo", "image": "my-demo", "cpu": 10, "memory": 500, "portMappings": [ { "containerPort": 80, "hostPort": 80 } ], "mountPoints": [ { "sourceVolume": "my-vol", "containerPath": "/var/www/my- vol" } ], "entryPoint": [ "/usr/sbin/apache2", "-D", "FOREGROUND" ], "essential": true }, Task Definitions [ { "image": "mysql", "name": "db", "cpu": 10, "memory": 500, "essential": true, "entryPoint": [ "/entrypoint.sh" ], "environment": [ { "name": "MYSQL_ROOT_PASSWORD", "value": "pass" } ], "portMappings": [] } ] Essential to our Task Create and mount volumes Expose port 80 in container to port 80 on host 10 CPU Units (1024 is full CPU), 500 Megabytes of Memory
  • 21. Tasks Container Instance Schedule Shared Data Volume PHPApp Time of day App Shared Data Volume PHPApp Time of day App
  • 22. Scheduling Amazon ECS Tasks • The Amazon ECS schedulers leverage cluster state information provided by the Amazon ECS API to make an appropriate placement decision. • Services (Service Scheduler) – Long running stateless services and applications – Ensures that the specified number of tasks are constantly running and reschedules when a task fails – ELB – Can be dynamically changed (new task, # of desired tasks, …) • Running Tasks (Runtask) – Batch jobs – Randomly distributes tasks across the cluster, but try to balance it • The StartTask API – Write or use your own schedulers – AWS CLI, AWS SDK, and the Amazon ECS API – List/Describe to get the state of your cluster, and using StartTask, place tasks on the appropriate container instance
  • 23. Services (Service Scheduler) • If a task in a service becomes unhealthy or unresponsive, the task is killed and restarted. This process continues until your service reaches the number of desired running tasks. • You can optionally run your service behind a load balancer • When the service scheduler launches new tasks, it attempts to balance them across the Availability Zones in your cluster with the following logic (AZ aware scheduling) : – Determine which of the container instances in your cluster can support your service's task definition (for example, they have the required CPU, memory, ports, and container instance attributes). – Sort the valid container instances by the fewest number of running tasks for this service in the same Availability Zone as the instance. For example, if zone Ahas one running service task and zones B and C each have zero, valid container instances in either zone B or C are considered optimal for placement. – Place the new service task on a valid container instance in an optimalAvailability Zone (based on the previous steps), favoring container instances with the fewest number of running tasks for this service.
  • 25. Service Load Balancer • One Load Balancer per service. • One Load Balancer can support multiple ports, if containers in the task definitions require multiple ports for the service. (e.g. a task definition consists of Elasticsearch using port 3030 on the container instance, with Logstash and Kibana using port 4040 on the container instance, the same load balancer can route traffic to Elasticsearch and Kibana through two listeners) • Load balancer subnet configuration must include all subnets that your container instances reside in. • If a service’s task fails the load balancer health check criteria, the task is killed and restarted. This process continues until your service reaches the number of desired running tasks.
  • 26. Updating a Service • Change the number of tasks that are maintained by a service. • Scale up or down. (as long as the container instances are available) • If the Docker image is updated, create a new task definition with that image, and deploy it to the service. • The service scheduler creates a task with the new task definition (provided there is an available container instance to place it on), and after it reaches the RUNNING state, a task that is using the old task definition is drained and stopped. This process continues until all of the desired tasks in your service are using the new task definition.
  • 27. Services • Load Balance traffic across containers • Automatically recover unhealthy containers • Discover services Shared Data Volume PHP App Time of day App Shared Data Volume PHP App Time of day App Shared Data Volume PHP App Time of day App Elastic Load Balancing
  • 28. Update Service • Scale up • Scale down Elastic Load Balancing Shared Data Volume PHP App Time of day App Shared Data Volume PHP App Time of day App Shared Data Volume PHP App Time of day App Shared Data Volume PHP App Time of day App
  • 29. Update Service • Deploy new version • Drain connections Elastic Load Balancing Shared Data Volume PHP App Time of day App Shared Data Volume PHP App Time of day App Shared Data Volume PHP App Time of day App
  • 30. Running Tasks (RunTask) • One-time or periodic batch job. • If you want a specified number of tasks to always remain running or if you want to place your tasks behind a load balancer, you should use the Amazon ECS service scheduler.
  • 32. Auto Scaling in ECS? https://aws.amazon.com/blogs/compute/scali ng-amazon-ecs-services-automatically-using- amazon-cloudwatch-and-aws-lambda/
  • 34. Some Facts on Docker (Sample of 7,000 compaines) Hmmmm, Registry??
  • 35. Remaining Pain-points • “We don’t want to be in the business of hosting our own infrastructure for a container registry” • “Need a service that has better up time and can handle hundreds of image pulls at once” • “Need to keep images private with fine-grained access control without managing certificates or credentials”
  • 38. Overview • Security – IAM Resource-based Policies – Images encrypted at transit and at rest • Easily Manage & Deploy Images – Tight Integration with ECS – Standalone Service – Integration with Docker Toolset – Management Console & AWS CLI • Reliability & Performance – S3 Backed – Regional Endpoints – Expect to handle hundreds of concurrent pulls
  • 39. Pricing • $0.10 per GB/month Docker image storage pricing • Data transfer pass-through pricing (customary AWS rates) – Free data in – Charge for data out to internet and data out from one region to another • 12-month free tier for 500MB image storage
  • 40. Amazon ECR Default Service Limits Resources Default Limit Number of repositories per account 10 Number of images per repository 50 Number of layers per image 127 (Current Docker limit) Layer size 1GiB
  • 44. Demo
  • 45. Q&A