SlideShare a Scribd company logo
1 of 22
Deploying a (Dockerized) application
onto
EC2 Container Service (ECS)
Wyn Van Devanter
@wynv
EC2 Container Service (ECS)
• Manages clusters of EC2 instances for running containers
• Takes care of installing, operating and scaling a cluster management
infrastructure
EC2 Container Service (ECS)
• Container management with API
• Centralized service to get cluster state
• Schedules the placement of containers across your cluster based on
resources needs, isolation policies, and availability requirements
• Can integrate your own scheduler
• Integrated with other EC2 and AWS services and features
Key terms
• Cluster – logical grouping of EC2 instances, each with ECS container
agent installed
• Container Instance - EC2 instance with container agent that runs
containers in ECS
• Task Definition (like docker-compose.yml) – blueprint for the app to
run in ECS; describes containers to run for app, and where
environment variables can go
• Task – running instance of a task definition
• Service – keeps 1+ tasks running
• Elastic Container Registry (ECR)
ECS Clusters
• Run containers across instances in availability zones in a region
• Cluster contains EC2 instances (called container instances). ECS-
optimized AMIs are available.
• Instances contain the ECS container agent
• Sends information about the instance's current running tasks and resource
utilization to Amazon ECS
• Starts and stops tasks whenever it receives a request from Amazon ECS
Running apps on ECS
• Define task definitions to specify what container images to run across
your clusters
• Container images are pulled from container registries (i.e. ECR)
• Services can be used with a task definition to keep a desired number
of app instances running
Task definitions
• To prepare your application to run on Amazon ECS, you create a task
definition.
• JSON file that describes one or more containers run to form your
application; blueprint
• Similar to the Docker Compose file and can be generated from one
• Specify various parameters for your application, such as:
• which image(s) to use
• which ports should be opened
• what data volumes should be used
• where the container(s) should be placed
Tasks
• An instantiation of a task definition on a container instance within
your cluster
• The Amazon ECS task scheduler is responsible for placing tasks on
container instances
• Restarted as needed
Services
• You can define a service that runs and maintains a specified number
of tasks simultaneously
• Manages running your application
• Allows scaling more instances (containers) of your app as needed
ECS setup
• Setting up IAM accounts for ECS management and deployment
• Setting up ECS for application deployment
• Setting up CI for automatic build and deployment
Setting up IAM accounts for ECS management
and deployment
• IAM account for ECS management (i.e. creating cluster, load balancer)
• IAM account for ECS deployment (i.e. updating services and task
definitions)
• Groups
Setting up ECS for application deployment
• Create cluster
• Create EC2 Container Registry (ECR) for app
• Set up load balancer for app
Setting up ECS for application deployment
• Create a task definition for the app first environment (i.e. dev/staging
or production)
• Create a service to run the task definition
• Repeat for each environment, setting their environment variables
Setting up CI for automatic build and deployment
• Set environment variables for app in CI (i.e. cluster name, task
definition base name, AWS account ID)
• Link to repository with app w/.travis.yml & deployment bash scripts
Deploying
• TravisCI detects check-in
• Builds app via Docker & pushes to ECR
• Deploys using task definition
App infrastructure
• API app in a container (ASP.NET Core)
• PostgreSQL container, data mounted via volume
• EC2 Container Service (ECS) 2-node cluster with ECR, load balancer,
AWS Certificates and Route 53
• Travis with bash scripts for CI/CD
Thanks!
@wynv
o Docs: Overview & Key Concepts
http://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html
o Docs: Core Setup Steps, http://docs.aws.amazon.com/AmazonECS/latest/developerguide/get-
set-up-for-amazon-ecs.html
o Reference architecture for ECS w/deployment pipeline (CloudFormation),
https://github.com/awslabs/ecs-refarch-continuous-
deployment/blob/master/templates/deployment-pipeline.yaml
o ECS IAM Policies,
http://docs.aws.amazon.com/AmazonECS/latest/developerguide/IAM_policies.html
o Sample app ready for ECS with task definition, https://github.com/excellalabs/ecs-deploy-
setup

More Related Content

What's hot

(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
Amazon Web Services
 
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Amazon Web Services
 

What's hot (20)

(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
 
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
 
Getting Started with Docker On AWS
Getting Started with Docker On AWSGetting Started with Docker On AWS
Getting Started with Docker On AWS
 
AWS ECS Meetup Talentica
AWS ECS Meetup TalenticaAWS ECS Meetup Talentica
AWS ECS Meetup Talentica
 
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
 
AWS ECS workshop
AWS ECS workshopAWS ECS workshop
AWS ECS workshop
 
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECSWeaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
 
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
 
Continuous Delivery with Docker and Amazon ECS
Continuous Delivery with Docker and Amazon ECSContinuous Delivery with Docker and Amazon ECS
Continuous Delivery with Docker and Amazon ECS
 
Containerization with Microsoft Azure
Containerization with Microsoft AzureContainerization with Microsoft Azure
Containerization with Microsoft Azure
 
(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014
(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014
(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014
 
Architecting on The Cloud
Architecting on The CloudArchitecting on The Cloud
Architecting on The Cloud
 
AWS ECS Quick Introduction
AWS ECS Quick IntroductionAWS ECS Quick Introduction
AWS ECS Quick Introduction
 
Micrsoservices unleashed with containers and ECS
Micrsoservices unleashed with containers and ECSMicrsoservices unleashed with containers and ECS
Micrsoservices unleashed with containers and ECS
 
Getting Started with Amazon EC2 Container Service
Getting Started with Amazon EC2 Container ServiceGetting Started with Amazon EC2 Container Service
Getting Started with Amazon EC2 Container Service
 
Workshop: Serverless DevOps to the Rescue
Workshop: Serverless DevOps to the RescueWorkshop: Serverless DevOps to the Rescue
Workshop: Serverless DevOps to the Rescue
 
AWS Elastic Beanstalk: Running Multi-Container Docker Applications - DevDay L...
AWS Elastic Beanstalk: Running Multi-Container Docker Applications - DevDay L...AWS Elastic Beanstalk: Running Multi-Container Docker Applications - DevDay L...
AWS Elastic Beanstalk: Running Multi-Container Docker Applications - DevDay L...
 
Advanced Container Management and Scheduling
Advanced Container Management and SchedulingAdvanced Container Management and Scheduling
Advanced Container Management and Scheduling
 
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
 
Containerization in microsoft azure
Containerization in microsoft azureContainerization in microsoft azure
Containerization in microsoft azure
 

Similar to AWS Elastic Container Service (ECS) with a CI Pipeline Overview

Similar to AWS Elastic Container Service (ECS) with a CI Pipeline Overview (20)

ECS and ECR deep dive
ECS and ECR deep diveECS and ECR deep dive
ECS and ECR deep dive
 
Walk-through: Amazon ECS
Walk-through: Amazon ECSWalk-through: Amazon ECS
Walk-through: Amazon ECS
 
Containers on AWS
Containers on AWSContainers on AWS
Containers 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
 
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 ECS Deep Dive
Amazon ECS Deep DiveAmazon ECS Deep Dive
Amazon ECS Deep Dive
 
Container Management with Amazon ECS
Container Management with Amazon ECSContainer Management with Amazon ECS
Container Management with Amazon ECS
 
Amazon EC2 container service
Amazon EC2 container serviceAmazon EC2 container service
Amazon EC2 container service
 
AWS Elastic Container Service
AWS Elastic Container ServiceAWS Elastic Container Service
AWS Elastic Container Service
 
AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS
AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWSAWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS
AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS
 
Getting Started with Amazon EKS (Managed Kubernetes)
Getting Started with Amazon EKS (Managed Kubernetes)Getting Started with Amazon EKS (Managed Kubernetes)
Getting Started with Amazon EKS (Managed Kubernetes)
 
Docker on AWS - the Right Way
Docker on AWS - the Right WayDocker on AWS - the Right Way
Docker on AWS - the Right Way
 
Amazon ECS.pptx tasks conatiner ecs new car
Amazon ECS.pptx tasks conatiner ecs new carAmazon ECS.pptx tasks conatiner ecs new car
Amazon ECS.pptx tasks conatiner ecs new car
 
How To Run Your Containers on AWS with ECS & Fargate: Collision 2018
How To Run Your Containers on AWS with ECS & Fargate: Collision 2018How To Run Your Containers on AWS with ECS & Fargate: Collision 2018
How To Run Your Containers on AWS with ECS & Fargate: Collision 2018
 
AWS Elastic Beanstalk運作微服務與Docker
AWS Elastic Beanstalk運作微服務與Docker AWS Elastic Beanstalk運作微服務與Docker
AWS Elastic Beanstalk運作微服務與Docker
 
Continuous Delivery to Amazon EC2 Container Service
Continuous Delivery to Amazon EC2 Container ServiceContinuous Delivery to Amazon EC2 Container Service
Continuous Delivery to Amazon EC2 Container Service
 
Containers at AWS: State of the Union
Containers at AWS: State of the Union  Containers at AWS: State of the Union
Containers at AWS: State of the Union
 
Containerize all the things!
Containerize all the things!Containerize all the things!
Containerize all the things!
 
Intro to Amazon ECS
Intro to Amazon ECSIntro to Amazon ECS
Intro to Amazon ECS
 
intro elastic container service amazon aws
intro elastic container service amazon awsintro elastic container service amazon aws
intro elastic container service amazon aws
 

More from Wyn B. Van Devanter

More from Wyn B. Van Devanter (7)

Benefits from AATs
Benefits from AATsBenefits from AATs
Benefits from AATs
 
Developer workflow with docker
Developer workflow with dockerDeveloper workflow with docker
Developer workflow with docker
 
.Net Core 1.0 vs .NET Framework
.Net Core 1.0 vs .NET Framework.Net Core 1.0 vs .NET Framework
.Net Core 1.0 vs .NET Framework
 
Testable requirements
Testable requirementsTestable requirements
Testable requirements
 
Performance tuning an Object-Relational Mapper (ORM)
Performance tuning an Object-Relational Mapper (ORM)Performance tuning an Object-Relational Mapper (ORM)
Performance tuning an Object-Relational Mapper (ORM)
 
Automated Acceptance Test Practices and Pitfalls
Automated Acceptance Test Practices and PitfallsAutomated Acceptance Test Practices and Pitfalls
Automated Acceptance Test Practices and Pitfalls
 
Automated Acceptance Tests in .NET
Automated Acceptance Tests in .NETAutomated Acceptance Tests in .NET
Automated Acceptance Tests in .NET
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

AWS Elastic Container Service (ECS) with a CI Pipeline Overview

  • 1. Deploying a (Dockerized) application onto EC2 Container Service (ECS) Wyn Van Devanter @wynv
  • 2. EC2 Container Service (ECS) • Manages clusters of EC2 instances for running containers • Takes care of installing, operating and scaling a cluster management infrastructure
  • 3. EC2 Container Service (ECS) • Container management with API • Centralized service to get cluster state • Schedules the placement of containers across your cluster based on resources needs, isolation policies, and availability requirements • Can integrate your own scheduler • Integrated with other EC2 and AWS services and features
  • 4. Key terms • Cluster – logical grouping of EC2 instances, each with ECS container agent installed • Container Instance - EC2 instance with container agent that runs containers in ECS • Task Definition (like docker-compose.yml) – blueprint for the app to run in ECS; describes containers to run for app, and where environment variables can go • Task – running instance of a task definition • Service – keeps 1+ tasks running • Elastic Container Registry (ECR)
  • 5.
  • 6. ECS Clusters • Run containers across instances in availability zones in a region • Cluster contains EC2 instances (called container instances). ECS- optimized AMIs are available. • Instances contain the ECS container agent • Sends information about the instance's current running tasks and resource utilization to Amazon ECS • Starts and stops tasks whenever it receives a request from Amazon ECS
  • 7. Running apps on ECS • Define task definitions to specify what container images to run across your clusters • Container images are pulled from container registries (i.e. ECR) • Services can be used with a task definition to keep a desired number of app instances running
  • 8. Task definitions • To prepare your application to run on Amazon ECS, you create a task definition. • JSON file that describes one or more containers run to form your application; blueprint • Similar to the Docker Compose file and can be generated from one • Specify various parameters for your application, such as: • which image(s) to use • which ports should be opened • what data volumes should be used • where the container(s) should be placed
  • 9. Tasks • An instantiation of a task definition on a container instance within your cluster • The Amazon ECS task scheduler is responsible for placing tasks on container instances • Restarted as needed
  • 10. Services • You can define a service that runs and maintains a specified number of tasks simultaneously • Manages running your application • Allows scaling more instances (containers) of your app as needed
  • 11.
  • 12.
  • 13.
  • 14. ECS setup • Setting up IAM accounts for ECS management and deployment • Setting up ECS for application deployment • Setting up CI for automatic build and deployment
  • 15. Setting up IAM accounts for ECS management and deployment • IAM account for ECS management (i.e. creating cluster, load balancer) • IAM account for ECS deployment (i.e. updating services and task definitions) • Groups
  • 16. Setting up ECS for application deployment • Create cluster • Create EC2 Container Registry (ECR) for app • Set up load balancer for app
  • 17. Setting up ECS for application deployment • Create a task definition for the app first environment (i.e. dev/staging or production) • Create a service to run the task definition • Repeat for each environment, setting their environment variables
  • 18. Setting up CI for automatic build and deployment • Set environment variables for app in CI (i.e. cluster name, task definition base name, AWS account ID) • Link to repository with app w/.travis.yml & deployment bash scripts
  • 19.
  • 20. Deploying • TravisCI detects check-in • Builds app via Docker & pushes to ECR • Deploys using task definition
  • 21. App infrastructure • API app in a container (ASP.NET Core) • PostgreSQL container, data mounted via volume • EC2 Container Service (ECS) 2-node cluster with ECR, load balancer, AWS Certificates and Route 53 • Travis with bash scripts for CI/CD
  • 22. Thanks! @wynv o Docs: Overview & Key Concepts http://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html o Docs: Core Setup Steps, http://docs.aws.amazon.com/AmazonECS/latest/developerguide/get- set-up-for-amazon-ecs.html o Reference architecture for ECS w/deployment pipeline (CloudFormation), https://github.com/awslabs/ecs-refarch-continuous- deployment/blob/master/templates/deployment-pipeline.yaml o ECS IAM Policies, http://docs.aws.amazon.com/AmazonECS/latest/developerguide/IAM_policies.html o Sample app ready for ECS with task definition, https://github.com/excellalabs/ecs-deploy- setup

Editor's Notes

  1. -ASP.NET Core flavor
  2. -clean up what is there -show quick running of existing container – with SDK -build a container -run it, stop it. Log in. -change some code and re-run -docker push -clean up -docker-compose