47
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Asha Chakrabarty, Senior Solutions Architect June 21 st , 2016 Getting started with Docker on AWS

Getting Started with Docker on AWS

Embed Size (px)

Citation preview

Page 1: Getting Started with Docker on AWS

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

Asha Chakrabarty, Senior Solutions Architect

June 21st, 2016

Getting started with Docker

on AWS

Page 2: Getting Started with Docker on AWS
Page 3: Getting Started with Docker on AWS

Agenda

Why Containers?

Cluster Management

Benefits

Running Services

Demo

Page 4: Getting Started with Docker on AWS

Why Containers?

Page 5: Getting Started with Docker on AWS

What are Containers?

OS virtualization

Process isolation

Images

AutomationServer

Guest OS

Bins/Libs Bins/Libs

App2App1

Page 6: Getting Started with Docker on AWS

Container advantages

Portable

Flexible

Fast

EfficientServer

Guest OS

Bins/Libs Bins/Libs

App2App1

Page 7: Getting Started with Docker on AWS

Services evolve to microservices

Monolithic Application

Order UI User UI Shipping UI

Order

ServiceUser

Service

Shipping

Service

Data

Access

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 8: Getting Started with Docker on AWS

Containers are natural for microservices

Simple to model

Any app, any language

Image is the version

Test & deploy same artifact

Stateless servers decrease change risk

Page 9: Getting Started with Docker on AWS

Scheduling

Page 10: Getting Started with Docker on AWS

Server

Guest OS

Bins/Libs Bins/Libs

App2App1

Scheduling one resource is straightforward

Page 11: Getting Started with Docker on AWS

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 12: Getting Started with Docker on AWS

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 13: Getting Started with Docker on AWS

Cluster Management

Page 14: Getting Started with Docker on AWS

Cluster Management: Resource Management

Docker

Task

EC2 Instance

Container

Docker

Task

EC2 Instance

Container

Task

Container

Docker

EC2 Instance

Task

Container

AZ 1 AZ 2

Page 15: Getting Started with Docker on AWS

Cluster Management: Scheduling

Docker

Task

EC2 Instance

Container

Docker

Task

EC2 Instance

Container

Task

Container

Docker

EC2 Instance

Task

Container

AZ 1 AZ 2

Page 16: Getting Started with Docker on AWS

Amazon ECS: Resource Management

Docker

Task

Container Instance

Container

Task

Container

Docker

Task

Container Instance

Container

Task

Container

Docker

Task

Container Instance

Container

Task

Container

AZ 1 AZ 2

Cluster Management Engine

Page 17: Getting Started with Docker on AWS

Amazon ECS: Agent Communication

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

AZ 1 AZ 2

Cluster Management Engine

Agent Communication Service

Page 18: Getting Started with Docker on AWS

Amazon ECS: Key/Value Store

Docker

Task

Container Instance

Container

ECS Agent

ELB

Internet

ELB

Task

Container

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

AZ 1 AZ 2

Key/Value Store

Cluster Management Engine

Agent Communication Service

Page 19: Getting Started with Docker on AWS

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 20: Getting Started with Docker on AWS

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 21: Getting Started with Docker on AWS

Amazon ECS: APIs

Docker

Task

Container Instance

Container

ECS Agent

ELB

Internet

ELB

User /

Scheduler

API

Cluster Management Engine

Task

Container

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

AZ 1 AZ 2

Key/Value Store

Agent Communication Service

Page 22: Getting Started with Docker on AWS

Amazon ECS: Scheduling

Docker

Task

Container Instance

Container

ECS Agent

ELB

Internet

ELB

User /

Scheduler

API

Cluster Management Engine

Task

Container

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

AZ 1 AZ 2

Key/Value Store

Agent Communication Service

Page 23: Getting Started with Docker on AWS

Benefits

Page 24: Getting Started with Docker on AWS

Easily Manage Clusters for Any Scale

Nothing to run

Complete state

Control and monitoring

Scale

Page 25: Getting Started with Docker on AWS

Scalable

Page 26: Getting Started with Docker on AWS

Flexible Container Placement

Applications

Batch jobs

Multiple schedulers

Page 27: Getting Started with Docker on AWS

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 28: Getting Started with Docker on AWS

Extensible

Comprehensive APIs

Custom schedulers

Open source agent and CLI

Page 29: Getting Started with Docker on AWS

Amazon ECS

Docker

Task

Container Instance

Amazon

ECS

Container

ECS Agent

ELB

Internet

ELB

User /

Scheduler

API

Cluster Management Engine

Task

Container

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

AZ 1 AZ 2

Key/Value Store

Agent Communication Service

Page 30: Getting Started with Docker on AWS

Running Services

Page 31: Getting Started with Docker on AWS

Task Definitions

Volume Definitions

Container Definitions

Page 32: Getting Started with Docker on AWS

Key Components: Task Definitions

Page 33: Getting Started with Docker on AWS

Key Components: Task Definitions

Page 34: Getting Started with Docker on AWS

Tasks

Shared Data Volume

Containers

scheduleContainer

Instance

Volume Definitions

Container Definitions

Page 35: Getting Started with Docker on AWS

Tasks

Unit of work

Grouping of related Containers

Run on Container Instances

Page 36: Getting Started with Docker on AWS

Create a Service

Good for long-running

applications and services

Page 37: Getting Started with Docker on AWS

Create Service

Load 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 38: Getting Started with Docker on AWS

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 39: Getting Started with Docker on AWS

Scale Service

Page 40: Getting Started with Docker on AWS

Update Service

Deploy new version

Drain connections

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

new new new

Elastic Load Balancing

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

old old old

Page 41: Getting Started with Docker on AWS

Update Service (cont.)

Deploy new version

Drain connections

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

new new new

Elastic Load Balancing

Shared Data Volume

Containers

Shared Data Volume

Containers

Shared Data Volume

Containers

old old old

Page 42: Getting Started with Docker on AWS

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 43: Getting Started with Docker on AWS

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 44: Getting Started with Docker on AWS

Update Service (cont.)

Deploy using the least space: minimumHealthyPercent =

50%, maximumPercent = 100%

Page 45: Getting Started with Docker on AWS

Update Service (cont.)

Deploy quickly without reducing service capacity:

minimumHealthyPercent = 100%, maximumPercent =

200%

Page 46: Getting Started with Docker on AWS

Demo

Page 47: Getting Started with Docker on AWS

Thank You!