Top Banner
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Matt McClean Solutions Architect, AWS 28 June, 2017 Getting Started with Docker on AWS Chris Pitchford Lead Platform Owner, News UK
84

getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Apr 08, 2018

Download

Documents

doankien
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Matt McCleanSolutions Architect, AWS

28 June, 2017

Getting Started with Docker on AWS

Chris PitchfordLead Platform Owner, News UK

Page 2: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

What to Expect from the Session

• Why Containers ?

• Introduction to EC2 Container Service

• Customer: News UK story

Page 3: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Why Containers?

Page 4: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

What are Containers?

OS virtualization

Process isolation

Images

Automation Server

Guest OS

Bins/Libs Bins/Libs

App2App1

Page 5: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Container advantages

Portable

Flexible

Fast

EfficientServer

Guest OS

Bins/Libs Bins/Libs

App2App1

Page 6: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Scheduling one resource is straightforward

Server

Guest OS

Bins/Libs Bins/Libs

App2App1

Page 7: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Scheduling a cluster is hard

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

Page 8: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Introducing Amazon ECS• Fully managed elastic service – You don’t need

to run anything, and the service scales as your microservices architecture grows

• Shared state optimistic scheduling• Fully ACID compliant resource and state

management• Integration with CloudWatch service for

monitoring and logging• Integration with Code* services for continuous

integration and delivery (CI/CD)

Page 9: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Benefits

Cluster management made easy

Flexible scheduling Integrated and extensible

Security Performance at scale

Page 10: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

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

Page 11: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Flexible Scheduling

Optimal instance placement

Integrate custom or 3rd party scheduler

NEW – Task Placement Engine

Page 12: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

New Placement Constraints & Attributes

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

Page 13: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Anatomy of Task Placement

Cluster Constraints

Custom Constraints

Placement Strategies

Apply Filter

Satisfy CPU, memory, and port requirements

Filter for location, instance-type, AMI, or custom attribute constraints

Identify instances that meet spread or binpack placement strategy

Select final container instances for placement

Page 14: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Integrated and Extensible

Integrated with existing AWS services such as IAM roles and security groups

Extensible through powerful APIs• Use your own scheduler• Connect with existing software delivery

process• NEW - Open source project Blox for

custom schedulers

Page 15: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Security

Isolation boundaries through EC2 instances

VPC only

Security Group and IAM roles support

Page 16: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Performance at Scale

Building block for distributed applications

Coordinates and automates container deployment

Launch thousands of containers in seconds

Page 17: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Scalable

Page 18: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Cluster Management

Page 19: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Cluster Management: Resource Management

DockerTask

EC2 Instance

Container

DockerTask

EC2 Instance

Container

TaskContainer

Docker

EC2 Instance

TaskContainer

AZ 1 AZ 2

Page 20: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Amazon ECS: Agent Communication

DockerTask

Container Instance

Container

ECS Agent

TaskContainer

DockerTask

Container Instance

Container

ECS Agent

TaskContainer

DockerTask

Container Instance

Container

ECS Agent

TaskContainer

AZ 1 AZ 2

Cluster Management Engine

Agent Communication Service

Key/Value Store

Page 21: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Amazon ECS: APIs

DockerTask

Container Instance

Container

ECS Agent

ELB

Internet

ELB

User / Scheduler

API

Cluster Management Engine

TaskContainer

DockerTask

Container Instance

Container

ECS Agent

TaskContainer

DockerTask

Container Instance

Container

ECS Agent

TaskContainer

AZ 1 AZ 2

Key/Value Store

Agent Communication Service

Page 22: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Running Services

Page 23: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Unit of work

Grouping of related Containers

Run on Container Instances

Tasks

Page 24: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Task Definitions

Volume Definitions

Container Definitions

Page 25: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Key Components: Task Definitions

Page 26: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Key Components: Task Definitions

Page 27: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Tasks

Shared Data Volume

Containers

schedule

Container Instance

Volume Definitions

Container Definitions

Page 28: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Create a Service

Good for long-running applications and services

Page 29: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Create ServiceLoad Balance traffic across containers

Automatically recover unhealthy containers

Discover services

Elastic Load Balancing

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

Page 30: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Scale Service

Scale up

Scale down

Elastic Load Balancing

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

Page 31: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Update Service

Deploy new version

Drain connections

new new new

Elastic Load Balancing

Shared Data Volume

Containers

old old old

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

Page 32: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Update Service (cont.)

Deploy new version

Drain connections

new new new

Elastic Load Balancing

Shared Data Volume

Containers

old old old

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

Page 33: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Update Service (cont.)

Deploy new version

Drain connections

Elastic Load Balancing

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

new new new

Page 34: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Monitoring with Amazon CloudWatch

Metric data sent to CloudWatch in 1-minute periods and recorded for a period of two weeksAvailable metrics: CPUReservation, MemoryReservation, CPUUtilization, MemoryUtilizationAvailable dimensions: ClusterName, ServiceName

Page 35: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Monitoring with Amazon CloudWatch

Page 36: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Example Microservice Architecture on ECS

Page 37: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Continuous Delivery to ECS with CodePipeline

4. Push image to Docker registry

2. Build image from sources 3. Run test on image

1. Code push triggers build 5. Update stack

6. Pull image

CodeBuildAWS

CloudFormation

5. Update service

CodePipeline

Page 38: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Customer Story: News UK

Page 39: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

1 London Bridge Street, London SE1 9GFT: 020 7782 8000

Registered Office: Times Newspapers Limited, 1 London Bridge Street, London SE1 9GF.Registered Number: 894646 England & Wales.

1 London Bridge Street, London SE1 9GFT: 020 7782 8000

Registered Office: Times Newspapers Limited, 1 London Bridge Street, London SE1 9GFRegistered Number: 894646 England & Wales

Page 40: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

• AWS since 2011.• 75% to the cloud started 2012.• P2V: Data centres to EC2.• Our Digital has gone all in!

Page 41: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Building our platform

• ELB + AutoScaling Group, each running our AMI.

• Deployed into a VPC with supporting infrastructure.Load Balancer

Auto Scaling

Web servers

virtual private cloud

Database

Caching

Web site assets

Page 42: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Basic App Server

AMI

Building an Image

• Launch a blank EC2 instance.

• Install base apps and configuration.

• Freeze the box into an AMI, ready to be launched.

Page 43: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Deploy at boot

• Our instances boot without the code.

• Our deploy tool downloads our application code.

• The code and config are installed then the webserver starts.Basic App Server

Application bucket

GIT Repo

Working web server

Page 44: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

We’re pretty happy!

Page 45: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

But…

• Building many similar, large AMI takes time and costs. • Auto scaling is less responsive when bootstrapping

wastes minutes.• Can’t upgrade EC2 instances, need to start new ones.• If code fails, EC2 instances are unhealthy so they are

replaced.• Many small stacks have lower efficiency.

Page 46: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

But…

• We’re under utilising what we provision.• We believe isolated infrastructure is the key to stability,

but it comes at a premium.• Anything that reduces cost, increase complexity and

reduces velocity?

Page 47: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

What if I told you…

Containers are the new P2V!

We can move traditional EC2 to virtual containers.

Page 48: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

ECS and Docker to the rescue?

• Using fewer, simpler parts we need less support• Removing repetition means reduced costs (increases

efficiency in costs and time)• ECS does orchestration for us. One less thing to worry

about

Page 49: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

5 mins doing / 5 hours reading

• Install Docker locally, make some images.

• Learn to deploy into EC2 Container Registry.

• Use Elastic Beanstalk to run the images.

AWS Elastic Beanstalk

client

ECR registry

MS SQL instance

bucket

Page 50: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

To the white board!

• Build into images.• Store in ECR.• Run tasks in ECS.

• Tasks cover multiple processes: Dev/QA/Prod.

• Tasks cover multiple sites.

Web Container Cluster

ECR

ContainerBuild

Page 51: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Make it work.

• Code Build replaces AMI builder to produce layers.• ECR replaces the wheelie-bin full of AMI.• ECS Cluster replaces many AutoScaling groups.• ECS Tasks replace ASG deployments.• Application Load Balancer replaces Classic Elastic Load

Balancers, effective sharing with host and path rules.

Page 52: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Oops.

• Sizing application is tricky.• Task placement rules are important.• We want the container images to be read-only, but

sometimes an old script comes back to bite us.

Page 53: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Thank You

Page 54: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Backup

Page 55: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Scale Service

Page 56: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Introducing Blox

Page 57: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

What is Blox?

Choice

Control

Developer Experience

Page 58: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Building with Blox

scheduler cluster state service

Page 59: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Continuous Delivery to ECS with Jenkins

Easy DeploymentDevelopers – Merge into master, done!

Jenkins Build StepsTrigger via webhooks, monitoring, LambdaBuild Docker image via build and publish plugin Push Docker image into registryRegister updated job with ECS API

Page 60: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Amazon ECS Architecture

Page 61: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Service Discovery with Route 53 and Application Load Balancers

New!

Page 62: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Deploying Containers on ECS – Choose a Scheduler

Batch Jobs

ECS task schedulerRun tasks once

Batch jobsRunTask (random) StartTask (placed)

Long-Running Apps

ECS service schedulerHealth managementScale-up and scale-downAZ awareGrouped containers

Page 63: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Scheduling Containers: Long-Running App

Deploy using the least space: minimumHealthyPercent = 50%, maximumPercent = 100%

Page 64: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Scheduling Containers: Long-Running App

Deploy quickly without reducing service capacity: minimumHealthyPercent = 100%, maximumPercent = 200%

Page 65: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Scheduling Containers: Long-Running App

Blue-Green Deployments

• Define two ECS services• Each service is associated w/ load

balancer• Both load balancers in Route 53

record set with weighted routing policy, 100% primary, 0% secondary

• Deploy to blue or green service and switch weights

TaskTask

Route 53 record set

with weighted routing policy

0%100%

Page 66: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Services evolve to microservices

Monolithic Application

Order UI User UI Shipping UI

OrderService

UserService

ShippingService

DataAccess

Host 1

Service A

Service B

Host 2

Service B

Service D

Host 3

Service A

Service C

Host 4

Service B

Service C

Page 67: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Containers are natural for microservices

Any app, any language

Image is the version

Test & deploy same artifact

Stateless servers decrease change risk

Page 68: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Scheduling

Page 69: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

What is Amazon ECS?

Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use Amazon ECS to schedule the placement of containers across your cluster. You can also integrate your own scheduler or third-party scheduler to meet business or application specific requirements.

Page 70: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Amazon ECS under the Hood

IDN-1 IDN IDN+1 IDN+2 IDN+3 IDN+4 IDN+5

IDN+6

IDN+5

WRITE

READ

Page 71: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Amazon ECS under the Hood

IDN-1 IDN IDN+1 IDN+2 IDN+3 IDN+4 IDN+5

IDN+6IDN+3

IDN+5IDN+2

WRITE WRITE

READREAD

Page 72: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Amazon ECS: Scheduling

DockerTask

Container Instance

Container

ECS Agent

ELB

Internet

ELB

User / Scheduler

API

Cluster Management Engine

TaskContainer

DockerTask

Container Instance

Container

ECS Agent

TaskContainer

DockerTask

Container Instance

Container

ECS Agent

TaskContainer

AZ 1 AZ 2

Key/Value Store

Agent Communication Service

Page 73: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Benefits

Page 74: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Easily Manage Clusters for Any Scale

Nothing to run

Complete state

Control and monitoring

Scale

Page 75: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Flexible Container Placement

Applications

Batch jobs

Multiple schedulers

Page 76: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Designed for use with other AWS services

Elastic Load Balancing

Amazon Elastic Block Store

Amazon Virtual Private Cloud

Amazon CloudWatch

AWS Identity and Access Management

AWS CloudTrail

Page 77: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Extensible

Comprehensive APIs

Custom schedulers

Open source agent and CLI

Page 78: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Amazon ECS

DockerTask

Container Instance

Amazon ECS

Container

ECS Agent

ELB

Internet

ELB

User / Scheduler

API

Cluster Management Engine

TaskContainer

DockerTask

Container Instance

Container

ECS Agent

TaskContainer

DockerTask

Container Instance

Container

ECS Agent

TaskContainer

AZ 1 AZ 2

Key/Value Store

Agent Communication Service

Page 79: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Update Service (cont.)

Specify a deployment configuration for your service:• minimumHealthyPercent: lower limit (as a percentage of

the service's desiredCount) of the number of running tasks that must remain running in a service during a deployment.

• maximumPercent: upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment.

Page 80: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Update Service (cont.)Deploy using the least space: minimumHealthyPercent = 50%, maximumPercent = 100%

Page 81: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Update Service (cont.)

Deploy quickly without reducing service capacity: minimumHealthyPercent = 100%, maximumPercent = 200%

Page 82: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Cluster Management: Scheduling

DockerTask

EC2 Instance

Container

DockerTask

EC2 Instance

Container

TaskContainer

Docker

EC2 Instance

TaskContainer

AZ 1 AZ 2

Page 83: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Amazon ECS: Resource Management

DockerTask

Container Instance

Container

TaskContainer

DockerTask

Container Instance

Container

TaskContainer

DockerTask

Container Instance

Container

TaskContainer

AZ 1 AZ 2

Cluster Management Engine

Page 84: getting started with docker on AWS - london-summit …london-summit-slides-2017.s3.amazonaws.com/getting_started_with... · Getting Started with Docker on AWS Chris Pitchford ...

Amazon ECS: Key/Value Store

DockerTask

Container Instance

Container

ECS Agent

ELB

Internet

ELB

TaskContainer

DockerTask

Container Instance

Container

ECS Agent

TaskContainer

DockerTask

Container Instance

Container

ECS Agent

TaskContainer

AZ 1 AZ 2

Key/Value Store

Cluster Management Engine

Agent Communication Service