Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Container Orchestration with Amazon ECS

1,220 views

Published on

by Anthony Suarez, Sr. Manager, Container Services, Amazon EC2, AWS

  • Hey guys! Who wants to chat with me? More photos with me here 👉 http://www.bit.ly/katekoxx
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Container Orchestration with Amazon ECS

  1. 1. Anthony Suarez & Nare Hayrapetyan Amazon ECS Container Orchestration with Amazon ECS & Blox January 24, 2017
  2. 2. Server Guest OS Bins/Libs Bins/Libs App2App1 Getting Started Running Containers
  3. 3. Running Containers at Scale 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
  4. 4. Cluster Management Components
  5. 5. Cluster Management Engine Docker Task Container Instance Container Task Container Docker Task Container Instance Container Task Container Docker Task Container Instance Container Task Container AZ 1 AZ 2 Cluster Management Engine
  6. 6. Agent Communication Docker Task Container Instance Container ECS Agent Task Container Docker Task Container Instance Container ECS Agent Task Container Docker Task Container Instance Container ECS Agent Task Container AZ 1 AZ 2 Cluster Management Engine Agent Communication Service
  7. 7. Key/Value Store Docker Task Container Instance Container ECS Agent ELB Internet ELB 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 Cluster Management Engine Agent Communication Service
  8. 8. APIs Docker Task Container Instance 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
  9. 9. Scheduling Docker Task Container Instance 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
  10. 10. Amazon ECS: Scheduling
  11. 11. Amazon ECS: Under the Hood ALB ALB AZ 1 AZ 2 user / scheduler Scheduler Cluster State Service Placement Engine Event Stream
  12. 12. Task Placement Engine
  13. 13. 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
  14. 14. 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
  15. 15. Supported Placement Strategies Binpacking Spread Affinity Distinct Instance
  16. 16. Placement Strategy Chaining Spread tasks across Zones and Binpack within each Zone
  17. 17. New Cluster Query Language
  18. 18. Filtering: Match on Instance Family or Type
  19. 19. Filtering: Match on Availability Zone
  20. 20. Filtering: Match on Multiple Expressions
  21. 21. Filtering: Match on Custom Attributes
  22. 22. Task Placement Examples
  23. 23. g2.2xlarge t2.small g2.2xlarge g2.2xlarge Placement: Targeting Instance Type
  24. 24. 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
  25. 25. 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
  26. 26. 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
  27. 27. 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
  28. 28. Running a Service
  29. 29. 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
  30. 30. 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
  31. 31. Console: Getting Started with Placement
  32. 32. Console: Placement Templates to Get Started
  33. 33. Console: Customizing Placement Strategies
  34. 34. Live Demo
  35. 35. Event Stream
  36. 36. Consuming Real-time Events
  37. 37. Three Steps to Getting Started with Events Step 1: Create CWE Rule Step 2: Create SNS Topic Step 3: Put Events to SNS
  38. 38. 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
  39. 39. Introducing Blox
  40. 40. What is Blox? Choice Control Developer Experience
  41. 41. Building with Blox scheduler cluster state service
  42. 42. 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
  43. 43. Swagger Spec: Cluster State Service
  44. 44. Swagger Spec: Daemon Scheduler
  45. 45. Daemon Scheduler
  46. 46. 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
  47. 47. Step 1: Create an Environment
  48. 48. Step 2: Create a Deployment
  49. 49. Step 3: Add Container Instances
  50. 50. Step 4: Monitoring and Scaling a Cluster
  51. 51. Live Demo
  52. 52. The Blox Vision
  53. 53. 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
  54. 54. Thank you!

×