初探 aws 平台上的 docker 服務
TRANSCRIPT
![Page 1: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/1.jpg)
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Jowana JO
Technical Account manager, AWS Enterprise Support
June 7th, 2017
Getting Started with Docker on AWS
![Page 2: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/2.jpg)
Agenda
Why Containers?
Cluster Management
Benefits
Running Services
Demo
![Page 3: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/3.jpg)
Why Containers?
![Page 4: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/4.jpg)
What are Containers?
OS virtualization
Process isolation
Images
Automation Server
Guest OS
Bins/Libs Bins/Libs
App2App1
![Page 5: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/5.jpg)
Container advantages
Portable
Flexible
Fast
EfficientServer
Guest OS
Bins/Libs Bins/Libs
App2App1
![Page 6: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/6.jpg)
Services evolve to microservices
Monolithic Application
Order UI User UI Shipping UI
Order
ServiceUser
Service
Shipping
Service
Data
Access
OrderUI
Inventory
Service
Order
Service
Shipping
Service
![Page 7: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/7.jpg)
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 8: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/8.jpg)
Server
Guest OS
Bins/Libs Bins/Libs
App2App1
Scheduling one resource is straightforward
Going from this…
![Page 9: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/9.jpg)
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
.. to this - is hard!
![Page 10: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/10.jpg)
Amazon ECS
![Page 11: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/11.jpg)
Amazon EC2 Container Service (ECS) is a highly
scalable, high performance container management
service that supports Docker containers and allows you
to easily run applications on a managed cluster of
Amazon EC2 instances.
![Page 12: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/12.jpg)
Amazon ECS
EC2 INSTANCES
LOAD
BALANCER
InternetECS
AGENT
TASK
Container
TASK
Container
ECS AGENT
TASK
Container
TASK
ContainerAgent Communication Service
Amazon ECS
ECS AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
API
Cluster Management Engine
Key / Value Store
![Page 13: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/13.jpg)
Amazon ECS - Cluster
EC2 INSTANCES
LOAD
BALANCER
InternetECS
AGENT
TASK
Container
TASK
Container
ECS AGENT
TASK
Container
TASK
Container
ECS AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
Agent Communication Service
Amazon ECS
API
Cluster Management Engine
Key / Value Store
![Page 14: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/14.jpg)
Amazon ECS - Task
EC2 INSTANCES
LOAD
BALANCER
InternetECS
AGENT
TASK
Container
TASK
Container
ECS AGENT
TASK
Container
TASK
Container
ECS AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
Agent Communication Service
Amazon ECS
API
Cluster Management Engine
Key / Value Store
![Page 15: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/15.jpg)
Amazon ECS - Service
EC2 INSTANCES
LOAD
BALANCER
InternetECS
AGENT
TASK
Container
TASK
Container
ECS AGENT
TASK
Container
TASK
Container
ECS AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
Agent Communication Service
Amazon ECS
API
Cluster Management Engine
Key / Value Store
![Page 16: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/16.jpg)
Amazon ECS - Resource Management
EC2 INSTANCES
LOAD
BALANCER
InternetECS
AGENT
TASK
Container
TASK
Container
ECS AGENT
TASK
Container
TASK
ContainerAgent Communication Service
Amazon ECS
ECS AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
API
Cluster Management Engine
Key / Value Store
![Page 17: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/17.jpg)
Amazon ECS - Agent Communication
EC2 INSTANCES
LOAD
BALANCER
InternetECS
AGENT
TASK
Container
TASK
Container
ECS AGENT
TASK
Container
TASK
ContainerAgent Communication Service
Amazon ECS
ECS AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
API
Cluster Management Engine
Key / Value Store
![Page 18: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/18.jpg)
Amazon ECS - Key / Value Store
EC2 INSTANCES
LOAD
BALANCER
InternetECS
AGENT
TASK
Container
TASK
Container
ECS AGENT
TASK
Container
TASK
ContainerAgent Communication Service
Amazon ECS
ECS AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
API
Cluster Management Engine
Key / Value Store
![Page 19: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/19.jpg)
Amazon ECS - API
EC2 INSTANCES
LOAD
BALANCER
InternetECS
AGENT
TASK
Container
TASK
Container
ECS AGENT
TASK
Container
TASK
ContainerAgent Communication Service
Amazon ECS
ECS AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
API
Cluster Management Engine
Key / Value Store
![Page 20: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/20.jpg)
Amazon ECS: Scheduling
![Page 21: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/21.jpg)
Amazon ECS: Scheduling
![Page 22: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/22.jpg)
Amazon ECS: Scheduling
![Page 23: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/23.jpg)
Amazon ECS: Scheduling
![Page 24: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/24.jpg)
Benefits
![Page 25: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/25.jpg)
Amazon ECS benefits
• Fully managed elastic service – You don’t
need to run anything, and the service scales as
your microservices architecture grows
• Shared state optimistic scheduling
• Deep Integration With Other AWS Services
• Application Load Balancing
• Amazon Elastic Block Store
• Amazon Virtual Private Cloud
• Amazon CloudWatch
• AWS Identify and Access Management
• AWS CloudTrail
![Page 26: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/26.jpg)
Running services
![Page 27: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/27.jpg)
Task Definitions
Volume Definitions
Container Definitions
![Page 28: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/28.jpg)
Key Components: Task Definitions
![Page 29: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/29.jpg)
Key Components: Task Definitions
![Page 30: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/30.jpg)
Tasks
Shared Data
Volume
Containers
schedule
Container
Instance
Volume Definitions
Container Definitions
![Page 31: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/31.jpg)
Unit of work
Grouping of related Containers
Run on Container Instances
Tasks
![Page 32: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/32.jpg)
Create a Service
Good for long-running
applications and services
![Page 33: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/33.jpg)
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 34: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/34.jpg)
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 35: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/35.jpg)
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
![Page 36: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/36.jpg)
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
![Page 37: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/37.jpg)
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 38: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/38.jpg)
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 39: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/39.jpg)
Update Service (cont.)
Deploy using the least space: minimumHealthyPercent =
50%, maximumPercent = 100%
![Page 40: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/40.jpg)
Update Service (cont.)
Deploy quickly without reducing service capacity:
minimumHealthyPercent = 100%, maximumPercent =
200%
![Page 41: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/41.jpg)
Demo
![Page 42: 初探 AWS 平台上的 Docker 服務](https://reader033.vdocuments.mx/reader033/viewer/2022052202/5a65c67f7f8b9a0a5f8b4c3b/html5/thumbnails/42.jpg)
Thank You!