SlideShare una empresa de Scribd logo
1 de 31
ECS Workshop
- Prashant Kalkar, Kaushik
Chandrashekar
Agenda
● Good design - Continuous delivery and Infrastructure as code.
● Continuous integration & Containerizing services.
● Deployment on ECS & deployment uptime.
● Platform thinking for IAC.
● ECS Service scaling.
● ECS Cluster scaling - challenges and solutions.
● (Demo) Cluster updates & service uptime.
● (Demo) Multiple environments and on-demand environments.
● Blue green deployments.
Design Objectives
On-demand
Self-service
Disposable
Consistent
Services available continuously
Tools you need
● Git
● Git bash (for windows only)
● Github account (with SSH key configured)
● Virtualbox
● Vagrant
● IntelliJ Idea or Eclipse.
Development Setup
● Fork workshop repository and clone on local machine.
● Login to aws and download access key csv.
● Generate Github token. (refer here)
● Copy and populate workshop_config.template to your user home.
● Build vagrant image.
● Ssh into vagrant
● Upload vagrant github ssh key to your github account.
Setup your Jenkins
● Build Jenkins docker image.
● Publish jenkins image.
● Terraform for IAC.
● Build infrastructure (provision jenkins).
Example details - Asgard Portal
Provides information about Asgard and its Gods - Odin & Thor.
A microservice will be deployed for every God.
We will have fun deploying these services.
Containerizing Odin
Exercise 0 - Create service build pipeline.
Infrastructure for ECS
Exercise 1 - ECS Cluster + EC2 Instance
ECS Infrastructure
Exercise 2 - ECS Cluster + ASG
Exercise 3 - Route53 + ALB + ECS Cluster + ASG
ALB Structure
Service Deployment
Exercise 4 - Odin service deployment on the ECS cluster.
Exercise 5 - Thor service deployment on ECS cluster.
Shortcomings of CD solution till now
Deployment pipelines per service - Issue if there are many services.
Provisioning a fully functional cluster will take time as all services have to be
deployed.
Different services with different needs (CPU/Memory) will need frequent change
to cluster.
Provisioning a new environment will require a new pipeline per service.
Platform Thinking
Solution that is adaptive.
Cluster owns the services.
Provisioning and restoring a cluster provisions the services.
Uniform way of mapping cluster and services.
Exercise 6
Adaptive Cluster & Service Mapping
Container Scaling
Exercise 7 - Target tracking based on service memory.
Cluster Scaling
ECS is responsible for container scaling
ASG responsible for instance scaling
We need a way to scale cluster as containers are scaling.
Scaling speed mismatch between EC2 and ECS.
Ahead of time Cluster Scaling
Ref: https://engineering.depop.com/ahead-of-time-scheduling-on-ecs-ec2-d4ef124b1d9e
Exercise 8 - Cluster scaling
Add auto scaling policies and alarms to scale cluster
Try out certain scenarios.
Cluster Updates
ASG rolling updates - Demo.
Instance draining during cluster updates.
Draining lambda.
Demo
Blue green deployment
Cons
This design requires new ALB and clusters for running different version of the
services.
DNS might require some time to propagate change (TTL time)
Misbehaving client might still send traffic to old load balancer even after switch
is complete.
Final Thoughts
ECS can provide path to transition to containerization.
Think platform and service team.
Let containers scale early.
Treat everything Disposable.
Adapt On-Demand and Self-Service model.
References & Credits
Ahead of time cluster scaling
https://engineering.depop.com/ahead-of-time-scheduling-on-ecs-ec2-
d4ef124b1d9e
How to Automate Container Instance Draining in Amazon ECS
https://aws.amazon.com/blogs/compute/how-to-automate-container-instance-
draining-in-amazon-ecs/
Feedback
Please submit feedback form so that we can improve further
http://bit.ly/et18-ws-ecs
Thank You!
Questions?

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Getting Started with Docker On AWS
Getting Started with Docker On AWSGetting Started with Docker On AWS
Getting Started with Docker On AWS
 
Workshop: Deploy a Deep Learning Framework on Amazon ECS
Workshop: Deploy a Deep Learning Framework on Amazon ECSWorkshop: Deploy a Deep Learning Framework on Amazon ECS
Workshop: Deploy a Deep Learning Framework on Amazon ECS
 
Container Orchestration with Amazon ECS
Container Orchestration with Amazon ECSContainer Orchestration with Amazon ECS
Container Orchestration with Amazon ECS
 
Intro to batch processing on AWS
Intro to batch processing on AWSIntro to batch processing on AWS
Intro to batch processing on AWS
 
AWS Elastic Container Service
AWS Elastic Container ServiceAWS Elastic Container Service
AWS Elastic Container Service
 
Containers Meetup (AWS+CNCF) Milano Jan 15th 2020
Containers Meetup (AWS+CNCF) Milano Jan 15th 2020Containers Meetup (AWS+CNCF) Milano Jan 15th 2020
Containers Meetup (AWS+CNCF) Milano Jan 15th 2020
 
(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
 
Workshop: Serverless DevOps to the Rescue
Workshop: Serverless DevOps to the RescueWorkshop: Serverless DevOps to the Rescue
Workshop: Serverless DevOps to the Rescue
 
Batch Processing with Containers on AWS - June 2017 AWS Online Tech Talks
Batch Processing with Containers on AWS -  June 2017 AWS Online Tech TalksBatch Processing with Containers on AWS -  June 2017 AWS Online Tech Talks
Batch Processing with Containers on AWS - June 2017 AWS Online Tech Talks
 
Serverless data processing with Data Pipeline
Serverless data processing with Data PipelineServerless data processing with Data Pipeline
Serverless data processing with Data Pipeline
 
ECS and ECR deep dive
ECS and ECR deep diveECS and ECR deep dive
ECS and ECR deep dive
 
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
 
Serverless computing
Serverless computingServerless computing
Serverless computing
 
Developer workflow with docker
Developer workflow with dockerDeveloper workflow with docker
Developer workflow with docker
 
KSQL---Streaming SQL for Apache Kafka
KSQL---Streaming SQL for Apache KafkaKSQL---Streaming SQL for Apache Kafka
KSQL---Streaming SQL for Apache Kafka
 
Building a PaaS with Docker and AWS
Building a PaaS with Docker and AWSBuilding a PaaS with Docker and AWS
Building a PaaS with Docker and 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)
 
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
 
Aws atlanta march_2015
Aws atlanta march_2015Aws atlanta march_2015
Aws atlanta march_2015
 
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
 

Similar a AWS ECS workshop

Similar a AWS ECS workshop (20)

Docker on Amazon ECS
Docker on Amazon ECSDocker on Amazon ECS
Docker on Amazon ECS
 
Using Deep Learning Toolkits with Kubernetes clusters
Using Deep Learning Toolkits with Kubernetes clustersUsing Deep Learning Toolkits with Kubernetes clusters
Using Deep Learning Toolkits with Kubernetes clusters
 
Bootstrapping Clusters with EKS Blueprints.pptx
Bootstrapping Clusters with EKS Blueprints.pptxBootstrapping Clusters with EKS Blueprints.pptx
Bootstrapping Clusters with EKS Blueprints.pptx
 
20171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v0120171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v01
 
Distributed Tensorflow with Kubernetes - data2day - Jakob Karalus
Distributed Tensorflow with Kubernetes - data2day - Jakob KaralusDistributed Tensorflow with Kubernetes - data2day - Jakob Karalus
Distributed Tensorflow with Kubernetes - data2day - Jakob Karalus
 
Velocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ NetflixVelocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ Netflix
 
Journey of Kubernetes Scaling
Journey of Kubernetes ScalingJourney of Kubernetes Scaling
Journey of Kubernetes Scaling
 
Scala, ECS, Docker: Delayed Execution @Coursera
Scala, ECS, Docker: Delayed Execution @CourseraScala, ECS, Docker: Delayed Execution @Coursera
Scala, ECS, Docker: Delayed Execution @Coursera
 
OS for AI: Elastic Microservices & the Next Gen of ML
OS for AI: Elastic Microservices & the Next Gen of MLOS for AI: Elastic Microservices & the Next Gen of ML
OS for AI: Elastic Microservices & the Next Gen of ML
 
[GS네오텍] Google Kubernetes Engine
[GS네오텍]  Google Kubernetes Engine [GS네오텍]  Google Kubernetes Engine
[GS네오텍] Google Kubernetes Engine
 
Migrating Existing Open Source Machine Learning to Azure
Migrating Existing Open Source Machine Learning to AzureMigrating Existing Open Source Machine Learning to Azure
Migrating Existing Open Source Machine Learning to Azure
 
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
 
Container orchestration and microservices world
Container orchestration and microservices worldContainer orchestration and microservices world
Container orchestration and microservices world
 
To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…
 
Migrating existing open source machine learning to azure
Migrating existing open source machine learning to azureMigrating existing open source machine learning to azure
Migrating existing open source machine learning to azure
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
 
Democratizing machine learning on kubernetes
Democratizing machine learning on kubernetesDemocratizing machine learning on kubernetes
Democratizing machine learning on kubernetes
 
Containerized architectures for deep learning
Containerized architectures for deep learningContainerized architectures for deep learning
Containerized architectures for deep learning
 
Build optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and DockerBuild optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and Docker
 
Api versioning w_docker_and_nginx
Api versioning w_docker_and_nginxApi versioning w_docker_and_nginx
Api versioning w_docker_and_nginx
 

Más de Prashant Kalkar

Más de Prashant Kalkar (8)

Design principles to modularise a monolith codebase.pptx
Design principles to modularise a monolith codebase.pptxDesign principles to modularise a monolith codebase.pptx
Design principles to modularise a monolith codebase.pptx
 
GDCR 2022.pptx.pdf
GDCR 2022.pptx.pdfGDCR 2022.pptx.pdf
GDCR 2022.pptx.pdf
 
Exploring the flow of network traffic through kubernetes cluster.pptx
Exploring the flow of network traffic through kubernetes cluster.pptxExploring the flow of network traffic through kubernetes cluster.pptx
Exploring the flow of network traffic through kubernetes cluster.pptx
 
Uncover the mysteries of infrastructure as code (iac)!
Uncover the mysteries of infrastructure as code (iac)!Uncover the mysteries of infrastructure as code (iac)!
Uncover the mysteries of infrastructure as code (iac)!
 
Microservices testing consumer driven contracts using pact
Microservices testing  consumer driven contracts using pact Microservices testing  consumer driven contracts using pact
Microservices testing consumer driven contracts using pact
 
Hibernate
HibernateHibernate
Hibernate
 
Functional programming
Functional programmingFunctional programming
Functional programming
 
Functional programming ii
Functional programming iiFunctional programming ii
Functional programming ii
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

AWS ECS workshop

  • 1. ECS Workshop - Prashant Kalkar, Kaushik Chandrashekar
  • 2. Agenda ● Good design - Continuous delivery and Infrastructure as code. ● Continuous integration & Containerizing services. ● Deployment on ECS & deployment uptime. ● Platform thinking for IAC. ● ECS Service scaling. ● ECS Cluster scaling - challenges and solutions. ● (Demo) Cluster updates & service uptime. ● (Demo) Multiple environments and on-demand environments. ● Blue green deployments.
  • 4. Tools you need ● Git ● Git bash (for windows only) ● Github account (with SSH key configured) ● Virtualbox ● Vagrant ● IntelliJ Idea or Eclipse.
  • 5. Development Setup ● Fork workshop repository and clone on local machine. ● Login to aws and download access key csv. ● Generate Github token. (refer here) ● Copy and populate workshop_config.template to your user home. ● Build vagrant image. ● Ssh into vagrant ● Upload vagrant github ssh key to your github account.
  • 6. Setup your Jenkins ● Build Jenkins docker image. ● Publish jenkins image. ● Terraform for IAC. ● Build infrastructure (provision jenkins).
  • 7. Example details - Asgard Portal Provides information about Asgard and its Gods - Odin & Thor. A microservice will be deployed for every God. We will have fun deploying these services.
  • 8. Containerizing Odin Exercise 0 - Create service build pipeline.
  • 10. Exercise 1 - ECS Cluster + EC2 Instance
  • 11.
  • 12. ECS Infrastructure Exercise 2 - ECS Cluster + ASG Exercise 3 - Route53 + ALB + ECS Cluster + ASG
  • 14. Service Deployment Exercise 4 - Odin service deployment on the ECS cluster. Exercise 5 - Thor service deployment on ECS cluster.
  • 15. Shortcomings of CD solution till now Deployment pipelines per service - Issue if there are many services. Provisioning a fully functional cluster will take time as all services have to be deployed. Different services with different needs (CPU/Memory) will need frequent change to cluster. Provisioning a new environment will require a new pipeline per service.
  • 16. Platform Thinking Solution that is adaptive. Cluster owns the services. Provisioning and restoring a cluster provisions the services. Uniform way of mapping cluster and services.
  • 17. Exercise 6 Adaptive Cluster & Service Mapping
  • 18. Container Scaling Exercise 7 - Target tracking based on service memory.
  • 19. Cluster Scaling ECS is responsible for container scaling ASG responsible for instance scaling We need a way to scale cluster as containers are scaling. Scaling speed mismatch between EC2 and ECS.
  • 20. Ahead of time Cluster Scaling Ref: https://engineering.depop.com/ahead-of-time-scheduling-on-ecs-ec2-d4ef124b1d9e
  • 21. Exercise 8 - Cluster scaling Add auto scaling policies and alarms to scale cluster Try out certain scenarios.
  • 22. Cluster Updates ASG rolling updates - Demo. Instance draining during cluster updates.
  • 23.
  • 26.
  • 27. Cons This design requires new ALB and clusters for running different version of the services. DNS might require some time to propagate change (TTL time) Misbehaving client might still send traffic to old load balancer even after switch is complete.
  • 28. Final Thoughts ECS can provide path to transition to containerization. Think platform and service team. Let containers scale early. Treat everything Disposable. Adapt On-Demand and Self-Service model.
  • 29. References & Credits Ahead of time cluster scaling https://engineering.depop.com/ahead-of-time-scheduling-on-ecs-ec2- d4ef124b1d9e How to Automate Container Instance Draining in Amazon ECS https://aws.amazon.com/blogs/compute/how-to-automate-container-instance- draining-in-amazon-ecs/
  • 30. Feedback Please submit feedback form so that we can improve further http://bit.ly/et18-ws-ecs

Notas del editor

  1. Fork the repo our repo. Build vagrant image. Pre-requisite GitHub user. They have SSH Keys for Github account on the machine. Vagrant with Virtualbox.
  2. Create mapping - Empty cluster. Provision cluster Provision some services See pipeline creating the services. Update service configs. Add / Remove services