49
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Dickson Yue Senior Solutions Architect 使用 Blox 實現容器任務調度與 資源編排 January 12, 2017

使用 Blox 實現容器任務調度與資源編排

Embed Size (px)

Citation preview

Page 1: 使用 Blox 實現容器任務調度與資源編排

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

Dickson Yue

Senior Solutions Architect

使用 Blox 實現容器任務調度與

資源編排

January 12, 2017

Page 2: 使用 Blox 實現容器任務調度與資源編排

What is Amazon ECS?

Scalable Container

Management

Flexible Container

Placement

AWS Platform

IntegrationExtensible by Design

Page 3: 使用 Blox 實現容器任務調度與資源編排

Amazon ECS: Under the Hood

ALB ALB

AZ 1 AZ 2

user / scheduler

Scheduler

Cluster State Service

Placement Engine

Event Stream

Page 4: 使用 Blox 實現容器任務調度與資源編排

Task Placement Engine

Page 5: 使用 Blox 實現容器任務調度與資源編排

New Placement Constraints & Attributes

Name Example

AMI ID attribute:ecs.ami-id == ami-eca289fb

Availability Zone attribute:ecs.availability-zone == us-east-1a

Instance Type attribute:ecs.instance-type == t2.small

Distinct Instances type=“distinctInstance”

Custom attribute:stack == prod

Page 6: 使用 Blox 實現容器任務調度與資源編排

Anatomy of Task Placement

Cluster Constraints

Custom Constraints

Placement Strategies

Apply Filter

Satisfy CPU, memory, and port requirements

Filter for location, instance-type, AMI, or custom

attribute constraints

Identify instances that meet spread or binpack

placement strategy

Select final container instances for placement

Page 7: 使用 Blox 實現容器任務調度與資源編排

Supported Placement Strategies

Binpacking Spread Affinity Distinct Instance

Page 8: 使用 Blox 實現容器任務調度與資源編排

Placement Strategy Chaining

Spread tasks across Zones

and Binpack within each Zone

Page 9: 使用 Blox 實現容器任務調度與資源編排

New Cluster Query Language

Page 10: 使用 Blox 實現容器任務調度與資源編排

Filtering: Match on Instance Family or Type

Page 11: 使用 Blox 實現容器任務調度與資源編排

Filtering: Match on Availability Zone

Page 12: 使用 Blox 實現容器任務調度與資源編排

Filtering: Match on Multiple Expressions

Page 13: 使用 Blox 實現容器任務調度與資源編排

Filtering: Match on Custom Attributes

Page 14: 使用 Blox 實現容器任務調度與資源編排

Task Placement Examples

Page 15: 使用 Blox 實現容器任務調度與資源編排

g2.2xlarge t2.small g2.2xlarge g2.2xlarge

Placement: Targeting Instance Type

Page 16: 使用 Blox 實現容器任務調度與資源編排

g2.2xlarge t2.small t2.micro t2.medium

t2.medium t2.small g2.2xlarge

t2.small

t2.small t2.medium

us-east-1aus-east-1d

Placement: Targeting Instance Type & Zone

Page 17: 使用 Blox 實現容器任務調度與資源編排

g2.2xlarge t2.small t2.micro t2.medium

t2.medium t2.small g2.2xlarge t2.small

us-east-1aus-east-1d

g2.2xlarge t2.medium

t2.micro t2.small

us-east-1c

Placement: Availability Zone Spread

Page 18: 使用 Blox 實現容器任務調度與資源編排

g2.2xlarge t2.small t2.micro t2.medium

t2.medium t2.small g2.2xlarge t2.small

us-east-1aus-east-1d

g2.2xlarge t2.medium

t2.micro t2.small

us-east-1c

Placement: Spread across Zone and Binpack

Page 19: 使用 Blox 實現容器任務調度與資源編排

g2.2xlarge t2.small t2.micro t2.medium

t2.medium t2.small g2.2xlarge t2.small

us-east-1aus-east-1d

g2.2xlarge t2.medium

t2.micro t2.small

us-east-1c

Placement: Affinity and Anti-Affinity

Page 20: 使用 Blox 實現容器任務調度與資源編排

Running a Service

Page 21: 使用 Blox 實現容器任務調度與資源編排

t2.medium t2.small t2.small

us-east-1aus-east-1d

t2.medium t2.micro t2.small

us-east-1c

Placement: Multiple Services on a Cluster

Page 22: 使用 Blox 實現容器任務調度與資源編排

t2.medium g2.2xlarge t2.micro t2.small

t2.small t2.small g2.2xlarge t2.small

t2.small t2.small

g2.2xlarge t2.small

Placement: Services – Distinct Instances

Page 23: 使用 Blox 實現容器任務調度與資源編排

Console: Getting Started with Placement

Page 24: 使用 Blox 實現容器任務調度與資源編排

Console: Placement Templates to Get Started

Page 25: 使用 Blox 實現容器任務調度與資源編排

Console: Customizing Placement Strategies

Page 26: 使用 Blox 實現容器任務調度與資源編排

Live Demo

Page 27: 使用 Blox 實現容器任務調度與資源編排

Event Stream

Page 28: 使用 Blox 實現容器任務調度與資源編排

Consuming Real-time Events

Page 29: 使用 Blox 實現容器任務調度與資源編排

Three Steps to Getting Started with Events

Step 1: Create CWE Rule Step 2: Create SNS Topic Step 3: Put Events to SNS

Page 30: 使用 Blox 實現容器任務調度與資源編排

Consuming Events for Service Discovery

app1-tst 10.1.0.11

db1-tst 10.1.0.14

app2 10.1.0.16

db2 10.1.0.18

my-app 10.1.0.20

websrv1 10.1.0.1

websrv2 10.1.0.2

websrv3 10.1.0.4

app-dev1 10.1.0.9

app-dev2 10.1.0.5

app-dev3 10.1.0.8

db-dev 10.1.0.19

Page 31: 使用 Blox 實現容器任務調度與資源編排

Introducing Blox

Page 32: 使用 Blox 實現容器任務調度與資源編排

What is Blox?

Choice

Control

Developer Experience

Page 33: 使用 Blox 實現容器任務調度與資源編排

Building with Blox

scheduler cluster state service

Page 34: 使用 Blox 實現容器任務調度與資源編排

Set Up Blox Locally

Step 1: git clone https://github.com/blox/blox.git

Step 3: docker-compose up -d

Step 4: start using Blox locally

Step 2: deploy CloudFormation template to configure ECS event stream and SQS queue

Page 35: 使用 Blox 實現容器任務調度與資源編排

Swagger Spec: Cluster State Service

Page 36: 使用 Blox 實現容器任務調度與資源編排

Swagger Spec: Daemon Scheduler

Page 37: 使用 Blox 實現容器任務調度與資源編排

Daemon Scheduler

Page 38: 使用 Blox 實現容器任務調度與資源編排

t2.small t2.small t2.small

Blox: Daemon Scheduler

t2.small t2.small t2.small

scheduler cluster state service

t2.small t2.small t2.small

Page 39: 使用 Blox 實現容器任務調度與資源編排

Step 1: Create an Environment

Page 40: 使用 Blox 實現容器任務調度與資源編排

Step 2: Create a Deployment

Page 41: 使用 Blox 實現容器任務調度與資源編排

Step 3: Add Container Instances

Page 42: 使用 Blox 實現容器任務調度與資源編排

Step 4: Monitoring and Scaling a Cluster

Page 43: 使用 Blox 實現容器任務調度與資源編排

Live Demo

Page 44: 使用 Blox 實現容器任務調度與資源編排

The Blox Vision

Page 45: 使用 Blox 實現容器任務調度與資源編排

Contributing to Blox

• Blox is licensed under Apache 2.0

• Open an issue or pull request

• Watch our roadmap on GitHub

• Check out our Gitter channel

Page 46: 使用 Blox 實現容器任務調度與資源編排

Summary

Page 47: 使用 Blox 實現容器任務調度與資源編排

Summary

Page 48: 使用 Blox 實現容器任務調度與資源編排

Thank you!

Page 49: 使用 Blox 實現容器任務調度與資源編排

Remember to complete

your evaluations!