SlideShare a Scribd company logo
1 of 25
Container Cluster
Management with AWS
ECS
Anshul Patel
Talentica DevOps Engineering
Team
What is Docker container ?
 Open platform to build, ship and run distributed applications
 Groups application with all the dependencies, shared libs
 Compared to Traditional Virtualized system, which encapsulates
OS + Kernel, Docker has same Kernel Space
 Isolation between different containers is done through
Namespaces, Cgroups, Network Interfaces
 Current Docker Engine Stable version 1.11.2 (2016-05-31)
 Default Engine Execution Driver : libcontainer
 Docker uses libcontainer to manipulate Namespaces, Cgroups,
Network Interfaces
Why Docker ?
 Lightweight, Open and Secure
 Portable and efficient in comparison to VM
 Accelerates Developer onboarding
 Empower Developer creativity
 Eliminates Environmental Inconsistencies
 Ability to scale quickly
 Reduces time to market of your application
Why Docker ?
Why Container Cluster Management System ?
 Provides clustering layer for controlling the deployment of your
containers onto the underlying hosts
 Manages container lifecycle within the cluster
 Scheduling Containers across the cluster
 Abstracting developers away from underlying machines
 Scaling containers
 Increases robustness and resilience of distributed containerized
application
What is AWS ECS (EC2 Container Service) ?
 Highly scalable, fast, container management service from Amazon
Web Services.
 Easily run, stop and manage Docker containers on cluster of
Amazon EC2 instances
 Schedules the placement of Docker containers across your cluster
based on resource needs, availability and requirements
 Eliminates need for you to operate your own cluster management
systems or write wrappers/logic for scaling your underlying
infrastructure
Components of ECS
 Cluster - Logical group of container instances
 Container Instance - Runs ECS agents and is registered to
cluster
 Task Definition - Description of application to be deployed
 Scheduler - Method of placing task on container instance
 Task - An instantiation of task definition running on container
instance
 Service - Runs and maintains predefined tasks simultaneously
 Container - Docker Container created during task instantiation
ECS Architecture
ECS Architecture
Key Components
 Agent Communication Service - Gateway between ECS agents
and ECS backend cluster management engine
 API - Provides cluster state information
 Cluster Management Engine - Provides cluster coordination and
state management
 Key/Value Store - It is used to storing cluster state information
ECS Architecture
 It isn’t a blackbox, runs on your own EC2(Container) instances
 ECS cluster is collection of EC2(Container) Instances
 ECS agent is installed on each of EC2(Container) Instances
 ECS agent registers instance to centralised ECS service
 ECS agent handles incoming requests for container deployment
 ECS agent handles the lifecycle of container
Creating ECS Cluster
 Cluster can be created using AWS Console, alternatively you can
create using aws ecs CLI
 AWS Container Instance Requirement
 Linux Kernel > = 3.10
 Docker > = 1.5.0
 ECS container agent
 Nanny process to monitor ECS agent (For eg: ecs-init )
 Amazon ECS optimized AMI is preconfigured with these
requirements
Launching EC2 container Instances
Points to remember
 ec2InstanceRole must be created
 If the EC2 instance is required to be part of pre-defined cluster,
following should be added in user data
#/bin/bash
echo ECS_CLUSTER=your_cluster_name >> /etc/ecs/ecs.config
 During the launch of AMI, it will consist of two EBS, one for OS
and another for Docker’s use.
ECS Task Definition
 Task definition is 1 or more container definitions
 It defines
 Docker Images to use
 Port and Drive Volume Mapping
 CPU and memory to use with container
 Whether containers are linked
 Environmental variable which is required to be passed to
container
 Whether task should continue if container finishes or fails
ECS Scheduler
 By default, AWS supports two ways for scheduling
 Running Tasks
 Services
 Apart from the above, StartTask API of ECS can be used to write
custom scheduler. Currently Amazon has developed PoC scheduler
for Mesos
ECS Running Tasks
 Instantiation of Task Definition
 Task can be either short lived or long lived. (For eg: event-driven-
data task or batch jobs)
 Architecturally all containers belonging to same task, have to run
on the same machine. In order to run container on different
machine, new task should be created.
 Co-location of containers can be achieved by grouping them in the
same task
ECS services
 Allows you to run and maintain a specified/desired number of
instances ( For eg : webservers )
 If any tasks should fail or stop for any reason, ECS service
scheduler launches another instance of your task definition to
maintain desired count
Deploying ECS Cluster
 Create a Load Balancer
 Create a Launch configuration
 Create a Autoscaling group, which specifies the desired number of
instances
 Create a task definition
 Create a service
ECS Container Instance Autoscaling
 ECS provides cluster-level parameters which can give the cluster
utilization statistics
 MemoryReservation - Current % of reserved memory by
cluster
 MemoryUtilization - Current % of utilized memory by cluster
 CPUReservation - Current % of reserved CPU by cluster
 CPUUtilization - Current % of utilized CPU by cluster
 CloudWatch Alarms on the above parameters enables to Scale
Up/Down the ECS cluster
ECS Task Autoscaling
 ECS also provides the facility to scale up the tasks in the service.
 Tasks can be autoscaled on following ECS service parameters
 CPUUtilization - Current % CPU utilization by ECS service
 MemoryUtilization - Current % Memory Utilization by ECS
service
EC2 Container Registry
 AWS managed Docker container registry
 Stores and Manages Docker Images
 Hosts images in a highly available and scalable architecture
 It is integrated with ECS
 No upfront fee, pay only for the data stored
Key Advantages of ECS Service
 ECS is monitoring status of Docker containers, so if it goes down it
will be deployed automatically
 ASG is monitoring your EC2 instances, if one instance goes down,
it will spawn new instance
 ECS can do zero-downtime deployments of new version ( Blue -
Green deployments )
 Updation requires two things
 Create new revision of task
 Update the revision in the service
Key Challenges
 No direct relation between EC2 Autoscaling and Task Autoscaling
 ELB works with 1:1 port mapping, so if the number of tasks is
equal to the number of instances, scheduler will not attempt to
deploy another task
 Service Discovery
ECS Limits
Resource Default Limit
Number of clusters per region, per account 1000
Number of container instances per cluster 1000
Number of services per cluster 500
ECS Limits
Resource Default Limit
Number of load balancers per service 1
Number of tasks per service (the desired
count)
1000
Number of tasks launched (count) per run-
task
10
Number of container instances per start-
task
10
Throttle on container instance registration
rate
1 per second / 60 max per minute
Task definition size limit 32 KiB
Task definition max containers 10
Throttle on task definition registration rate 1 per second / 60 max per minute
Thanks & Questions ?

More Related Content

What's hot

CoreOS: The Inside and Outside of Linux Containers
CoreOS: The Inside and Outside of Linux ContainersCoreOS: The Inside and Outside of Linux Containers
CoreOS: The Inside and Outside of Linux ContainersRamit Surana
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introductionw_akram
 
Fluentd and docker monitoring
Fluentd and docker monitoringFluentd and docker monitoring
Fluentd and docker monitoringVinay Krishna
 
OpenEBS - Containerized Storage for Containers
OpenEBS  - Containerized Storage for ContainersOpenEBS  - Containerized Storage for Containers
OpenEBS - Containerized Storage for ContainersUmasankar Mukkara
 
Swarm docker bangalore_meetup
Swarm docker bangalore_meetupSwarm docker bangalore_meetup
Swarm docker bangalore_meetupArunan Rabindran
 
Apache Bookkeeper and Apache Zookeeper for Apache Pulsar
Apache Bookkeeper and Apache Zookeeper for Apache PulsarApache Bookkeeper and Apache Zookeeper for Apache Pulsar
Apache Bookkeeper and Apache Zookeeper for Apache PulsarEnrico Olivelli
 
DockerCon EU 2015: From Local Development to Production Deployments using Ama...
DockerCon EU 2015: From Local Development to Production Deployments using Ama...DockerCon EU 2015: From Local Development to Production Deployments using Ama...
DockerCon EU 2015: From Local Development to Production Deployments using Ama...Docker, Inc.
 
(APP303) Lightning Fast Deploys with Docker Containers and AWS | AWS re:Inven...
(APP303) Lightning Fast Deploys with Docker Containers and AWS | AWS re:Inven...(APP303) Lightning Fast Deploys with Docker Containers and AWS | AWS re:Inven...
(APP303) Lightning Fast Deploys with Docker Containers and AWS | AWS re:Inven...Amazon Web Services
 
Exploring Openstack Swift(Object Storage) and Swiftstack
Exploring Openstack Swift(Object Storage) and Swiftstack Exploring Openstack Swift(Object Storage) and Swiftstack
Exploring Openstack Swift(Object Storage) and Swiftstack Ramit Surana
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundryrajdeep
 
Monitoring Dell Infrastructure using Docker & Microservices
Monitoring Dell Infrastructure using Docker & MicroservicesMonitoring Dell Infrastructure using Docker & Microservices
Monitoring Dell Infrastructure using Docker & MicroservicesAjeet Singh Raina
 
Continuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleContinuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleDmytro Slupytskyi
 
Kubernetes HA @ AppDirect - Montreal Kubernetes Meetup
Kubernetes HA @ AppDirect - Montreal Kubernetes MeetupKubernetes HA @ AppDirect - Montreal Kubernetes Meetup
Kubernetes HA @ AppDirect - Montreal Kubernetes Meetupalexgervais
 
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.Opcito Technologies
 
Container Orchestration @Docker Meetup Hamburg
Container Orchestration @Docker Meetup HamburgContainer Orchestration @Docker Meetup Hamburg
Container Orchestration @Docker Meetup HamburgTimo Derstappen
 

What's hot (20)

CoreOS: The Inside and Outside of Linux Containers
CoreOS: The Inside and Outside of Linux ContainersCoreOS: The Inside and Outside of Linux Containers
CoreOS: The Inside and Outside of Linux Containers
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Fluentd and docker monitoring
Fluentd and docker monitoringFluentd and docker monitoring
Fluentd and docker monitoring
 
Beginning mesos
Beginning mesosBeginning mesos
Beginning mesos
 
OpenEBS - Containerized Storage for Containers
OpenEBS  - Containerized Storage for ContainersOpenEBS  - Containerized Storage for Containers
OpenEBS - Containerized Storage for Containers
 
Swarm docker bangalore_meetup
Swarm docker bangalore_meetupSwarm docker bangalore_meetup
Swarm docker bangalore_meetup
 
Apache Bookkeeper and Apache Zookeeper for Apache Pulsar
Apache Bookkeeper and Apache Zookeeper for Apache PulsarApache Bookkeeper and Apache Zookeeper for Apache Pulsar
Apache Bookkeeper and Apache Zookeeper for Apache Pulsar
 
DockerCon EU 2015: From Local Development to Production Deployments using Ama...
DockerCon EU 2015: From Local Development to Production Deployments using Ama...DockerCon EU 2015: From Local Development to Production Deployments using Ama...
DockerCon EU 2015: From Local Development to Production Deployments using Ama...
 
(APP303) Lightning Fast Deploys with Docker Containers and AWS | AWS re:Inven...
(APP303) Lightning Fast Deploys with Docker Containers and AWS | AWS re:Inven...(APP303) Lightning Fast Deploys with Docker Containers and AWS | AWS re:Inven...
(APP303) Lightning Fast Deploys with Docker Containers and AWS | AWS re:Inven...
 
Exploring Openstack Swift(Object Storage) and Swiftstack
Exploring Openstack Swift(Object Storage) and Swiftstack Exploring Openstack Swift(Object Storage) and Swiftstack
Exploring Openstack Swift(Object Storage) and Swiftstack
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
 
Swarm mode
Swarm modeSwarm mode
Swarm mode
 
Monitoring Dell Infrastructure using Docker & Microservices
Monitoring Dell Infrastructure using Docker & MicroservicesMonitoring Dell Infrastructure using Docker & Microservices
Monitoring Dell Infrastructure using Docker & Microservices
 
How Postman adopted Docker
How Postman adopted DockerHow Postman adopted Docker
How Postman adopted Docker
 
Continuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleContinuous integration with Docker and Ansible
Continuous integration with Docker and Ansible
 
Py Con 2017
Py Con 2017Py Con 2017
Py Con 2017
 
Kubernetes HA @ AppDirect - Montreal Kubernetes Meetup
Kubernetes HA @ AppDirect - Montreal Kubernetes MeetupKubernetes HA @ AppDirect - Montreal Kubernetes Meetup
Kubernetes HA @ AppDirect - Montreal Kubernetes Meetup
 
Intro to docker
Intro to dockerIntro to docker
Intro to docker
 
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
 
Container Orchestration @Docker Meetup Hamburg
Container Orchestration @Docker Meetup HamburgContainer Orchestration @Docker Meetup Hamburg
Container Orchestration @Docker Meetup Hamburg
 

Viewers also liked

Manifesto Introduction
Manifesto IntroductionManifesto Introduction
Manifesto Introductionbobcatroom24
 
Cloud Computing Security
Cloud Computing SecurityCloud Computing Security
Cloud Computing SecurityAnshul Patel
 
My just right book
My just right bookMy just right book
My just right bookbobcatroom24
 
Untitled Presentation
Untitled PresentationUntitled Presentation
Untitled PresentationPurushotham P
 
Summer traininig-report ntpc anta content
Summer traininig-report ntpc anta contentSummer traininig-report ntpc anta content
Summer traininig-report ntpc anta contentnishant pareek
 
ASTD to ATD- The Five Characteristics of an Adaptive Culture-Blog Post 2014
ASTD to ATD- The Five Characteristics of an Adaptive Culture-Blog Post 2014ASTD to ATD- The Five Characteristics of an Adaptive Culture-Blog Post 2014
ASTD to ATD- The Five Characteristics of an Adaptive Culture-Blog Post 2014KHADEIDRA LE GENDRE, M.A.
 
Ejercios resueltos analogik
Ejercios resueltos analogikEjercios resueltos analogik
Ejercios resueltos analogikorlifreitez
 
Report About Eng. Materials
Report About Eng. MaterialsReport About Eng. Materials
Report About Eng. MaterialsAhmed Abdelwahed
 
99 pledges official ppt pdf
99 pledges official ppt pdf99 pledges official ppt pdf
99 pledges official ppt pdfCyndy Patrick
 
summer training report ntpc anta
summer training report ntpc antasummer training report ntpc anta
summer training report ntpc antanishant pareek
 
Proposisi Logika Informatika
Proposisi Logika InformatikaProposisi Logika Informatika
Proposisi Logika InformatikaDeviGayatri
 
Reference check form (3)
Reference check form (3)Reference check form (3)
Reference check form (3)anne Mercie
 
Lucky seven game using 7 segment display in fpga
Lucky seven game using 7 segment display in fpgaLucky seven game using 7 segment display in fpga
Lucky seven game using 7 segment display in fpgaDhruv Agarwal
 
Ntpc anta training presentation
Ntpc anta training presentation Ntpc anta training presentation
Ntpc anta training presentation nishant pareek
 

Viewers also liked (20)

Why not you(1)
Why not you(1)Why not you(1)
Why not you(1)
 
Manifesto Introduction
Manifesto IntroductionManifesto Introduction
Manifesto Introduction
 
Tutorial Slideshare
Tutorial SlideshareTutorial Slideshare
Tutorial Slideshare
 
Cloud Computing Security
Cloud Computing SecurityCloud Computing Security
Cloud Computing Security
 
Global Artists
Global Artists Global Artists
Global Artists
 
My just right book
My just right bookMy just right book
My just right book
 
Cost average efekt
Cost average efektCost average efekt
Cost average efekt
 
Untitled Presentation
Untitled PresentationUntitled Presentation
Untitled Presentation
 
Doodling graphic recording
Doodling graphic recordingDoodling graphic recording
Doodling graphic recording
 
Summer traininig-report ntpc anta content
Summer traininig-report ntpc anta contentSummer traininig-report ntpc anta content
Summer traininig-report ntpc anta content
 
ASTD to ATD- The Five Characteristics of an Adaptive Culture-Blog Post 2014
ASTD to ATD- The Five Characteristics of an Adaptive Culture-Blog Post 2014ASTD to ATD- The Five Characteristics of an Adaptive Culture-Blog Post 2014
ASTD to ATD- The Five Characteristics of an Adaptive Culture-Blog Post 2014
 
Ejercios resueltos analogik
Ejercios resueltos analogikEjercios resueltos analogik
Ejercios resueltos analogik
 
Report About Eng. Materials
Report About Eng. MaterialsReport About Eng. Materials
Report About Eng. Materials
 
99 pledges official ppt pdf
99 pledges official ppt pdf99 pledges official ppt pdf
99 pledges official ppt pdf
 
summer training report ntpc anta
summer training report ntpc antasummer training report ntpc anta
summer training report ntpc anta
 
Proposisi Logika Informatika
Proposisi Logika InformatikaProposisi Logika Informatika
Proposisi Logika Informatika
 
Reference check form (3)
Reference check form (3)Reference check form (3)
Reference check form (3)
 
Lucky seven game using 7 segment display in fpga
Lucky seven game using 7 segment display in fpgaLucky seven game using 7 segment display in fpga
Lucky seven game using 7 segment display in fpga
 
Ntpc anta training presentation
Ntpc anta training presentation Ntpc anta training presentation
Ntpc anta training presentation
 
Zaman Mesolitikum
Zaman MesolitikumZaman Mesolitikum
Zaman Mesolitikum
 

Similar to AWS ECS Meetup Talentica

Running containers in AWS
Running containers in AWSRunning containers in AWS
Running containers in AWSAndrewMay59
 
February 2016 Webinar Series - EC2 Container Service Deep Dive
February 2016 Webinar Series - EC2 Container Service Deep Dive February 2016 Webinar Series - EC2 Container Service Deep Dive
February 2016 Webinar Series - EC2 Container Service Deep Dive Amazon Web Services
 
Walk-through: Amazon ECS
Walk-through: Amazon ECSWalk-through: Amazon ECS
Walk-through: Amazon ECSKnoldus Inc.
 
Serverless and mixed container orchestration and request routing on AWS
Serverless and mixed container orchestration and request routing on AWSServerless and mixed container orchestration and request routing on AWS
Serverless and mixed container orchestration and request routing on AWSGlobalLogic Ukraine
 
Running containerized application in AWS ECS
Running containerized application in AWS ECSRunning containerized application in AWS ECS
Running containerized application in AWS ECSDevOps Indonesia
 
AWS Elastic Container Service (ECS) with a CI Pipeline Overview
AWS Elastic Container Service (ECS) with a CI Pipeline OverviewAWS Elastic Container Service (ECS) with a CI Pipeline Overview
AWS Elastic Container Service (ECS) with a CI Pipeline OverviewWyn B. Van Devanter
 
Amazon ECS with Docker | AWS Public Sector Summit 2016
Amazon ECS with Docker | AWS Public Sector Summit 2016Amazon ECS with Docker | AWS Public Sector Summit 2016
Amazon ECS with Docker | AWS Public Sector Summit 2016Amazon Web Services
 
Docker on AWS - the Right Way
Docker on AWS - the Right WayDocker on AWS - the Right Way
Docker on AWS - the Right WayAllCloud
 
State of the Union: Containers on AWS
State of the Union: Containers on AWSState of the Union: Containers on AWS
State of the Union: Containers on AWSAmazon Web Services
 
Amazon Web Services EC2 Container Service (ECS)
Amazon Web Services EC2 Container Service (ECS)Amazon Web Services EC2 Container Service (ECS)
Amazon Web Services EC2 Container Service (ECS)Mayank Patel
 
AWS Community Day - Andrew May - Running Containers in AWS
AWS Community Day - Andrew May - Running Containers in AWS  AWS Community Day - Andrew May - Running Containers in AWS
AWS Community Day - Andrew May - Running Containers in AWS AWS Chicago
 
Getting Started with Docker on AWS
Getting Started with Docker on AWSGetting Started with Docker on AWS
Getting Started with Docker on AWSAmazon Web Services
 
SRV201 Getting Started with Docker on AWS
SRV201 Getting Started with Docker on AWSSRV201 Getting Started with Docker on AWS
SRV201 Getting Started with Docker on AWSAmazon Web Services
 
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container DayECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container DayAmazon Web Services Korea
 
Scheduling Containers on Amazon ECS
Scheduling Containers on Amazon ECSScheduling Containers on Amazon ECS
Scheduling Containers on Amazon ECSAmazon Web Services
 

Similar to AWS ECS Meetup Talentica (20)

Running containers in AWS
Running containers in AWSRunning containers in AWS
Running containers in AWS
 
February 2016 Webinar Series - EC2 Container Service Deep Dive
February 2016 Webinar Series - EC2 Container Service Deep Dive February 2016 Webinar Series - EC2 Container Service Deep Dive
February 2016 Webinar Series - EC2 Container Service Deep Dive
 
Amazon EC2 container service
Amazon EC2 container serviceAmazon EC2 container service
Amazon EC2 container service
 
Walk-through: Amazon ECS
Walk-through: Amazon ECSWalk-through: Amazon ECS
Walk-through: Amazon ECS
 
Serverless and mixed container orchestration and request routing on AWS
Serverless and mixed container orchestration and request routing on AWSServerless and mixed container orchestration and request routing on AWS
Serverless and mixed container orchestration and request routing on AWS
 
Running containerized application in AWS ECS
Running containerized application in AWS ECSRunning containerized application in AWS ECS
Running containerized application in AWS ECS
 
AWS Elastic Container Service (ECS) with a CI Pipeline Overview
AWS Elastic Container Service (ECS) with a CI Pipeline OverviewAWS Elastic Container Service (ECS) with a CI Pipeline Overview
AWS Elastic Container Service (ECS) with a CI Pipeline Overview
 
ECS and ECR deep dive
ECS and ECR deep diveECS and ECR deep dive
ECS and ECR deep dive
 
Amazon ECS with Docker | AWS Public Sector Summit 2016
Amazon ECS with Docker | AWS Public Sector Summit 2016Amazon ECS with Docker | AWS Public Sector Summit 2016
Amazon ECS with Docker | AWS Public Sector Summit 2016
 
Docker on AWS - the Right Way
Docker on AWS - the Right WayDocker on AWS - the Right Way
Docker on AWS - the Right Way
 
State of the Union: Containers on AWS
State of the Union: Containers on AWSState of the Union: Containers on AWS
State of the Union: Containers on AWS
 
Amazon Web Services EC2 Container Service (ECS)
Amazon Web Services EC2 Container Service (ECS)Amazon Web Services EC2 Container Service (ECS)
Amazon Web Services EC2 Container Service (ECS)
 
AWS Community Day - Andrew May - Running Containers in AWS
AWS Community Day - Andrew May - Running Containers in AWS  AWS Community Day - Andrew May - Running Containers in AWS
AWS Community Day - Andrew May - Running Containers in AWS
 
ECS in action
ECS in actionECS in action
ECS in action
 
Advanced Container Scheduling
Advanced Container SchedulingAdvanced Container Scheduling
Advanced Container Scheduling
 
Getting Started with Docker on AWS
Getting Started with Docker on AWSGetting Started with Docker on AWS
Getting Started with Docker on AWS
 
SRV201 Getting Started with Docker on AWS
SRV201 Getting Started with Docker on AWSSRV201 Getting Started with Docker on AWS
SRV201 Getting Started with Docker on AWS
 
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container DayECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
 
Scheduling Containers on Amazon ECS
Scheduling Containers on Amazon ECSScheduling Containers on Amazon ECS
Scheduling Containers on Amazon ECS
 
Amazon EKS Deep Dive
Amazon EKS Deep DiveAmazon EKS Deep Dive
Amazon EKS Deep Dive
 

More from Anshul Patel

Chaos engineering with Litmus Chaos Framework
Chaos engineering with Litmus Chaos FrameworkChaos engineering with Litmus Chaos Framework
Chaos engineering with Litmus Chaos FrameworkAnshul Patel
 
Docker Fundamentals
Docker FundamentalsDocker Fundamentals
Docker FundamentalsAnshul Patel
 
Chaos Engineering with Gremlin Platform
Chaos Engineering with Gremlin PlatformChaos Engineering with Gremlin Platform
Chaos Engineering with Gremlin PlatformAnshul Patel
 
Introduction to docker_notary_v1.0.0
Introduction to docker_notary_v1.0.0Introduction to docker_notary_v1.0.0
Introduction to docker_notary_v1.0.0Anshul Patel
 
Linux Operating System Fundamentals
Linux Operating System FundamentalsLinux Operating System Fundamentals
Linux Operating System FundamentalsAnshul Patel
 
Building CLI Applications with Golang
Building CLI Applications with GolangBuilding CLI Applications with Golang
Building CLI Applications with GolangAnshul Patel
 
Linux kit meetup_v1.0.0
Linux kit meetup_v1.0.0Linux kit meetup_v1.0.0
Linux kit meetup_v1.0.0Anshul Patel
 
Meetup on Apache Zookeeper
Meetup on Apache ZookeeperMeetup on Apache Zookeeper
Meetup on Apache ZookeeperAnshul Patel
 

More from Anshul Patel (9)

Chaos engineering with Litmus Chaos Framework
Chaos engineering with Litmus Chaos FrameworkChaos engineering with Litmus Chaos Framework
Chaos engineering with Litmus Chaos Framework
 
Docker Fundamentals
Docker FundamentalsDocker Fundamentals
Docker Fundamentals
 
Chaos Engineering with Gremlin Platform
Chaos Engineering with Gremlin PlatformChaos Engineering with Gremlin Platform
Chaos Engineering with Gremlin Platform
 
Chaos Engineering
Chaos EngineeringChaos Engineering
Chaos Engineering
 
Introduction to docker_notary_v1.0.0
Introduction to docker_notary_v1.0.0Introduction to docker_notary_v1.0.0
Introduction to docker_notary_v1.0.0
 
Linux Operating System Fundamentals
Linux Operating System FundamentalsLinux Operating System Fundamentals
Linux Operating System Fundamentals
 
Building CLI Applications with Golang
Building CLI Applications with GolangBuilding CLI Applications with Golang
Building CLI Applications with Golang
 
Linux kit meetup_v1.0.0
Linux kit meetup_v1.0.0Linux kit meetup_v1.0.0
Linux kit meetup_v1.0.0
 
Meetup on Apache Zookeeper
Meetup on Apache ZookeeperMeetup on Apache Zookeeper
Meetup on Apache Zookeeper
 

Recently uploaded

VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Servicesexy call girls service in goa
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Roomdivyansh0kumar0
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Deliverybabeytanya
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsstephieert
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 

Recently uploaded (20)

VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girls
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 

AWS ECS Meetup Talentica

  • 1. Container Cluster Management with AWS ECS Anshul Patel Talentica DevOps Engineering Team
  • 2. What is Docker container ?  Open platform to build, ship and run distributed applications  Groups application with all the dependencies, shared libs  Compared to Traditional Virtualized system, which encapsulates OS + Kernel, Docker has same Kernel Space  Isolation between different containers is done through Namespaces, Cgroups, Network Interfaces  Current Docker Engine Stable version 1.11.2 (2016-05-31)  Default Engine Execution Driver : libcontainer  Docker uses libcontainer to manipulate Namespaces, Cgroups, Network Interfaces
  • 3. Why Docker ?  Lightweight, Open and Secure  Portable and efficient in comparison to VM  Accelerates Developer onboarding  Empower Developer creativity  Eliminates Environmental Inconsistencies  Ability to scale quickly  Reduces time to market of your application
  • 5. Why Container Cluster Management System ?  Provides clustering layer for controlling the deployment of your containers onto the underlying hosts  Manages container lifecycle within the cluster  Scheduling Containers across the cluster  Abstracting developers away from underlying machines  Scaling containers  Increases robustness and resilience of distributed containerized application
  • 6. What is AWS ECS (EC2 Container Service) ?  Highly scalable, fast, container management service from Amazon Web Services.  Easily run, stop and manage Docker containers on cluster of Amazon EC2 instances  Schedules the placement of Docker containers across your cluster based on resource needs, availability and requirements  Eliminates need for you to operate your own cluster management systems or write wrappers/logic for scaling your underlying infrastructure
  • 7. Components of ECS  Cluster - Logical group of container instances  Container Instance - Runs ECS agents and is registered to cluster  Task Definition - Description of application to be deployed  Scheduler - Method of placing task on container instance  Task - An instantiation of task definition running on container instance  Service - Runs and maintains predefined tasks simultaneously  Container - Docker Container created during task instantiation
  • 9. ECS Architecture Key Components  Agent Communication Service - Gateway between ECS agents and ECS backend cluster management engine  API - Provides cluster state information  Cluster Management Engine - Provides cluster coordination and state management  Key/Value Store - It is used to storing cluster state information
  • 10. ECS Architecture  It isn’t a blackbox, runs on your own EC2(Container) instances  ECS cluster is collection of EC2(Container) Instances  ECS agent is installed on each of EC2(Container) Instances  ECS agent registers instance to centralised ECS service  ECS agent handles incoming requests for container deployment  ECS agent handles the lifecycle of container
  • 11. Creating ECS Cluster  Cluster can be created using AWS Console, alternatively you can create using aws ecs CLI  AWS Container Instance Requirement  Linux Kernel > = 3.10  Docker > = 1.5.0  ECS container agent  Nanny process to monitor ECS agent (For eg: ecs-init )  Amazon ECS optimized AMI is preconfigured with these requirements
  • 12. Launching EC2 container Instances Points to remember  ec2InstanceRole must be created  If the EC2 instance is required to be part of pre-defined cluster, following should be added in user data #/bin/bash echo ECS_CLUSTER=your_cluster_name >> /etc/ecs/ecs.config  During the launch of AMI, it will consist of two EBS, one for OS and another for Docker’s use.
  • 13. ECS Task Definition  Task definition is 1 or more container definitions  It defines  Docker Images to use  Port and Drive Volume Mapping  CPU and memory to use with container  Whether containers are linked  Environmental variable which is required to be passed to container  Whether task should continue if container finishes or fails
  • 14. ECS Scheduler  By default, AWS supports two ways for scheduling  Running Tasks  Services  Apart from the above, StartTask API of ECS can be used to write custom scheduler. Currently Amazon has developed PoC scheduler for Mesos
  • 15. ECS Running Tasks  Instantiation of Task Definition  Task can be either short lived or long lived. (For eg: event-driven- data task or batch jobs)  Architecturally all containers belonging to same task, have to run on the same machine. In order to run container on different machine, new task should be created.  Co-location of containers can be achieved by grouping them in the same task
  • 16. ECS services  Allows you to run and maintain a specified/desired number of instances ( For eg : webservers )  If any tasks should fail or stop for any reason, ECS service scheduler launches another instance of your task definition to maintain desired count
  • 17. Deploying ECS Cluster  Create a Load Balancer  Create a Launch configuration  Create a Autoscaling group, which specifies the desired number of instances  Create a task definition  Create a service
  • 18. ECS Container Instance Autoscaling  ECS provides cluster-level parameters which can give the cluster utilization statistics  MemoryReservation - Current % of reserved memory by cluster  MemoryUtilization - Current % of utilized memory by cluster  CPUReservation - Current % of reserved CPU by cluster  CPUUtilization - Current % of utilized CPU by cluster  CloudWatch Alarms on the above parameters enables to Scale Up/Down the ECS cluster
  • 19. ECS Task Autoscaling  ECS also provides the facility to scale up the tasks in the service.  Tasks can be autoscaled on following ECS service parameters  CPUUtilization - Current % CPU utilization by ECS service  MemoryUtilization - Current % Memory Utilization by ECS service
  • 20. EC2 Container Registry  AWS managed Docker container registry  Stores and Manages Docker Images  Hosts images in a highly available and scalable architecture  It is integrated with ECS  No upfront fee, pay only for the data stored
  • 21. Key Advantages of ECS Service  ECS is monitoring status of Docker containers, so if it goes down it will be deployed automatically  ASG is monitoring your EC2 instances, if one instance goes down, it will spawn new instance  ECS can do zero-downtime deployments of new version ( Blue - Green deployments )  Updation requires two things  Create new revision of task  Update the revision in the service
  • 22. Key Challenges  No direct relation between EC2 Autoscaling and Task Autoscaling  ELB works with 1:1 port mapping, so if the number of tasks is equal to the number of instances, scheduler will not attempt to deploy another task  Service Discovery
  • 23. ECS Limits Resource Default Limit Number of clusters per region, per account 1000 Number of container instances per cluster 1000 Number of services per cluster 500
  • 24. ECS Limits Resource Default Limit Number of load balancers per service 1 Number of tasks per service (the desired count) 1000 Number of tasks launched (count) per run- task 10 Number of container instances per start- task 10 Throttle on container instance registration rate 1 per second / 60 max per minute Task definition size limit 32 KiB Task definition max containers 10 Throttle on task definition registration rate 1 per second / 60 max per minute

Editor's Notes

  1. Apart from the libcontainer, docker is compatible with Openvz Systemd-nspawn Libvirt-lxc Libvirt-sandbox qemu/kvm BSD jails Solaris zones LXC What does a driver do ? Provides a way to manipulate namespaces, control groups, network interfaces, firewall rules, apparmor profiles Why libcontainer ? Can manipulate the above mentioned things in a consistent and predictable way, without depending on userland packages.
  2. AMI  US-WEST-2 : amzn-ami-2016.03.c-amazon-ecs-optimized
  3. 1 core = 1,024 CPU units Calculation Memory MemoryReservation = ( Total MB of memory reserved by tasks in cluster * 100 )/ Total MB registered by container instances in cluster MemoryUtilization = ( Total MB of memory used by tasks in cluster * 100 ) / Total MB of memory registered by container instances in cluster CPU CPUReservavtion = ( Total CPU units reserved by tasks in cluster * 100 )/ Total CPU units registered by containers instances in cluster CPUUtilization = (Total CPU units used by tasks in cluster * 100)/ Total CPU units registered by container instances in cluster in cluster
  4. CPU Service CPU Utilization = ( Total CPU units used by tasks in service * 100 ) / ( Total CPU units reserved in task definition * number of tasks in service ) Memory Service Memory Utilization = ( Total MB of memory used by tasks in service * 100)/(Total MB of memory reserved in task definition * number of tasks)
  5. First point : Set tasks much higher than EC2 instances, so if the EC2 Instance scaling happens, it will automatically schedule the tasks Second point : Use HAProxy or Traefik LB