This is the slides for a talk I gave on AWS EC2 Container Services at AWS + Docker Meetup held @ LinkedIn Bangalore. The video of my presentation can be found at https://youtu.be/GbMGJbDTj-A
5. What EC2 Container Services offers
• Cloud native container orchestration
• Store container images in ECS Container Registry
• Works with Docker Hub
• Allows pooling of server resources
• Dynamic container placement
• Auto re-scheduling of failed containers
• Comprehensive metrics for resource utilization
• Near to zero learning curve
6. ECS Cluster
• Any type of EC2 instances can be added or removed
to a cluster
• Containers are run as an application fleet or on
demand
• Containers are placed on servers which has
resources available
• Provides comprehensive mechanism for container
host selection
• Supports scaling based on CloudWatch metrics
7. ECS at High Level
Task
ECS Cluster
Amazon EC2 Amazon EC2 Amazon EC2Amazon EC2
Task
TaskDefinition
8. Task Definitions
• A Task Definition is a template for creating and
scheduling containers
• It Logically groups containers based on their
purpose
• Task definitions are versioned
• Specify CPU & Memory Limits (Hard & Soft)
9. Task Definitions
• Specify Linux ulimits on containers
• Schedule containers on instances based on rules e.g.
Instance Type or Availability Zone
• Networking Mode (Bridge, Host or None)
• Map volumes between Host & Container
• Created via UI or via API call
10. Anatomy of Task Definition
Docker Image from ECS Registry of Docker Hub
Constrains for container placement on a host
Host Volumes
Network Mode
Linux Ulimits Process to execute Parameters
CPU Units Memory Hard & Soft Limits
Port Mappings Environment Variables Docker Labels
Volume Mappings etc hosts Log Driver
11. Container Scheduling Strategies | Service
• Best suited for long running containers
• Maintains specified number of running containers
on the clusters
• Failed containers are re-scheduled
• Allows selection of host instances where task can be
placed
12. Container Scheduling Strategies | Manual
• Best suited for processes which perform work and
then stop e.g. Queue Processor or Batch Jobs
• Task containers can be created via RunTask API call
• Allows selection of host instances where task can be
placed
14. Service Discovery
• AWS Application Load Balancer is a Layer 7 load
balancer
• ECS Integrates with Application Load Balancer to
provide service discovery
• Allows multiple copies of same container to run on
single host
• ECS chooses host port number dynamically from
ephemeral port range (32768 to 61000)
16. Cluster Metrics
• ECS provides CloudWatch metrics for CPU and
Memory
• CPUReservation / CPUUtilization
• MemoryReservation / MemoryUtilization
• Running Tasks Count
• These metrics can be used to AutoScale containers
19. Tips & Tricks
• Use SpotFleet for processing back ground task or for
temporary scale out
• Create a frozen AMI with ECS Agent and other
artifacts
• Tag your instance with Cluster name and run a script
during bootup to join a Cluster based on Tag value