SlideShare a Scribd company logo
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Jaeseok Yoo
Container, Container, Container …
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Time
9:30 - 11:00 Docker & Container Orchestration
k8s, Amazon EKS
HoL: Launch EKS Cluster
11:00 – 11:15 Beak
11:15 – 12:30 HoL: Deploy Dashboard, Microservices, Logging
12:30 – 14:00 Launch
14:00 – 15:00 Amazon ECS, AWS Fargate
15:00 – 16:45 HoL: Dedicated game server operation
16:45 – 17:00 Clean Up
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Docker
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
애플리케이션의 구성
런 타임 엔진 코드
디펜던시 구성
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• 다른 애플리케이션 스택
• 다른 하드웨어 배포 환경
• 다른 환경에서 애플리케이션을
실행하는 효율적인 방법은?
• 다른 환경으로 쉽게
마이그레이션하는 방법은?
문제점
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
솔루션 - 도커
이식성 : 이미지 기반 배포
유연성 : 마이크로 서비스 모듈화
신속성 : 가벼운 도커 이미지
효율성 : OS kernel 공유
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VM과 컨테이너 비교
Server (Host)
Host OS
Hypervisor
App 2
Guest OS Guest OS Guest OS
Bins/Libs Bins/Libs Bins/Libs
App 1 App 3
VM
Server (Host)
Host OS
Docker
Bins/Libs Bins/Libs Bins/Libs
App 1 App 2 App 3
Container
Hypervisor
Guest OS
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Docker 이미지 구성
bootfs
kernel
Base image
Image
Image
W
ritable
Container
add
nginx
add
nodejs
U
buntu
References
parent
image
Base Image : 템플릿으로 사용되는
읽기 전용 이미지
Base Image에서 시작해서 커스텀
Image 추가하는 방식
Dockerfile 활용하여 손쉽게 배포 관련
구성 설정 및 재배포에 용이함
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Dockerfile
# our base image
FROM alpine:3.5
# Install python and pip
RUN apk add --update py2-pip
# install Python modules needed by the Python app
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r
/usr/src/app/requirements.txt
# copy files required for the app to run
COPY app.py /usr/src/app/
COPY templates/index.html /usr/src/app/templates/
# tell the port number the container should expose
EXPOSE 5000
# run the application
CMD ["python", "/usr/src/app/app.py"]
$ docker build -t <YOUR_USERNAME>/myfirstapp .
Sending build context to Docker daemon 9.728 kB
Step 1 : FROM alpine:latest
---> 0d81fc72e790
Step 2 : RUN apk add --update py-pip
---> 976a232ac4ad
Removing intermediate container 8abd4091b5f5
Step 3 : COPY requirements.txt /usr/src/app/
---> 65b4be05340c
Step 4 : RUN pip install --no-cache-dir -r
/usr/src/app/requirements.txt
---> 8de73b0730c2
Step 5 : COPY app.py /usr/src/app/
…
Dockerfile은 컨테이너 내부 이미지 환경 및 구성 정의
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
고객사례 - Nextdoor
Base OS version
Apt packages:
OpenSSL
libpq
syslog-ng
Datadog
Python runtime
PyPI packages:
Boto
Django
Mapnik
SendGrid
Source code
Static assets
Images
JS
CSS
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Layer 별 각기 다른 업데이트 주기
Quarterly
Weekly/
monthly
Continuous
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AMI에서 Docker Container로 변경
Base OS layer
System packages
Python packages
Nextdoor source
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Docker 이전에는 빌드 20분 소요
chroot
sudo apt-get install
sudo pip install
git clone
make install
dpkg create
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Base image , system deps 추가
FROM hub.corp.nextdoor.com/nextdoor/nd_base:precise
ADD app/docker/scripts/apt-fast 
app/docker/scripts/system-deps.sh 
/deps/
RUN /deps/system-deps.sh
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Python virtualenv 설정 업데이트
ADD app/docker/scripts/venv-deps.sh 
app/apps/nextdoor/etc/requirements*.txt 
app/apps/nextdoor/etc/nextdoor.yml 
app/services/scheduler/etc/scheduler.yml 
app/services/supervisor/etc/supervisor.yml 
/deps/
RUN /deps/venv-deps.sh
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
App 소스 업데이트
ADD app/static/nextdoorv2/images /app/static/nextdoorv2/images
ADD app/thrift /deps/thrift
ADD app/nd /deps/nd
ADD app /app
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
빌드 시간 20분 -> 평균 2분
ECS에 최종 배포까지 평균 5분
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Common Questions
• How do I deploy my containers to hosts?
• How do I do zero downtime or blue green deployments?
• How do I keep my containers alive?
• How can my containers talk to each other?
• Linking? Service Discovery?
• How can I configure my containers at runtime?
• What about secrets?
• How do I best optimize my "pool of compute”?
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How do we make this work at scale?
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
We need to
• start, stop, and monitor lots of containers running on
lots of hosts
• decide when and where to start or stop containers
• control our hosts and monitor their status
• manage rollouts of new code (containers) to our hosts
• manage how traffic flows to containers and how
requests are routed
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Container Orchestration
Instance Instance Instance
OS OS OS
Container Runtime Container Runtime Container Runtime
App Service App App Service Service
Container Orchestration
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Container Orchestration
myJob: {
Cpu: 10
Mem: 256
}
Orchestrator
Schedule
Run “myJob”
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Container Orchestration
Instance/OS Instance/OS Instance/OS
App Service App App Service Service
Service Management
Scheduling
Resource Management
OrchestrationService Management
§Availability
§Lifecycle
§Discovery
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Container Orchestration
Instance/OS Instance/OS Instance/OS
App Service App App Service Service
Service Management
Scheduling
Resource Management
Orchestration
Scheduling
§Placement
§Scaling
§Upgrades
§Rollbacks
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Container Orchestration
Instance/OS Instance/OS Instance/OS
App Service App App Service Service
Service Management
Scheduling
Resource Management
Orchestration
Resource Management
§ Memory
§ CPU
§ Ports
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What are container orchestration tools?
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Container Services Landscape
MANAGEMENT
Deployment, Scheduling,
Scaling & Management of
containerized applications
HOSTING
Where the containers run
Amazon Elastic
Container Service
Amazon Elastic
Container Service
for Kubernetes
Amazon EC2 AWS Fargate
IMAGE REGISTRY
Container Image
Repository
GA : June 6, 2018
Seoul : Jan 11, 2019
Amazon Elastic
Container Registry
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ECS
EC2 INSTANCES
LOAD
BALANCER
Internet
ECS
AGENT
TASK
Container
TASK
Container
ECS
AGENT
TASK
Container
TASK
Container
AGENT COMMUNICATION
SERVICE
Amazon ECS
API
CLUSTER MANAGEMENT
ENGINE
KEY/VALUE STORE
ECS
AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ECS : Cluster
EC2 INSTANCES
LOAD
BALANCER
Internet
ECS
AGENT
TASK
Container
TASK
Container
ECS
AGENT
TASK
Container
TASK
Container
AGENT COMMUNICATION
SERVICE
Amazon ECS
API
CLUSTER MANAGEMENT
ENGINE
KEY/VALUE STORE
ECS
AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ECS : Task
EC2 INSTANCES
LOAD
BALANCER
Internet
ECS
AGENT
TASK
Container
TASK
Container
ECS
AGENT
TASK
Container
TASK
Container
AGENT COMMUNICATION
SERVICE
Amazon ECS
API
CLUSTER MANAGEMENT
ENGINE
KEY/VALUE STORE
ECS
AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Tasks are defined via Task Definitions
{
"containerDefinitions": [
{
"name": "simple-app",
"image": "httpd:2.4",
"cpu": 10,
"memory": 300,
"portMappings": [
{
"hostPort": 80,
"containerPort": 80,
"protocol": "tcp"
}
],
"essential": true,
"mountPoints": [
{
"containerPath": "/usr/local/apache2/htdocs",
"sourceVolume": "my-vol"
}
]
},
{
"name": "busybox",
"image": "busybox",
"cpu": 10,
"memory": 200,
"volumesFrom": [
{
"sourceContainer": "simple-app"
}
],
"command": [
"/bin/sh -c "...""
],
"essential": false
}
],
"volumes": [
{
"name": “my-vol"
}
]
}
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Tasks are defined via Task Definitions
{
"containerDefinitions": [
{
"name": "simple-app",
"image": "httpd:2.4",
"cpu": 10,
"memory": 300,
"portMappings": [
{
"hostPort": 80,
"containerPort": 80,
"protocol": "tcp"
}
],
"essential": true,
"mountPoints": [
{
"containerPath": "/usr/local/apache2/htdocs",
"sourceVolume": "my-vol"
}
]
},
10 CPU units (1024 is a full CPU)
300 MB of memory
Expose port 80 in container
to port 80 on host
Create and mount volumes
Essential to our task
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Tasks are defined via Task Definitions
{
"name": "busybox",
"image": "busybox",
"cpu": 10,
"memory": 200,
"volumesFrom": [
{
"sourceContainer": "simple-app"
}
],
"command": [
"/bin/sh -c "...""
],
"essential": false
}
],
"volumes": [
{
"name": “my-vol"
}
]
}
From Docker Hub
Mount volume from other container
Command to exec
Volumes
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Task log to CloudWatch Logs
CloudWatch Logs Amazon S3
Amazon Kinesis
AWS Lambda
Amazon ElasticSearch
Amazon ECS Store
Stream
Process
Search
CloudWatch Logs
CloudWatch Logs
CloudWatch Logs
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IAM Task Role
AWS IAM
Amazon
DynamoDB
S3
AWS IAM
DynamoDBRole
S3Role
Amazon
ECS
IAM Task
Role
Identity
Access
Management
(IAM)
ECS Task
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Task Placement Constraints
Name Example
AMI ID
attribute:ecs.ami-id == ami-
eca289fb
Availability
Zone
attribute:ecs.availability-
zone == us-east-1a
Instance
Type
attribute:ecs.instance-type
== t2.small
Distinct
Instances
type=“distinctInstance”
Custom attribute:stack == prod
Cluster
Constraints
Custom
Constraints
Placement
Strategies
Apply Filter
CPU, memory, port requirements
AZ, EC2 type, AMI, or custom
constraints
Spread or Binpack
placement strategy
Select final instances for
task deployment
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Task Placement Strategies
Binpacking Spread Affinity Distinct Instance
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ECS : Service
EC2 INSTANCES
LOAD
BALANCER
Internet
ECS
AGENT
TASK
Container
TASK
Container
ECS
AGENT
TASK
Container
TASK
Container
AGENT COMMUNICATION
SERVICE
Amazon ECS
API
CLUSTER MANAGEMENT
ENGINE
KEY/VALUE STORE
ECS
AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudWatch ECS Metric
2 Dimensions
• ClusterName
• ServiceName
4 metrics
• CPUReservation
• MemoryReservation
• CPUUtilization
• MemoryUtilization
Container
Instance
…
Cluster
Task
definition
Task
Service
CloudWatch
ECS Metrics
CloudWatch
EC2 Metrics
Container
Instance
Container
Instance
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ECS Cluster (EC2 Instance) Auto Scale out
Event: Per cluster CPU, memory
reservation, or usage
New services
ECS
ECS cluster
CloudWatch
Developers
CloudWatch event
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ECS Cluster (EC2 Instance) Auto Scale in
Draining
ECS
ECS cluster
CloudWatch
Event: Per cluster CPU, memory
reservation, or usage
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service Auto Scaling
Amazon EC2
Service
Resource
buffer
(+~15%)
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Auto Scaling Target Tracking
Only need to set the target value for the
metric
(ex: CPU utilization 50%)
Auto Scaling automatically adjusts the Task
DesiredCount in Service
CloudWatch metric
ECSServiceAverageCPUUtilization
ECSServiceAverageMemoryUtilization
ALBRequestCountPerTarget
CPUTraffic
DesiredCount
Time
100%
0%
50%
10%
20%
30%
40%
60%
70%
80%
90%
5
30
10
15
20
25
Target CPU Utilization DesiredCount
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Fargate : Only focus on tasks!
Simple, Easy, efficient
Serverless
Container!
=No EC2 Instances
to provision, scale
or manage
ECS
Native API ,
Integrated with
VPC, ELB, IAM,
CloudWatch
and more
Pay for CPU,
Memory Usage
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Fargate
Scheduling and Orchestration
Cluster Manager Placement Engine
ECS
AMI
Docker
agent
ECS
agent
EC2 Instance
ECS
AMI
Docker
agent
ECS
agent
EC2 Instance
ECS
AMI
Docker
agent
ECS
agent
EC2 Instance
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 and AWS Fargate Hybrid cluster
ECS Instance ECS Instance ECS Instance ECS InstanceECS Instance ECS Instance
EC2
FARGATE
Notifications
Amazon ECS CLUSTER
Availability Zone #1 Availability Zone #2 Availability Zone #3
Subnet 2
172.31.2.0/24
Subnet 1
172.31.1.0/24
Subnet 3
172.31.3.0/24
Web
Shopping
Cart
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Fargate
Define application containers: Image
URL, CPU & Memory requirements, etc.
register
Task Definition
create
Cluster
• Infrastructure Isolation
boundary
• IAM Permissions boundary
run
Task
• A running instantiation of
a task definition
• Use Fargate launch type
create
Service
Elastic Load
Balancing
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CPU & Memory specification
Task Level Resources:
• Total CPU/memory across all containers
• Required fields
• Billing dimensions
Units
• CPU: cpu-units. 1 vCPU = 1024 cpu-units
• Memory: MB
Container Level Resources:
• Defines sharing of task resources among
containers
• Optional fields
{
"family": "scorekeep",
"cpu": "1 vCpu",
"memory": "2 gb",
"containerDefinitions": [
{
"name":“scorekeep-frontend",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe“,
"cpu": 256,
"memoryReservation": 512
},
{
"name":“scorekeep-api",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api",
"cpu": 768,
"memoryReservation": 512
}
]
}
Task
Level
Resources
Container
Level
Resources
Task Definition Snippet
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VPC Integration
Launch your Fargate Tasks into subnets
Under the hood :
• We create an Elastic Network Interface (ENI)
• The ENI is allocated a private IP from your subnet
• The ENI is attached to your task
• Your task now has a private IP from your subnet!
You can assign public IPs to your tasks
Configure security groups to control inbound & outbound
traffic
172.31.0.0/16
Subnet
172.31.1.0/24
Other Entities in VPC
EC2 LB DB etc.
Private IP
172.31.1.164
ENI Fargate
TaskPublic /
208.57.73.13 /
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VPC Configuration
{
"family": "scorekeep",
"cpu": "1 vCpu",
"memory": "2 gb",
"networkMode": "awsvpc",
"containerDefinitions": [
{
"name":“scorekeep-frontend",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe",
"cpu": 256,
"memoryReservation": 512
},
{
"name":“scorekeep-api",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api",
"cpu": 768,
"memoryReservation": 512
}
]
}
$ aws ecs run-task ...
-- task-definition scorekeep:1
-- network-configuration
“awsvpcConfiguration = {
subnets=[subnet1-id, subnet2-id],
securityGroups=[sg-id]
}”
Enables ENI
creation &
attachment
to Task
Run Task
Task Definition
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Fargate Storage
Layer Storage Space :
• 10 GB layer storage available per task
across all containers in a single task
• Includes image layers
Ephemeral storage backed by Amazon EBS
Fargate volume Storage :
• 4 GB volume space per task
• Visible across containers
• Configure via task definitions
Image Layers
Writable Layer
Image Layers
Writable Layer
Container 1 Container 2
10 GB per Task
Container 1 Container 2
4 GB Volume Storage
mount
/var/container1/data /var/container2/data
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Fargate pricing
CPU Memory
256 (.25 vCPU) 512MB, 1GB, 2GB
512 (.5 vCPU) 1GB to 4GB
1024 (1 vCPU) 2GB to 8GB
2048 (2 vCPU) 4GB to 16GB
4096 (4 vCPU) 8GB to 30GB
1 vCPU = $0.04656/hour
1 GB Mem = $0.00511/hour
50 different CPU/memory configurations
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!

More Related Content

What's hot (20)

PDF
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
Amazon Web Services Korea
 
PDF
AWS Black Belt Techシリーズ AWS Management Console
Amazon Web Services Japan
 
PDF
[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...
Amazon Web Services Korea
 
PDF
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
Amazon Web Services Korea
 
PDF
IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트)
Amazon Web Services Korea
 
PDF
AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...
Amazon Web Services Korea
 
PDF
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
Amazon Web Services Korea
 
PDF
AWS Black Belt Techシリーズ AWS Direct Connect
Amazon Web Services Japan
 
PDF
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
Amazon Web Services Japan
 
PDF
비즈니스 혁신 가속화와 효과적 규정 준수를 위한 AWS ISMS 소개::신종회::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PPTX
AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3
Amazon Web Services Korea
 
PDF
고급 클라우드 아키텍처 방법론- 양승도 솔루션즈 아키텍트:: AWS Cloud Track 2 Advanced
Amazon Web Services Korea
 
PDF
AWSからのメール送信
Amazon Web Services Japan
 
PDF
Amazon VPC와 ELB/Direct Connect/VPN 알아보기 - 김세준, AWS 솔루션즈 아키텍트
Amazon Web Services Korea
 
PDF
Security on AWS :: 이경수 솔루션즈아키텍트
Amazon Web Services Korea
 
PDF
AWS Transit Gateway를 통한 Multi-VPC 아키텍처 패턴 - 강동환 솔루션즈 아키텍트, AWS :: AWS Summit ...
Amazon Web Services Korea
 
PDF
컨텐트 협업플랫폼 Amazon WorkDocs 활용하기 - 박상희 상무, 한글과컴퓨터 / Ben Fitzpatrick, Head of Bu...
Amazon Web Services Korea
 
PDF
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
Amazon Web Services Japan
 
PDF
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
Amazon Web Services Japan
 
PDF
AWS AutoScaling
Mahesh Raj
 
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
Amazon Web Services Korea
 
AWS Black Belt Techシリーズ AWS Management Console
Amazon Web Services Japan
 
[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...
Amazon Web Services Korea
 
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
Amazon Web Services Korea
 
IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트)
Amazon Web Services Korea
 
AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...
Amazon Web Services Korea
 
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
Amazon Web Services Korea
 
AWS Black Belt Techシリーズ AWS Direct Connect
Amazon Web Services Japan
 
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
Amazon Web Services Japan
 
비즈니스 혁신 가속화와 효과적 규정 준수를 위한 AWS ISMS 소개::신종회::AWS Summit Seoul 2018
Amazon Web Services Korea
 
AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3
Amazon Web Services Korea
 
고급 클라우드 아키텍처 방법론- 양승도 솔루션즈 아키텍트:: AWS Cloud Track 2 Advanced
Amazon Web Services Korea
 
AWSからのメール送信
Amazon Web Services Japan
 
Amazon VPC와 ELB/Direct Connect/VPN 알아보기 - 김세준, AWS 솔루션즈 아키텍트
Amazon Web Services Korea
 
Security on AWS :: 이경수 솔루션즈아키텍트
Amazon Web Services Korea
 
AWS Transit Gateway를 통한 Multi-VPC 아키텍처 패턴 - 강동환 솔루션즈 아키텍트, AWS :: AWS Summit ...
Amazon Web Services Korea
 
컨텐트 협업플랫폼 Amazon WorkDocs 활용하기 - 박상희 상무, 한글과컴퓨터 / Ben Fitzpatrick, Head of Bu...
Amazon Web Services Korea
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
Amazon Web Services Japan
 
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
Amazon Web Services Japan
 
AWS AutoScaling
Mahesh Raj
 

Similar to Container, Container, Container -유재석 (AWS 솔루션즈 아키텍트) (20)

PDF
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
 
PDF
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
 
PDF
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
Amazon Web Services Korea
 
PDF
K8s, Amazon EKS - 유재석, AWS 솔루션즈 아키텍트
Amazon Web Services Korea
 
PDF
Docker kubernetes fundamental(pod_service)_190307
Inhye Park
 
PDF
[Games on AWS 2019] AWS 입문자를 위한 초단기 레벨업 트랙 | AWS 레벨업 하기! : 컨테이너 - 김세호 AWS 솔루션...
Amazon Web Services Korea
 
PPTX
Introduction to Amazon EC2 Container Service and setting up build pipeline wi...
Swapnil Dahiphale
 
PPTX
AWS SSA Webinar 12 - Getting started on AWS with Containers
Cobus Bernard
 
PDF
Creating docker custom image
t lc
 
PDF
Creating docker custom image
t lc
 
PDF
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
Amazon Web Services Korea
 
PDF
Amazon EC2 Container Service in Action
Remotty
 
PDF
Amazon ECS (March 2016)
Julien SIMON
 
PPTX
Docker on Amazon ECS
Deepak Kumar
 
PPTX
Getting Started With Docker on AWS
Mikhail Prudnikov
 
PDF
EC2 Container Service
WhiteHedge Technologies Inc.
 
PDF
AWS re:Invent re:Cap - 배포를 더욱 손쉽고 빠르게: Amazon EC2 Container Service - 김일호
Amazon Web Services Korea
 
PDF
Amazon Container 환경의 보안 – 최인영, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
Amazon Web Services Korea
 
PDF
Running your dockerized application(s) on AWS Elastic Container Service
Marco Pas
 
PDF
9thMeetup-20190316-CI/CD 기반의 Microservice 배포
DongHee Lee
 
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
 
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
 
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
Amazon Web Services Korea
 
K8s, Amazon EKS - 유재석, AWS 솔루션즈 아키텍트
Amazon Web Services Korea
 
Docker kubernetes fundamental(pod_service)_190307
Inhye Park
 
[Games on AWS 2019] AWS 입문자를 위한 초단기 레벨업 트랙 | AWS 레벨업 하기! : 컨테이너 - 김세호 AWS 솔루션...
Amazon Web Services Korea
 
Introduction to Amazon EC2 Container Service and setting up build pipeline wi...
Swapnil Dahiphale
 
AWS SSA Webinar 12 - Getting started on AWS with Containers
Cobus Bernard
 
Creating docker custom image
t lc
 
Creating docker custom image
t lc
 
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
Amazon Web Services Korea
 
Amazon EC2 Container Service in Action
Remotty
 
Amazon ECS (March 2016)
Julien SIMON
 
Docker on Amazon ECS
Deepak Kumar
 
Getting Started With Docker on AWS
Mikhail Prudnikov
 
EC2 Container Service
WhiteHedge Technologies Inc.
 
AWS re:Invent re:Cap - 배포를 더욱 손쉽고 빠르게: Amazon EC2 Container Service - 김일호
Amazon Web Services Korea
 
Amazon Container 환경의 보안 – 최인영, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
Amazon Web Services Korea
 
Running your dockerized application(s) on AWS Elastic Container Service
Marco Pas
 
9thMeetup-20190316-CI/CD 기반의 Microservice 배포
DongHee Lee
 
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
 
Ad

Recently uploaded (20)

PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PPTX
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
PDF
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
July Patch Tuesday
Ivanti
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 

Container, Container, Container -유재석 (AWS 솔루션즈 아키텍트)

  • 1. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Jaeseok Yoo Container, Container, Container …
  • 2. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Time 9:30 - 11:00 Docker & Container Orchestration k8s, Amazon EKS HoL: Launch EKS Cluster 11:00 – 11:15 Beak 11:15 – 12:30 HoL: Deploy Dashboard, Microservices, Logging 12:30 – 14:00 Launch 14:00 – 15:00 Amazon ECS, AWS Fargate 15:00 – 16:45 HoL: Dedicated game server operation 16:45 – 17:00 Clean Up
  • 3. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Docker
  • 4. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 애플리케이션의 구성 런 타임 엔진 코드 디펜던시 구성
  • 5. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • 다른 애플리케이션 스택 • 다른 하드웨어 배포 환경 • 다른 환경에서 애플리케이션을 실행하는 효율적인 방법은? • 다른 환경으로 쉽게 마이그레이션하는 방법은? 문제점
  • 6. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 솔루션 - 도커 이식성 : 이미지 기반 배포 유연성 : 마이크로 서비스 모듈화 신속성 : 가벼운 도커 이미지 효율성 : OS kernel 공유
  • 7. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. VM과 컨테이너 비교 Server (Host) Host OS Hypervisor App 2 Guest OS Guest OS Guest OS Bins/Libs Bins/Libs Bins/Libs App 1 App 3 VM Server (Host) Host OS Docker Bins/Libs Bins/Libs Bins/Libs App 1 App 2 App 3 Container Hypervisor Guest OS
  • 8. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Docker 이미지 구성 bootfs kernel Base image Image Image W ritable Container add nginx add nodejs U buntu References parent image Base Image : 템플릿으로 사용되는 읽기 전용 이미지 Base Image에서 시작해서 커스텀 Image 추가하는 방식 Dockerfile 활용하여 손쉽게 배포 관련 구성 설정 및 재배포에 용이함
  • 9. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Dockerfile # our base image FROM alpine:3.5 # Install python and pip RUN apk add --update py2-pip # install Python modules needed by the Python app COPY requirements.txt /usr/src/app/ RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt # copy files required for the app to run COPY app.py /usr/src/app/ COPY templates/index.html /usr/src/app/templates/ # tell the port number the container should expose EXPOSE 5000 # run the application CMD ["python", "/usr/src/app/app.py"] $ docker build -t <YOUR_USERNAME>/myfirstapp . Sending build context to Docker daemon 9.728 kB Step 1 : FROM alpine:latest ---> 0d81fc72e790 Step 2 : RUN apk add --update py-pip ---> 976a232ac4ad Removing intermediate container 8abd4091b5f5 Step 3 : COPY requirements.txt /usr/src/app/ ---> 65b4be05340c Step 4 : RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt ---> 8de73b0730c2 Step 5 : COPY app.py /usr/src/app/ … Dockerfile은 컨테이너 내부 이미지 환경 및 구성 정의
  • 10. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 고객사례 - Nextdoor Base OS version Apt packages: OpenSSL libpq syslog-ng Datadog Python runtime PyPI packages: Boto Django Mapnik SendGrid Source code Static assets Images JS CSS
  • 11. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Layer 별 각기 다른 업데이트 주기 Quarterly Weekly/ monthly Continuous
  • 12. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AMI에서 Docker Container로 변경 Base OS layer System packages Python packages Nextdoor source
  • 13. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Docker 이전에는 빌드 20분 소요 chroot sudo apt-get install sudo pip install git clone make install dpkg create
  • 14. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Base image , system deps 추가 FROM hub.corp.nextdoor.com/nextdoor/nd_base:precise ADD app/docker/scripts/apt-fast app/docker/scripts/system-deps.sh /deps/ RUN /deps/system-deps.sh
  • 15. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Python virtualenv 설정 업데이트 ADD app/docker/scripts/venv-deps.sh app/apps/nextdoor/etc/requirements*.txt app/apps/nextdoor/etc/nextdoor.yml app/services/scheduler/etc/scheduler.yml app/services/supervisor/etc/supervisor.yml /deps/ RUN /deps/venv-deps.sh
  • 16. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. App 소스 업데이트 ADD app/static/nextdoorv2/images /app/static/nextdoorv2/images ADD app/thrift /deps/thrift ADD app/nd /deps/nd ADD app /app
  • 17. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 빌드 시간 20분 -> 평균 2분 ECS에 최종 배포까지 평균 5분
  • 18. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Common Questions • How do I deploy my containers to hosts? • How do I do zero downtime or blue green deployments? • How do I keep my containers alive? • How can my containers talk to each other? • Linking? Service Discovery? • How can I configure my containers at runtime? • What about secrets? • How do I best optimize my "pool of compute”?
  • 19. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How do we make this work at scale?
  • 20. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. We need to • start, stop, and monitor lots of containers running on lots of hosts • decide when and where to start or stop containers • control our hosts and monitor their status • manage rollouts of new code (containers) to our hosts • manage how traffic flows to containers and how requests are routed
  • 21. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Container Orchestration Instance Instance Instance OS OS OS Container Runtime Container Runtime Container Runtime App Service App App Service Service Container Orchestration
  • 22. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Container Orchestration myJob: { Cpu: 10 Mem: 256 } Orchestrator Schedule Run “myJob”
  • 23. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Container Orchestration Instance/OS Instance/OS Instance/OS App Service App App Service Service Service Management Scheduling Resource Management OrchestrationService Management §Availability §Lifecycle §Discovery
  • 24. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Container Orchestration Instance/OS Instance/OS Instance/OS App Service App App Service Service Service Management Scheduling Resource Management Orchestration Scheduling §Placement §Scaling §Upgrades §Rollbacks
  • 25. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Container Orchestration Instance/OS Instance/OS Instance/OS App Service App App Service Service Service Management Scheduling Resource Management Orchestration Resource Management § Memory § CPU § Ports
  • 26. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What are container orchestration tools?
  • 27. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Container Services Landscape MANAGEMENT Deployment, Scheduling, Scaling & Management of containerized applications HOSTING Where the containers run Amazon Elastic Container Service Amazon Elastic Container Service for Kubernetes Amazon EC2 AWS Fargate IMAGE REGISTRY Container Image Repository GA : June 6, 2018 Seoul : Jan 11, 2019 Amazon Elastic Container Registry
  • 28. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 29. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon ECS EC2 INSTANCES LOAD BALANCER Internet ECS AGENT TASK Container TASK Container ECS AGENT TASK Container TASK Container AGENT COMMUNICATION SERVICE Amazon ECS API CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE ECS AGENT TASK Container TASK Container LOAD BALANCER
  • 30. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon ECS : Cluster EC2 INSTANCES LOAD BALANCER Internet ECS AGENT TASK Container TASK Container ECS AGENT TASK Container TASK Container AGENT COMMUNICATION SERVICE Amazon ECS API CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE ECS AGENT TASK Container TASK Container LOAD BALANCER
  • 31. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon ECS : Task EC2 INSTANCES LOAD BALANCER Internet ECS AGENT TASK Container TASK Container ECS AGENT TASK Container TASK Container AGENT COMMUNICATION SERVICE Amazon ECS API CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE ECS AGENT TASK Container TASK Container LOAD BALANCER
  • 32. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Tasks are defined via Task Definitions { "containerDefinitions": [ { "name": "simple-app", "image": "httpd:2.4", "cpu": 10, "memory": 300, "portMappings": [ { "hostPort": 80, "containerPort": 80, "protocol": "tcp" } ], "essential": true, "mountPoints": [ { "containerPath": "/usr/local/apache2/htdocs", "sourceVolume": "my-vol" } ] }, { "name": "busybox", "image": "busybox", "cpu": 10, "memory": 200, "volumesFrom": [ { "sourceContainer": "simple-app" } ], "command": [ "/bin/sh -c "..."" ], "essential": false } ], "volumes": [ { "name": “my-vol" } ] }
  • 33. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Tasks are defined via Task Definitions { "containerDefinitions": [ { "name": "simple-app", "image": "httpd:2.4", "cpu": 10, "memory": 300, "portMappings": [ { "hostPort": 80, "containerPort": 80, "protocol": "tcp" } ], "essential": true, "mountPoints": [ { "containerPath": "/usr/local/apache2/htdocs", "sourceVolume": "my-vol" } ] }, 10 CPU units (1024 is a full CPU) 300 MB of memory Expose port 80 in container to port 80 on host Create and mount volumes Essential to our task
  • 34. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Tasks are defined via Task Definitions { "name": "busybox", "image": "busybox", "cpu": 10, "memory": 200, "volumesFrom": [ { "sourceContainer": "simple-app" } ], "command": [ "/bin/sh -c "..."" ], "essential": false } ], "volumes": [ { "name": “my-vol" } ] } From Docker Hub Mount volume from other container Command to exec Volumes
  • 35. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Task log to CloudWatch Logs CloudWatch Logs Amazon S3 Amazon Kinesis AWS Lambda Amazon ElasticSearch Amazon ECS Store Stream Process Search CloudWatch Logs CloudWatch Logs CloudWatch Logs
  • 36. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. IAM Task Role AWS IAM Amazon DynamoDB S3 AWS IAM DynamoDBRole S3Role Amazon ECS IAM Task Role Identity Access Management (IAM) ECS Task
  • 37. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Task Placement Constraints Name Example AMI ID attribute:ecs.ami-id == ami- eca289fb Availability Zone attribute:ecs.availability- zone == us-east-1a Instance Type attribute:ecs.instance-type == t2.small Distinct Instances type=“distinctInstance” Custom attribute:stack == prod Cluster Constraints Custom Constraints Placement Strategies Apply Filter CPU, memory, port requirements AZ, EC2 type, AMI, or custom constraints Spread or Binpack placement strategy Select final instances for task deployment
  • 38. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Task Placement Strategies Binpacking Spread Affinity Distinct Instance
  • 39. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon ECS : Service EC2 INSTANCES LOAD BALANCER Internet ECS AGENT TASK Container TASK Container ECS AGENT TASK Container TASK Container AGENT COMMUNICATION SERVICE Amazon ECS API CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE ECS AGENT TASK Container TASK Container LOAD BALANCER
  • 40. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CloudWatch ECS Metric 2 Dimensions • ClusterName • ServiceName 4 metrics • CPUReservation • MemoryReservation • CPUUtilization • MemoryUtilization Container Instance … Cluster Task definition Task Service CloudWatch ECS Metrics CloudWatch EC2 Metrics Container Instance Container Instance
  • 41. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ECS Cluster (EC2 Instance) Auto Scale out Event: Per cluster CPU, memory reservation, or usage New services ECS ECS cluster CloudWatch Developers CloudWatch event
  • 42. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ECS Cluster (EC2 Instance) Auto Scale in Draining ECS ECS cluster CloudWatch Event: Per cluster CPU, memory reservation, or usage
  • 43. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Service Auto Scaling Amazon EC2 Service Resource buffer (+~15%)
  • 44. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Auto Scaling Target Tracking Only need to set the target value for the metric (ex: CPU utilization 50%) Auto Scaling automatically adjusts the Task DesiredCount in Service CloudWatch metric ECSServiceAverageCPUUtilization ECSServiceAverageMemoryUtilization ALBRequestCountPerTarget CPUTraffic DesiredCount Time 100% 0% 50% 10% 20% 30% 40% 60% 70% 80% 90% 5 30 10 15 20 25 Target CPU Utilization DesiredCount
  • 45. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 46. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Fargate : Only focus on tasks! Simple, Easy, efficient Serverless Container! =No EC2 Instances to provision, scale or manage ECS Native API , Integrated with VPC, ELB, IAM, CloudWatch and more Pay for CPU, Memory Usage
  • 47. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Fargate Scheduling and Orchestration Cluster Manager Placement Engine ECS AMI Docker agent ECS agent EC2 Instance ECS AMI Docker agent ECS agent EC2 Instance ECS AMI Docker agent ECS agent EC2 Instance
  • 48. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon EC2 and AWS Fargate Hybrid cluster ECS Instance ECS Instance ECS Instance ECS InstanceECS Instance ECS Instance EC2 FARGATE Notifications Amazon ECS CLUSTER Availability Zone #1 Availability Zone #2 Availability Zone #3 Subnet 2 172.31.2.0/24 Subnet 1 172.31.1.0/24 Subnet 3 172.31.3.0/24 Web Shopping Cart
  • 49. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Fargate Define application containers: Image URL, CPU & Memory requirements, etc. register Task Definition create Cluster • Infrastructure Isolation boundary • IAM Permissions boundary run Task • A running instantiation of a task definition • Use Fargate launch type create Service Elastic Load Balancing
  • 50. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CPU & Memory specification Task Level Resources: • Total CPU/memory across all containers • Required fields • Billing dimensions Units • CPU: cpu-units. 1 vCPU = 1024 cpu-units • Memory: MB Container Level Resources: • Defines sharing of task resources among containers • Optional fields { "family": "scorekeep", "cpu": "1 vCpu", "memory": "2 gb", "containerDefinitions": [ { "name":“scorekeep-frontend", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe“, "cpu": 256, "memoryReservation": 512 }, { "name":“scorekeep-api", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api", "cpu": 768, "memoryReservation": 512 } ] } Task Level Resources Container Level Resources Task Definition Snippet
  • 51. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. VPC Integration Launch your Fargate Tasks into subnets Under the hood : • We create an Elastic Network Interface (ENI) • The ENI is allocated a private IP from your subnet • The ENI is attached to your task • Your task now has a private IP from your subnet! You can assign public IPs to your tasks Configure security groups to control inbound & outbound traffic 172.31.0.0/16 Subnet 172.31.1.0/24 Other Entities in VPC EC2 LB DB etc. Private IP 172.31.1.164 ENI Fargate TaskPublic / 208.57.73.13 /
  • 52. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. VPC Configuration { "family": "scorekeep", "cpu": "1 vCpu", "memory": "2 gb", "networkMode": "awsvpc", "containerDefinitions": [ { "name":“scorekeep-frontend", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe", "cpu": 256, "memoryReservation": 512 }, { "name":“scorekeep-api", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api", "cpu": 768, "memoryReservation": 512 } ] } $ aws ecs run-task ... -- task-definition scorekeep:1 -- network-configuration “awsvpcConfiguration = { subnets=[subnet1-id, subnet2-id], securityGroups=[sg-id] }” Enables ENI creation & attachment to Task Run Task Task Definition
  • 53. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Fargate Storage Layer Storage Space : • 10 GB layer storage available per task across all containers in a single task • Includes image layers Ephemeral storage backed by Amazon EBS Fargate volume Storage : • 4 GB volume space per task • Visible across containers • Configure via task definitions Image Layers Writable Layer Image Layers Writable Layer Container 1 Container 2 10 GB per Task Container 1 Container 2 4 GB Volume Storage mount /var/container1/data /var/container2/data
  • 54. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Fargate pricing CPU Memory 256 (.25 vCPU) 512MB, 1GB, 2GB 512 (.5 vCPU) 1GB to 4GB 1024 (1 vCPU) 2GB to 8GB 2048 (2 vCPU) 4GB to 16GB 4096 (4 vCPU) 8GB to 30GB 1 vCPU = $0.04656/hour 1 GB Mem = $0.00511/hour 50 different CPU/memory configurations
  • 55. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you!