Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Managing Containers at Scale
Danilo Poccia
AWS Technical Evangelist
@danilop
danilop
Containers
Host
Guest OS
Bins / Libs Bins / Libs
App 1 App 2
Containers
OS virtualization
Process isolation
Images
Automation
Host
Guest OS
Bins / Libs Bins / Libs
App 1 App 2
Portable
Host
Guest OS
Bins / Libs Bins / Libs
App 1 App 2
Flexible
Host
Guest OS
Bins / Libs Bins / Libs
App 1 App 2
Fast
Host
Guest OS
Bins / Libs Bins / Libs
App 1 App 2
Efficient
Host
Guest OS
Bins / Libs Bins / Libs
App 1 App 2
Host
Guest OS
Bins / Libs Bins / Libs
App 1 App 2
Host
Guest OS
Bins / Libs Bins / Libs
App 1 App 2
Host
Guest OS
Bins / Libs Bins / Libs
App 1 App 2
Host
Guest OS
Bins / L...
Amazon EC2 Container Service

(ECS)
{
"containerDefinitions": [
{
"name": "simple-app",
"image": "httpd:2.4",
"cpu": 10,
"memory": 300,
"portMappings": [
{
"h...
{
"containerDefinitions": [
{
"name": "simple-app",
"image": "httpd:2.4",
"cpu": 10,
"memory": 300,
"portMappings": [
{
"h...
{
"name": "busybox",
"image": "busybox",
"cpu": 10,
"memory": 200,
"volumesFrom": [
{
"sourceContainer": "simple-app"
}
],...
Internet
AZ #1 AZ #2 AZ #3
Amazon

ECS
Agent Communication Service API
Key / Value Store
Cluster Management Engine
Internet
Cluster
AZ #1 AZ #2 AZ #3
Amazon

ECS
Agent Communication Service API
Key / Value Store
Cluster Management Engine...
Internet
Cluster
AZ #1 AZ #2 AZ #3
Amazon

ECS
Agent Communication Service API
ECS AgentECS Agent ECS Agent ECS Agent ECS ...
Internet
Cluster
AZ #1 AZ #2 AZ #3
Amazon

ECS
Key / Value Store
Cluster Management Engine
Agent Communication Service API...
Internet
Cluster
AZ #1 AZ #2 AZ #3
Amazon

ECS
Agent Communication Service API
ECS AgentECS Agent ECS Agent ECS Agent ECS ...
Internet
Cluster
AZ #1 AZ #2 AZ #3
Amazon

ECS
Agent Communication Service API
ECS AgentECS Agent ECS Agent ECS Agent ECS ...
Internet
Cluster
AZ #1 AZ #2 AZ #3
Amazon

ECS
Agent Communication Service API
ECS AgentECS Agent
Task
A
C
V
C C
V
ECS Age...
Internet
Cluster
AZ #1 AZ #2 AZ #3
Amazon

ECS
Agent Communication Service API
ECS AgentECS Agent
Task
A
C
V
C C
V
ECS Age...
Internet
Cluster
AZ #1 AZ #2 AZ #3
Amazon

ECS
Agent Communication Service API
ECS Agent
Task
B
C C
V
ECS Agent
Task
A
C
V...
Internet
Cluster
AZ #1 AZ #2 AZ #3
Amazon

ECS
Agent Communication Service API
ECS Agent
Task
B
C C
V
ECS Agent
Task
A
C
V...
Internet
Cluster
AZ #1 AZ #2 AZ #3
Amazon

ECS
Agent Communication Service API
ECS Agent
Task
B
C C
V
ECS Agent
Task
A
C
V...
Internet
Cluster
AZ #1 AZ #2 AZ #3
Amazon

ECS
Agent Communication Service API
User / Scheduler
ECS Agent
Task
B
C C
V
ECS...
Internet
Cluster
AZ #1 AZ #2 AZ #3
Amazon

ECS
Agent Communication Service API
User / Scheduler
ECS Agent
Task
B
C C
V
ECS...
Cluster
Container Instance
Amazon ECS Agent
Task Definitions
Tasks
Services
Designed for use with other AWS services
Elastic Load Balancing
Amazon Elastic Block Store
Amazon Virtual Private Cloud
AW...
Elastic Load Balancing
Circuit breaker
"Jtecul" by own - Own work.
Licensed under CC BY-SA 3.0 via Wikimedia Commons
http:...
Infrastructure as Code
Manage your Cluster(s) with
AWS CloudFormation + Auto Scaling
B
estPractice
Extensible
Comprehensive APIs
Open source agent
Custom schedulers
https://github.com/aws/amazon-ecs-agent
https://github.com/awslabs/ecs-mesos-scheduler-driver
“awslogs” driver for Amazon CloudWatch Logs
https://github.com/cloudbees/amazon-ecs-plugin
http://gliderlabs.com/registratorhttps://www.consul.io
Service Discovery via Consul with Amazon ECS
Service Discovery and Load Balancing with Weave on Amazon ECS
http://weave.works/guides/service-discovery-with-weave-aws-e...
“Amazon ECS enabled Coursera

to focus on releasing new software

rather than spending time managing clusters.”
Frank Chen...
<demo>
…
</demo>
You will soon be able to use
Docker Compose and Docker Swarm
to develop your application cluster on your desktop
and then ...
O
pen
C
ontainer

Initiative
Your feedback is important to AWS
Tell us what you think
Focus on You Idea
No additional cost
for using Amazon ECS
You pay for the underling
resources you use
aws.amazon.com/free
Managing Containers at Scale
Danilo Poccia
AWS Technical Evangelist
@danilop
danilop
Upcoming SlideShare
Loading in …5
×

Managing Containers at Scale

685 views

Published on

Using Amazon EC2 Container Service (ECS) to manage Docker containers in production with high availability and scalability. From the Docker Meetup in Leuven, Belgium on October 1st, 2015.

Published in: Software
  • Be the first to comment

Managing Containers at Scale

  1. 1. Managing Containers at Scale Danilo Poccia AWS Technical Evangelist @danilop danilop
  2. 2. Containers
  3. 3. Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Containers OS virtualization Process isolation Images Automation
  4. 4. Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Portable
  5. 5. Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Flexible
  6. 6. Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Fast
  7. 7. Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Efficient
  8. 8. Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2
  9. 9. Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2 Host Guest OS Bins / Libs Bins / Libs App 1 App 2
  10. 10. Amazon EC2 Container Service
 (ECS)
  11. 11. { "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" } ] } Task Definition
  12. 12. { "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" } ] }, Task Definition 10 CPU units (1024 is a full CPU) 500 MB of memory Expose port 80 in container to port 80 on host Create and mount volumes Essential to our task
  13. 13. { "name": "busybox", "image": "busybox", "cpu": 10, "memory": 200, "volumesFrom": [ { "sourceContainer": "simple-app" } ], "command": [ "/bin/sh -c "..."" ], "essential": false } ], "volumes": [ { "name": “my-vol" } ] } Task Definition From Docker Hub Mount volume from other container Command to exec Volumes
  14. 14. Internet AZ #1 AZ #2 AZ #3 Amazon
 ECS Agent Communication Service API Key / Value Store Cluster Management Engine
  15. 15. Internet Cluster AZ #1 AZ #2 AZ #3 Amazon
 ECS Agent Communication Service API Key / Value Store Cluster Management Engine Create Cluster
  16. 16. Internet Cluster AZ #1 AZ #2 AZ #3 Amazon
 ECS Agent Communication Service API ECS AgentECS Agent ECS Agent ECS Agent ECS Agent ECS Agent Container Instance Container Instance Container Instance Container Instance Container Instance Container Instance Key / Value Store Cluster Management Engine Register Container Instance(s)
  17. 17. Internet Cluster AZ #1 AZ #2 AZ #3 Amazon
 ECS Key / Value Store Cluster Management Engine Agent Communication Service API ECS AgentECS Agent ECS Agent ECS Agent ECS Agent ECS Agent Container Instance Container Instance Container Instance Container Instance Container Instance Task
 Definitions Task
 Definitions Container Instance Task
 Definitions Register Task Definition(s)
  18. 18. Internet Cluster AZ #1 AZ #2 AZ #3 Amazon
 ECS Agent Communication Service API ECS AgentECS Agent ECS Agent ECS Agent ECS Agent ECS Agent Task C C C VV Container Instance Container Instance Container Instance Container Instance Container Instance Container Instance Key / Value Store Cluster Management Engine Task
 Definitions Task
 Definitions Task
 Definitions Run Task “C”
  19. 19. Internet Cluster AZ #1 AZ #2 AZ #3 Amazon
 ECS Agent Communication Service API ECS AgentECS Agent ECS Agent ECS Agent ECS Agent ECS Agent Container Instance Container Instance Container Instance Container Instance Container Instance Container Instance Key / Value Store Cluster Management Engine Task
 Definitions Task
 Definitions Task
 Definitions
  20. 20. Internet Cluster AZ #1 AZ #2 AZ #3 Amazon
 ECS Agent Communication Service API ECS AgentECS Agent Task A C V C C V ECS Agent Task A C V C C V ECS Agent ECS Agent ECS Agent Service A Container Instance Container Instance Container Instance Container Instance Container Instance Container Instance Key / Value Store Cluster Management Engine Task
 Definitions Task
 Definitions Task
 Definitions Create Service “A”
  21. 21. Internet Cluster AZ #1 AZ #2 AZ #3 Amazon
 ECS Agent Communication Service API ECS AgentECS Agent Task A C V C C V ECS Agent Task A C V C C V ECS Agent ECS Agent Task A C V C C V ECS Agent Service A Container Instance Container Instance Container Instance Container Instance Container Instance Container Instance Key / Value Store Cluster Management Engine Task
 Definitions Task
 Definitions Task
 Definitions Update Service “A”
  22. 22. Internet Cluster AZ #1 AZ #2 AZ #3 Amazon
 ECS Agent Communication Service API ECS Agent Task B C C V ECS Agent Task A C V C C V Task B C C V ECS Agent Task A C V C C V Task B C C V ECS Agent Task B C C V ECS Agent Task A C V C C V ECS Agent Task B C C V Service A Service B Container Instance Container Instance Container Instance Container Instance Container Instance Container Instance Key / Value Store Cluster Management Engine Task
 Definitions Task
 Definitions Task
 Definitions Create Service “B”
  23. 23. Internet Cluster AZ #1 AZ #2 AZ #3 Amazon
 ECS Agent Communication Service API ECS Agent Task B C C V ECS Agent Task A C V C C V Task B C C V ECS Agent Task A C V C C V Task B C C V ECS Agent Task B C C V ECS Agent Task A C V C C V Task C C C V ECS Agent Task B C C V Service A Service B V Container Instance Container Instance Container Instance Container Instance Container Instance Container Instance Key / Value Store Cluster Management Engine Task
 Definitions Task
 Definitions Task
 Definitions Run Task “C”
  24. 24. Internet Cluster AZ #1 AZ #2 AZ #3 Amazon
 ECS Agent Communication Service API ECS Agent Task B C C V ECS Agent Task A C V C C V Task B C C V ECS Agent Task A C V C C V Task B C C V ECS Agent Task B C C V ECS Agent Task A C V C C V ECS Agent Task B C C V Service A Service B Container Instance Container Instance Container Instance Container Instance Container Instance Container Instance Key / Value Store Cluster Management Engine Task
 Definitions Task
 Definitions Task
 Definitions
  25. 25. Internet Cluster AZ #1 AZ #2 AZ #3 Amazon
 ECS Agent Communication Service API User / Scheduler ECS Agent Task B C C V ECS Agent Task A C V C C V Task B C C V ECS Agent Task A C V C C V Task B C C V ECS Agent Task B C C V ECS Agent Task A C V C C V ECS Agent Task B C C V Service A Service B Container Instance Container Instance Container Instance Container Instance Container Instance Container Instance Key / Value Store Cluster Management Engine Task
 Definitions Task
 Definitions Task
 Definitions Custom Scheduler
  26. 26. Internet Cluster AZ #1 AZ #2 AZ #3 Amazon
 ECS Agent Communication Service API User / Scheduler ECS Agent Task B C C V ECS Agent Task A C V C C V Task B C C V ECS Agent Task A C V C C V Task B C C V ECS Agent Task B C C V ECS Agent Task A C V C C V ECS Agent Task B C C V Service A Service B Container Instance Container Instance Container Instance Container Instance Container Instance Container Instance Key / Value Store Cluster Management Engine Task
 Definitions Task
 Definitions Task
 Definitions
  27. 27. Cluster Container Instance Amazon ECS Agent Task Definitions Tasks Services
  28. 28. Designed for use with other AWS services Elastic Load Balancing Amazon Elastic Block Store Amazon Virtual Private Cloud AWS Identity and Access Management (IAM) AWS CloudTrail
  29. 29. Elastic Load Balancing Circuit breaker "Jtecul" by own - Own work. Licensed under CC BY-SA 3.0 via Wikimedia Commons http://commons.wikimedia.org/wiki/File:Jtecul.jpg#/media/File:Jtecul.jpg B estPractice
  30. 30. Infrastructure as Code Manage your Cluster(s) with AWS CloudFormation + Auto Scaling B estPractice
  31. 31. Extensible Comprehensive APIs Open source agent Custom schedulers
  32. 32. https://github.com/aws/amazon-ecs-agent
  33. 33. https://github.com/awslabs/ecs-mesos-scheduler-driver
  34. 34. “awslogs” driver for Amazon CloudWatch Logs
  35. 35. https://github.com/cloudbees/amazon-ecs-plugin
  36. 36. http://gliderlabs.com/registratorhttps://www.consul.io Service Discovery via Consul with Amazon ECS
  37. 37. Service Discovery and Load Balancing with Weave on Amazon ECS http://weave.works/guides/service-discovery-with-weave-aws-ecs.html
  38. 38. “Amazon ECS enabled Coursera
 to focus on releasing new software
 rather than spending time managing clusters.” Frank Chen
 Software Engineer
  39. 39. <demo> … </demo>
  40. 40. You will soon be able to use Docker Compose and Docker Swarm to develop your application cluster on your desktop and then scale into the AWS Cloud C om ing Soon
  41. 41. O pen C ontainer
 Initiative
  42. 42. Your feedback is important to AWS Tell us what you think
  43. 43. Focus on You Idea
  44. 44. No additional cost for using Amazon ECS You pay for the underling resources you use
  45. 45. aws.amazon.com/free
  46. 46. Managing Containers at Scale Danilo Poccia AWS Technical Evangelist @danilop danilop

×