getting started with docker on aws

48

Upload: mikhail-prudnikov

Post on 14-Apr-2017

69 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Getting Started With Docker on AWS
Page 2: Getting Started With Docker on AWS

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

Mikhail Prudnikov, Senior Solutions Architect

October 24th, 2016

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

Automation Server

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

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 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

DockerTask

EC2 Instance

Container

DockerTask

EC2 Instance

Container

TaskContainer

Docker

EC2 Instance

TaskContainer

AZ 1 AZ 2

Page 15: Getting Started With Docker on AWS

Cluster Management: Scheduling

DockerTask

EC2 Instance

Container

DockerTask

EC2 Instance

Container

TaskContainer

Docker

EC2 Instance

TaskContainer

AZ 1 AZ 2

Page 16: Getting Started With Docker on AWS

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 17: Getting Started With Docker on AWS

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

Page 18: Getting Started With Docker on AWS

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

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

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

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 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

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 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

Unit of work

Grouping of related Containers

Run on Container Instances

Tasks

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!

Page 48: Getting Started With Docker on AWS

Don’t Forget Evaluations!