48
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Getting Started with Docker on AWS Danielle Greshock, Manager, Solutions Architecture, AWS CMP209 November 29, 2016

AWS re:Invent 2016: Getting Started with Docker on AWS (CMP209)

Embed Size (px)

Citation preview

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

Getting Started with Docker

on AWSDanielle Greshock, Manager, Solutions Architecture, AWS

CMP209

November 29, 2016

Agenda

Why Containers?

Cluster Management

Benefits

Running Services

Demo

Why Containers?

What are Containers?

OS virtualization

Process isolation

Images

Automation Server

Guest OS

Bins/Libs Bins/Libs

App2App1

Container advantages

Portable

Flexible

Fast

EfficientServer

Guest OS

Bins/Libs Bins/Libs

App2App1

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

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

Scheduling

Server

Guest OS

Bins/Libs Bins/Libs

App2App1

Scheduling one resource is straightforward

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

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.

Cluster Management

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

Cluster Management: Scheduling

Docker

Task

EC2 Instance

Container

Docker

Task

EC2 Instance

Container

Task

Container

Docker

EC2 Instance

Task

Container

AZ 1 AZ 2

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

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

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

Amazon ECS under the Hood

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

IDN+6

IDN+5

WRITE

READ

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

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

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

Benefits

Easily Manage Clusters for Any Scale

Nothing to run

Complete state

Control and monitoring

Scale

Scalable

Flexible Container Placement

Applications

Batch jobs

Multiple schedulers

Designed for use with other AWS services

Elastic Load Balancing

Amazon Elastic Block Store

Amazon Virtual Private Cloud

Amazon CloudWatch

AWS Identity and Access Management

AWS CloudTrail

Extensible

Comprehensive APIs

Custom schedulers

Open source agent and CLI

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

Running Services

Task Definitions

Volume Definitions

Container Definitions

Key Components: Task Definitions

Key Components: Task Definitions

Tasks

Shared Data

Volume

Containers

schedule

Container

Instance

Volume Definitions

Container Definitions

Unit of work

Grouping of related Containers

Run on Container Instances

Tasks

Create a Service

Good for long-running

applications and services

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

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

Scale Service

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

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

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

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.

Update Service (cont.)

Deploy using the least space: minimumHealthyPercent =

50%, maximumPercent = 100%

Update Service (cont.)

Deploy quickly without reducing service capacity:

minimumHealthyPercent = 100%, maximumPercent =

200%

Demo

Thank you!

Remember to complete

your evaluations!

Related Sessions

CON309 - Running Microservices on Amazon ECS

CON315 - Workshop: Deploy a Swift Web Application on

Amazon ECS