Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS)...

61
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Solutions Architect Containers and the Evolution of Computing Matt Nowina

Transcript of Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS)...

Page 1: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

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

Solutions Architect

Containers and the Evolution of Computing

Matt Nowina

Page 2: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Scaling Applications

Page 3: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Order UI User UI Shipping UI

Order Service

User Service

Shipping Service

Data Access

Page 4: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use
Page 5: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Order UI User UI Shipping UI

Order Service

User Service

Shipping Service

Page 6: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Order UI User UI UI

Order Service Service Shipping

Service

Order UIOrder UI

User UI UIShipping UI

Order ServiceOrder

ServiceService

ServiceService

ServiceUser

Service

Shipping Service

Page 7: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use
Page 8: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

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 · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Container advantages

Portable

Flexible

Fast

EfficientServer

Guest OS

Bins/Libs Bins/Libs

App2App1

Page 10: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

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 · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Server

Guest OS

Bins/Libs Bins/Libs

App2App1

Managing one host is straightforward

Page 12: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

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 (ECS) is a highly scalable, high performance container management service. You can use

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 14: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Our Goals with Amazon ECS

Page 15: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Container Management at Any Scale

Nothing to run

Complete state

Control and monitoring

Scale

Page 16: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Flexible Container Placement

Long running applications

Batch jobs

Multiple schedulers

Page 17: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

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 · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Container Management

Page 19: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

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 · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

CPU

Memory

Ports

Disk Space

Disk IOPS

Network Bandwidth

Resources

Page 21: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

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 · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Instance Registration

register-container-instance --total-resources

[{

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

},…

]

Page 23: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Modifying Exposed Resources

Page 24: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

How do you model your applications?

Page 25: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use
Page 26: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

{"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 · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Tasks

Shared Data Volume

Containers

launchContainer Instance

Volume Definitions

Container Definitions

Page 28: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Starting a Task

API

User / Scheduler

StartTask

Page 29: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Starting a Task

API

User / Scheduler

StartTask

Cluster Management Engine

Page 30: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Starting a Task

API

User / Scheduler

StartTask

Cluster Management Engine

Agent Communication

Page 31: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Starting a Task

API

User / Scheduler

StartTask

Cluster Management Engine

Agent Communication

Docker

Container Instance

ECS Agent

TaskContainer

WebSocket

Page 32: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Starting a Task

API

User / Scheduler

StartTask

Cluster Management Engine

Agent Communication

DockerTask

Container Instance

Container

ECS Agent

TaskContainer

SubmitStateChange

Page 33: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Tracking Resource Changes

Page 34: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Terminated Task

API

User / Scheduler

StartTask

Cluster Management Engine

Agent Communication

DockerTask

Container Instance

Container

ECS Agent

SubmitStateChange

Page 35: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Missing Container Instance

API

User / Scheduler

StartTask

Cluster Management Engine

DockerTask

Container Instance

Container

ECS Agent

?

Agent Communication

Page 36: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Terminated Container Instance

API

User / Scheduler

StartTask

Cluster Management Engine

Agent Communication

Termination Notifier

DockerTask

Container Instance

Container

ECS Agent

Page 37: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Guaranteeing Accuracy and Consistency

Page 38: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

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 · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

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 · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Scalable

Page 41: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Schedulers

Page 42: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

What is a Scheduler?

• Determine Desired State

• Check Against Current State

• Perform Action

Page 43: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Amazon ECS Service Scheduler

Page 44: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

What is a Service?

• Models a long-running application

• Maintains desired state

• Optionally runs behind an Elastic

Load Balancer

Page 45: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

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 · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use
Page 47: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

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 · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use
Page 49: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Other Considerations• ELB Registration/Deregistration• Permissions and Errors• Task Health• Scale Down Requests

Page 50: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use
Page 51: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Multiple Schedulers

Page 52: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Amazon ECS: Scheduling

Page 53: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Amazon ECS: Scheduling

Page 54: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Amazon ECS: Scheduling

Page 55: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Amazon ECS: Scheduling

Page 56: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Let us recap

Page 57: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use
Page 58: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

{"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 · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

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 · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use
Page 61: Containers and the evolution of computing · What is Amazon ECS? Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service. You can use

Thank you!