containers and the evolution of computing

61
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. General Manager, Container Services, AWS April 2016 Containers and the Evolution of Computing Deepak Singh

Upload: amazon-web-services

Post on 12-Apr-2017

6.151 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Containers and the Evolution of Computing

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

General Manager, Container Services, AWS

April 2016

Containers and the Evolution of Computing

Deepak Singh

Page 2: Containers and the Evolution of Computing

Scaling Applications

Page 3: Containers and the Evolution of Computing

Order UI User UIShipping

UI

Order

Service

User

Service

Shipping

Service

Data

Access

Page 4: Containers and the Evolution of Computing
Page 5: Containers and the Evolution of Computing

Order UI User UIShipping

UI

Order

Service

User

Service

Shipping

Service

Page 6: Containers and the Evolution of Computing

Order UI User UI UI

Order

ServiceService

Shipping

Service

Order UIOrder UI

User UI UIShipping

UI

Order

ServiceOrder

Service

ServiceService

ServiceService

User

Service

Shipping

Service

Page 7: Containers and the Evolution of Computing
Page 8: Containers and the Evolution of Computing

What are Containers?

OS virtualization

Process isolation

Images

Automation Server

Guest OS

Bins/Libs Bins/Libs

App2App1

Page 9: Containers and the Evolution of Computing

Container Advantages

Portable

Flexible

Fast

EfficientServer

Guest OS

Bins/Libs Bins/Libs

App2App1

Page 10: Containers and the Evolution of Computing

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 11: Containers and the Evolution of Computing

Server

Guest OS

Bins/Libs Bins/Libs

App2App1

Managing One Host is Straightforward

Page 12: Containers and the Evolution of Computing

Managing a Fleet 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

AZ 1 AZ 2

AZ 3

Page 13: Containers and the Evolution of Computing

What is Amazon ECS?

Amazon EC2 Container Service (Amazon 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 14: Containers and the Evolution of Computing

Our Goals with Amazon ECS

NEED NICE ECS LOGO

Page 15: Containers and the Evolution of Computing

Container Management at Any Scale

Nothing to run

Complete state

Control and monitoring

Scale

Page 16: Containers and the Evolution of Computing

Flexible Container Placement

Long running applications

Batch jobs

Multiple schedulers

Page 17: Containers and the Evolution of Computing

Integration with the AWS Platform

Elastic Load Balancing

Amazon Elastic Block Store

Amazon Virtual Private Cloud

Amazon CloudWatch

AWS Identity and Access Management

AWS CloudTrail

Page 18: Containers and the Evolution of Computing

Container Management

Page 19: Containers and the Evolution of Computing

What is a Container Manager?

• Maintains available resources

• Tracks resource changes

• Accepts resource requests

• Guarantees accuracy and consistency

Page 20: Containers and the Evolution of Computing

CPU

Memory

Ports

Disk space

Disk IOPS

Network bandwidth

Resources

Page 21: Containers and the Evolution of Computing

ECS

Agent

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

https://github.com/aws/amazon-ecs-agent

Page 22: Containers and the Evolution of Computing

Instance Registration

register-container-instance --total-resources

[{

“name” : “cpu”,“type” : “integerValue”,“integerValue” : 2048

},…

]

Page 23: Containers and the Evolution of Computing

Modifying Exposed Resources

Page 24: Containers and the Evolution of Computing

How do you model your

applications?

Page 25: Containers and the Evolution of Computing
Page 26: Containers and the Evolution of Computing

{

"environment": [],

"name": "simple-demo",

"image": "my-demo",

"cpu": 10,

"memory": 500,

"portMappings": [

{

"containerPort": 80,

"hostPort": 80

}

],

"mountPoints": [

{

"sourceVolume": "my-vol",

"containerPath": "/var/www/my-vol"

}

],

"entryPoint": [

"/usr/sbin/apache2",

"-D",

"FOREGROUND"

],

"essential": true

},

Page 27: Containers and the Evolution of Computing

Tasks

Shared Data Volume

Containers

launchContainer

Instance

Volume Definitions

Container Definitions

Page 28: Containers and the Evolution of Computing

Starting a Task

API

User /

Scheduler

StartTask

Page 29: Containers and the Evolution of Computing

Starting a Task

API

User /

Scheduler

StartTask

Cluster Management Engine

Page 30: Containers and the Evolution of Computing

Starting a Task

API

User /

Scheduler

StartTask

Cluster Management Engine

Agent Communication

Page 31: Containers and the Evolution of Computing

Starting a Task

API

User /

Scheduler

StartTask

Cluster Management Engine

Agent Communication

Docker

Container Instance

ECS Agent

Task

Container

WebSocket

Page 32: Containers and the Evolution of Computing

Starting a Task

API

User /

Scheduler

StartTask

Cluster Management Engine

Agent Communication

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

SubmitStateChange

Page 33: Containers and the Evolution of Computing

Tracking Resource Changes

Page 34: Containers and the Evolution of Computing

Terminated Task

API

User /

Scheduler

StartTask

Cluster Management Engine

Agent Communication

Docker

Task

Container Instance

Container

ECS Agent

SubmitStateChange

Page 35: Containers and the Evolution of Computing

Missing Container Instance

API

User /

Scheduler

StartTask

Cluster Management Engine

Docker

Task

Container Instance

Container

ECS Agent

?

Agent Communication

Page 36: Containers and the Evolution of Computing

Terminated Container Instance

API

User /

Scheduler

StartTask

Cluster Management Engine

Agent Communication

Termination

Notifier

Docker

Task

Container Instance

Container

ECS Agent

Page 37: Containers and the Evolution of Computing

Guaranteeing Accuracy and Consistency

Page 38: Containers and the Evolution of Computing

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 39: Containers and the Evolution of Computing

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 40: Containers and the Evolution of Computing

Scalable

Page 41: Containers and the Evolution of Computing

Schedulers

Page 42: Containers and the Evolution of Computing

What is a Scheduler?

• Determine desired state

• Check against current state

• Perform action

Page 43: Containers and the Evolution of Computing

Amazon ECS Service Scheduler

Page 44: Containers and the Evolution of Computing

What is a Service?

• Models a long-running application

• Maintains desired state

• Optionally runs behind an Elastic Load Balancing load

balancer

Page 45: Containers and the Evolution of Computing

Discovering DifferencesDeployment Status Desired Pending Running

ecs-svc/1 PRIMARY 5 0 0

Minimum Healthy Maximum Healthy

50% 200%

Page 46: Containers and the Evolution of Computing
Page 47: Containers and the Evolution of Computing

Discovering DifferencesDeployment Status Desired Pending Running

ecs-svc/2 PRIMARY 10 0 0

ecs-svc/1 ACTIVE 5 0 5

Minimum Healthy Maximum Healthy

50% 200%

Page 48: Containers and the Evolution of Computing
Page 49: Containers and the Evolution of Computing

Other Considerations

• ELB registration/deregistration

• Permissions and errors

• Task health

• Scale down requests

Page 50: Containers and the Evolution of Computing
Page 51: Containers and the Evolution of Computing

Multiple Schedulers

Page 52: Containers and the Evolution of Computing

Amazon ECS: Scheduling

Page 53: Containers and the Evolution of Computing

Amazon ECS: Scheduling

Page 54: Containers and the Evolution of Computing

Amazon ECS: Scheduling

Page 55: Containers and the Evolution of Computing

Amazon ECS: Scheduling

Page 56: Containers and the Evolution of Computing

To recap

Page 57: Containers and the Evolution of Computing
Page 58: Containers and the Evolution of Computing

{

"environment": [],

"name": "simple-demo",

"image": "my-demo",

"cpu": 10,

"memory": 500,

"portMappings": [

{

"containerPort": 80,

"hostPort": 80

}

],

"mountPoints": [

{

"sourceVolume": "my-vol",

"containerPath": "/var/www/my-vol"

}

],

"entryPoint": [

"/usr/sbin/apache2",

"-D",

"FOREGROUND"

],

"essential": true

},

“Task Definitions”

Page 59: Containers and the Evolution of Computing

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 60: Containers and the Evolution of Computing
Page 61: Containers and the Evolution of Computing

Thank you!