SlideShare a Scribd company logo
1 of 22
Download to read offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Running Amazon EKS Workloads on
Amazon EC2 Spot Instances
Madhuri Peri
Sr. IoT Solutions Architect
Amazon Web Services
C M P 4 0 3
Shawn O’Connor
Solutions Architect
Amazon Web Services
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
Overview of Amazon EC2 Spot
Overview of Amazon EKS
Provisioning Amazon EC2 Spot in Amazon EKS
Scaling with Amazon EC2 Spot in Amazon EKS
Handling Interruptions
Workshop Overview
Workshop Cleanup
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EC2 Purchasing Options
On-Demand
Pay for compute capacity by the second
with no long-term commitments
Spiky workloads, to define
needs
Reserved Instances
Make a 1- or 3-Year commitment and
receive a significant discount off On-
Demand prices
Committed, steady-state usage
Spot Instances
Spare Amazon EC2 capacity at savings of
up to 90% off On-Demand prices
Fault-tolerant, flexible, stateless
workloads
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why Spot Instances?
Inexpensive
Significant price savings of up to
90% over On-Demand Instances.
Perfect for stateless and fault-
tolerant workloads
Faster Results
Easily run multiple projects
simultaneously and speed up job
flows to generate business results
faster and innovate faster
Easy Access
Launch spot instances via
the RunInstances function,
run-instances cmd, or from
AWS Console. Integrated with
other AWS and 3rd party
services
Resource Flexibility
Flexibility of ad-hoc provisioning
for multiple instance types with
an option to hibernate, stop or
terminate instances when
reclaimed.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Provision Amazon EC2 Spot Instances
• Run Instances API
• Launch configuration / Auto scaling groups API’s
• EC2 Fleet and/or Spot Fleet API
• RequestSpotInstances API
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EKS architecture
Workers Workers Workers
Availability zone Availability zone Availability zone
etcd
Master Nodes
Availability zone Availability zone Availability zone
etcd
Master Nodes
etcd
Master Nodes
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EKS worker node provisioning with EC2 Spot
• Launch Amazon EC2 Spot instances as part of AutoScaling group
• Use Amazon EC2 Spot instances best practice of mixed instance types
• Recommend using the node labels to identify Amazon EC2 Spot instances
• Enables scheduling workloads selectively
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Auto scaling with Amazon EKS
• Two dimensions to scaling
• EC2 instance through K8s cluster AutoScaler
• Scale out Amazon EC2 Spot instances
• Pods through HPA
• Scale out pods
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Auto scaling with EKS – Con’t …
Amazon EC2 Autoscaling
• Min
• Max
• Instance type
• ASG group
K8s Cluster Autoscaler
• Min, max, instance type
• K8s node groups
• CA modes
• Auto-discovery
• Multi ASG
• Single ASG
• Master node
• HPA
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Auto scaling workflow
Instance
Instance
Instance
Auto Scaling Group
Worker Nodes
Cluster Autoscaler
Scale Up
Desired Capacity +1
Instance
Desired Capacity -1
Scale down
Do I still need all these resources?
Do I have enough resources?
Instance
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Handling interruptions
Instance gets terminated / maintenance / interrupted, workflow should be:
• Stop directing new-traffic to the pods on terminating instance
• Gracefully drain connections of traffic already being served
• Re-instantiate pods elsewhere in the cluster
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Interrupt handler
• Catch Amazon EC2 Spot interruption event
• Leverage K8s functionality to set node state to DRAIN
• Leverage K8s schedulers to re-instantiate pods
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What are we going to build
VPC
Availability zone Availability zone Availability zone
Auto Scaling
Auto Scaling
Auto Scaling
m4.large Spot
t2.medium Spot
On-Demand
Instances Instances Instances
Spot Instance
Spot Instance Spot Instance
Spot Instance
Spot Instance
Spot Instance
Spot Interruption
Cluster Autoscaler
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Workshop link
https://eksworkshop.com/spot
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

More Related Content

What's hot

Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...Amazon Web Services
 
Lower Costs on Amazon EMR: Auto Scaling, Spot Pricing, & Expert Strategies (A...
Lower Costs on Amazon EMR: Auto Scaling, Spot Pricing, & Expert Strategies (A...Lower Costs on Amazon EMR: Auto Scaling, Spot Pricing, & Expert Strategies (A...
Lower Costs on Amazon EMR: Auto Scaling, Spot Pricing, & Expert Strategies (A...Amazon Web Services
 
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...Amazon Web Services
 
Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...
Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...
Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...Amazon Web Services
 
Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances...
Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances...Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances...
Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances...Amazon Web Services
 
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...Amazon Web Services
 
From Monolith to Modern Apps: Best Practices (SRV322-R2) - AWS re:Invent 2018
From Monolith to Modern Apps: Best Practices (SRV322-R2) - AWS re:Invent 2018From Monolith to Modern Apps: Best Practices (SRV322-R2) - AWS re:Invent 2018
From Monolith to Modern Apps: Best Practices (SRV322-R2) - AWS re:Invent 2018Amazon Web Services
 
Scale up a Web Application (ARC409-R) - AWS re:Invent 2018
Scale up a Web Application (ARC409-R) - AWS re:Invent 2018Scale up a Web Application (ARC409-R) - AWS re:Invent 2018
Scale up a Web Application (ARC409-R) - AWS re:Invent 2018Amazon Web Services
 
Build, Deploy, and Serve Machine-Learning Models on Streaming Data Using Amaz...
Build, Deploy, and Serve Machine-Learning Models on Streaming Data Using Amaz...Build, Deploy, and Serve Machine-Learning Models on Streaming Data Using Amaz...
Build, Deploy, and Serve Machine-Learning Models on Streaming Data Using Amaz...Amazon Web Services
 
Introduction to Simulation with AWS RoboMaker (ROB304) - AWS re:Invent 2018
Introduction to Simulation with AWS RoboMaker (ROB304) - AWS re:Invent 2018Introduction to Simulation with AWS RoboMaker (ROB304) - AWS re:Invent 2018
Introduction to Simulation with AWS RoboMaker (ROB304) - AWS re:Invent 2018Amazon Web Services
 
High Performance Computing on AWS
High Performance Computing on AWSHigh Performance Computing on AWS
High Performance Computing on AWSAmazon Web Services
 
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R1) - A...
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R1) - A...[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R1) - A...
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R1) - A...Amazon Web Services
 
Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...
Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...
Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...Amazon Web Services
 
One-Click Infrastructure for Your Alexa Skill (GPSCT407) - AWS re:Invent 2018
One-Click Infrastructure for Your Alexa Skill (GPSCT407) - AWS re:Invent 2018One-Click Infrastructure for Your Alexa Skill (GPSCT407) - AWS re:Invent 2018
One-Click Infrastructure for Your Alexa Skill (GPSCT407) - AWS re:Invent 2018Amazon Web Services
 
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...Amazon Web Services
 
Achieving Business Value with AWS (ENT203-R2) - AWS re:Invent 2018
Achieving Business Value with AWS (ENT203-R2) - AWS re:Invent 2018Achieving Business Value with AWS (ENT203-R2) - AWS re:Invent 2018
Achieving Business Value with AWS (ENT203-R2) - AWS re:Invent 2018Amazon Web Services
 
Scale CI/CD & Configuration Management Pipelines with Git, Amazon EFS, & SQS ...
Scale CI/CD & Configuration Management Pipelines with Git, Amazon EFS, & SQS ...Scale CI/CD & Configuration Management Pipelines with Git, Amazon EFS, & SQS ...
Scale CI/CD & Configuration Management Pipelines with Git, Amazon EFS, & SQS ...Amazon Web Services
 
Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...
Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...
Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...Amazon Web Services
 
Optimize Your SQL Server Licenses on Amazon Web Services (DAT210) - AWS re:In...
Optimize Your SQL Server Licenses on Amazon Web Services (DAT210) - AWS re:In...Optimize Your SQL Server Licenses on Amazon Web Services (DAT210) - AWS re:In...
Optimize Your SQL Server Licenses on Amazon Web Services (DAT210) - AWS re:In...Amazon Web Services
 
Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...
Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...
Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...Amazon Web Services
 

What's hot (20)

Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
 
Lower Costs on Amazon EMR: Auto Scaling, Spot Pricing, & Expert Strategies (A...
Lower Costs on Amazon EMR: Auto Scaling, Spot Pricing, & Expert Strategies (A...Lower Costs on Amazon EMR: Auto Scaling, Spot Pricing, & Expert Strategies (A...
Lower Costs on Amazon EMR: Auto Scaling, Spot Pricing, & Expert Strategies (A...
 
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...
 
Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...
Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...
Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...
 
Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances...
Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances...Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances...
Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances...
 
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...
 
From Monolith to Modern Apps: Best Practices (SRV322-R2) - AWS re:Invent 2018
From Monolith to Modern Apps: Best Practices (SRV322-R2) - AWS re:Invent 2018From Monolith to Modern Apps: Best Practices (SRV322-R2) - AWS re:Invent 2018
From Monolith to Modern Apps: Best Practices (SRV322-R2) - AWS re:Invent 2018
 
Scale up a Web Application (ARC409-R) - AWS re:Invent 2018
Scale up a Web Application (ARC409-R) - AWS re:Invent 2018Scale up a Web Application (ARC409-R) - AWS re:Invent 2018
Scale up a Web Application (ARC409-R) - AWS re:Invent 2018
 
Build, Deploy, and Serve Machine-Learning Models on Streaming Data Using Amaz...
Build, Deploy, and Serve Machine-Learning Models on Streaming Data Using Amaz...Build, Deploy, and Serve Machine-Learning Models on Streaming Data Using Amaz...
Build, Deploy, and Serve Machine-Learning Models on Streaming Data Using Amaz...
 
Introduction to Simulation with AWS RoboMaker (ROB304) - AWS re:Invent 2018
Introduction to Simulation with AWS RoboMaker (ROB304) - AWS re:Invent 2018Introduction to Simulation with AWS RoboMaker (ROB304) - AWS re:Invent 2018
Introduction to Simulation with AWS RoboMaker (ROB304) - AWS re:Invent 2018
 
High Performance Computing on AWS
High Performance Computing on AWSHigh Performance Computing on AWS
High Performance Computing on AWS
 
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R1) - A...
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R1) - A...[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R1) - A...
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R1) - A...
 
Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...
Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...
Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...
 
One-Click Infrastructure for Your Alexa Skill (GPSCT407) - AWS re:Invent 2018
One-Click Infrastructure for Your Alexa Skill (GPSCT407) - AWS re:Invent 2018One-Click Infrastructure for Your Alexa Skill (GPSCT407) - AWS re:Invent 2018
One-Click Infrastructure for Your Alexa Skill (GPSCT407) - AWS re:Invent 2018
 
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...
 
Achieving Business Value with AWS (ENT203-R2) - AWS re:Invent 2018
Achieving Business Value with AWS (ENT203-R2) - AWS re:Invent 2018Achieving Business Value with AWS (ENT203-R2) - AWS re:Invent 2018
Achieving Business Value with AWS (ENT203-R2) - AWS re:Invent 2018
 
Scale CI/CD & Configuration Management Pipelines with Git, Amazon EFS, & SQS ...
Scale CI/CD & Configuration Management Pipelines with Git, Amazon EFS, & SQS ...Scale CI/CD & Configuration Management Pipelines with Git, Amazon EFS, & SQS ...
Scale CI/CD & Configuration Management Pipelines with Git, Amazon EFS, & SQS ...
 
Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...
Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...
Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...
 
Optimize Your SQL Server Licenses on Amazon Web Services (DAT210) - AWS re:In...
Optimize Your SQL Server Licenses on Amazon Web Services (DAT210) - AWS re:In...Optimize Your SQL Server Licenses on Amazon Web Services (DAT210) - AWS re:In...
Optimize Your SQL Server Licenses on Amazon Web Services (DAT210) - AWS re:In...
 
Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...
Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...
Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...
 

Similar to Running Amazon EKS Workloads on Amazon EC2 Spot Instances (CMP403-R1) - AWS re:Invent 2018

Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28
Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28
Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28Amazon Web Services
 
Amazon EC2 Spot with Amazon EKS (CON406-R1) - AWS re:Invent 2018
Amazon EC2 Spot with Amazon EKS (CON406-R1) - AWS re:Invent 2018Amazon EC2 Spot with Amazon EKS (CON406-R1) - AWS re:Invent 2018
Amazon EC2 Spot with Amazon EKS (CON406-R1) - AWS re:Invent 2018Amazon Web Services
 
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...Amazon Web Services
 
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)Amazon Web Services
 
Optimize Amazon EC2 for Fun and Profit
Optimize Amazon EC2 for Fun and Profit Optimize Amazon EC2 for Fun and Profit
Optimize Amazon EC2 for Fun and Profit Amazon Web Services
 
Amazon EMR: Optimize Transient Clusters for Data Processing & ETL (ANT341) - ...
Amazon EMR: Optimize Transient Clusters for Data Processing & ETL (ANT341) - ...Amazon EMR: Optimize Transient Clusters for Data Processing & ETL (ANT341) - ...
Amazon EMR: Optimize Transient Clusters for Data Processing & ETL (ANT341) - ...Amazon Web Services
 
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018Amazon Web Services
 
AWS Compute Evolved Week: Cost Optimize EC2 with Amazon EC2 Spot Instances
AWS Compute Evolved Week: Cost Optimize EC2 with Amazon EC2 Spot InstancesAWS Compute Evolved Week: Cost Optimize EC2 with Amazon EC2 Spot Instances
AWS Compute Evolved Week: Cost Optimize EC2 with Amazon EC2 Spot InstancesAmazon Web Services
 
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018Amazon Web Services
 
Optimize Amazon EC2 for Fun and Profit - SRV203 - Chicago AWS Summit
Optimize Amazon EC2 for Fun and Profit - SRV203 - Chicago AWS SummitOptimize Amazon EC2 for Fun and Profit - SRV203 - Chicago AWS Summit
Optimize Amazon EC2 for Fun and Profit - SRV203 - Chicago AWS SummitAmazon Web Services
 
Run Production Workloads on Spot, Save up to 90%
Run Production Workloads on Spot, Save up to 90%Run Production Workloads on Spot, Save up to 90%
Run Production Workloads on Spot, Save up to 90%Amazon Web Services
 
SRV203 Optimizing Amazon EC2 for Fun and Profit
 SRV203 Optimizing Amazon EC2 for Fun and Profit SRV203 Optimizing Amazon EC2 for Fun and Profit
SRV203 Optimizing Amazon EC2 for Fun and ProfitAmazon Web Services
 
Optimizing Application Performance and Costs with Auto Scaling - AWS Online T...
Optimizing Application Performance and Costs with Auto Scaling - AWS Online T...Optimizing Application Performance and Costs with Auto Scaling - AWS Online T...
Optimizing Application Performance and Costs with Auto Scaling - AWS Online T...Amazon Web Services
 
AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...
AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...
AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...Amazon Web Services Japan
 
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 ECSAmazon Web Services
 
Running Lean Architectures: How to Optimize for Cost Efficiency (ARC202-R2) -...
Running Lean Architectures: How to Optimize for Cost Efficiency (ARC202-R2) -...Running Lean Architectures: How to Optimize for Cost Efficiency (ARC202-R2) -...
Running Lean Architectures: How to Optimize for Cost Efficiency (ARC202-R2) -...Amazon Web Services
 
Design, Deploy, & Optimize SQL Server Workloads
Design, Deploy, & Optimize SQL Server Workloads Design, Deploy, & Optimize SQL Server Workloads
Design, Deploy, & Optimize SQL Server Workloads Amazon Web Services
 
Design, Deploy, & Optimize SQL Server Workloads - SRV209 - Chicago AWS Summit
Design, Deploy, & Optimize SQL Server Workloads - SRV209 - Chicago AWS SummitDesign, Deploy, & Optimize SQL Server Workloads - SRV209 - Chicago AWS Summit
Design, Deploy, & Optimize SQL Server Workloads - SRV209 - Chicago AWS SummitAmazon Web Services
 

Similar to Running Amazon EKS Workloads on Amazon EC2 Spot Instances (CMP403-R1) - AWS re:Invent 2018 (20)

Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28
Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28
Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28
 
Amazon EC2 Spot with Amazon EKS (CON406-R1) - AWS re:Invent 2018
Amazon EC2 Spot with Amazon EKS (CON406-R1) - AWS re:Invent 2018Amazon EC2 Spot with Amazon EKS (CON406-R1) - AWS re:Invent 2018
Amazon EC2 Spot with Amazon EKS (CON406-R1) - AWS re:Invent 2018
 
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
 
Amazon EC2 Spot Instances
Amazon EC2 Spot InstancesAmazon EC2 Spot Instances
Amazon EC2 Spot Instances
 
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
 
Optimize Amazon EC2 for Fun and Profit
Optimize Amazon EC2 for Fun and Profit Optimize Amazon EC2 for Fun and Profit
Optimize Amazon EC2 for Fun and Profit
 
Amazon EMR: Optimize Transient Clusters for Data Processing & ETL (ANT341) - ...
Amazon EMR: Optimize Transient Clusters for Data Processing & ETL (ANT341) - ...Amazon EMR: Optimize Transient Clusters for Data Processing & ETL (ANT341) - ...
Amazon EMR: Optimize Transient Clusters for Data Processing & ETL (ANT341) - ...
 
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
 
AWS Compute Evolved Week: Cost Optimize EC2 with Amazon EC2 Spot Instances
AWS Compute Evolved Week: Cost Optimize EC2 with Amazon EC2 Spot InstancesAWS Compute Evolved Week: Cost Optimize EC2 with Amazon EC2 Spot Instances
AWS Compute Evolved Week: Cost Optimize EC2 with Amazon EC2 Spot Instances
 
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018
 
Optimize Amazon EC2 for Fun and Profit - SRV203 - Chicago AWS Summit
Optimize Amazon EC2 for Fun and Profit - SRV203 - Chicago AWS SummitOptimize Amazon EC2 for Fun and Profit - SRV203 - Chicago AWS Summit
Optimize Amazon EC2 for Fun and Profit - SRV203 - Chicago AWS Summit
 
Run Production Workloads on Spot, Save up to 90%
Run Production Workloads on Spot, Save up to 90%Run Production Workloads on Spot, Save up to 90%
Run Production Workloads on Spot, Save up to 90%
 
SRV203 Optimizing Amazon EC2 for Fun and Profit
 SRV203 Optimizing Amazon EC2 for Fun and Profit SRV203 Optimizing Amazon EC2 for Fun and Profit
SRV203 Optimizing Amazon EC2 for Fun and Profit
 
Optimizing Application Performance and Costs with Auto Scaling - AWS Online T...
Optimizing Application Performance and Costs with Auto Scaling - AWS Online T...Optimizing Application Performance and Costs with Auto Scaling - AWS Online T...
Optimizing Application Performance and Costs with Auto Scaling - AWS Online T...
 
AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...
AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...
AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...
 
Amazon EC2 Spot Instances Workshop
Amazon EC2 Spot Instances WorkshopAmazon EC2 Spot Instances Workshop
Amazon EC2 Spot Instances Workshop
 
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
 
Running Lean Architectures: How to Optimize for Cost Efficiency (ARC202-R2) -...
Running Lean Architectures: How to Optimize for Cost Efficiency (ARC202-R2) -...Running Lean Architectures: How to Optimize for Cost Efficiency (ARC202-R2) -...
Running Lean Architectures: How to Optimize for Cost Efficiency (ARC202-R2) -...
 
Design, Deploy, & Optimize SQL Server Workloads
Design, Deploy, & Optimize SQL Server Workloads Design, Deploy, & Optimize SQL Server Workloads
Design, Deploy, & Optimize SQL Server Workloads
 
Design, Deploy, & Optimize SQL Server Workloads - SRV209 - Chicago AWS Summit
Design, Deploy, & Optimize SQL Server Workloads - SRV209 - Chicago AWS SummitDesign, Deploy, & Optimize SQL Server Workloads - SRV209 - Chicago AWS Summit
Design, Deploy, & Optimize SQL Server Workloads - SRV209 - Chicago AWS Summit
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Running Amazon EKS Workloads on Amazon EC2 Spot Instances (CMP403-R1) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Running Amazon EKS Workloads on Amazon EC2 Spot Instances Madhuri Peri Sr. IoT Solutions Architect Amazon Web Services C M P 4 0 3 Shawn O’Connor Solutions Architect Amazon Web Services
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda Overview of Amazon EC2 Spot Overview of Amazon EKS Provisioning Amazon EC2 Spot in Amazon EKS Scaling with Amazon EC2 Spot in Amazon EKS Handling Interruptions Workshop Overview Workshop Cleanup
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EC2 Purchasing Options On-Demand Pay for compute capacity by the second with no long-term commitments Spiky workloads, to define needs Reserved Instances Make a 1- or 3-Year commitment and receive a significant discount off On- Demand prices Committed, steady-state usage Spot Instances Spare Amazon EC2 capacity at savings of up to 90% off On-Demand prices Fault-tolerant, flexible, stateless workloads
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why Spot Instances? Inexpensive Significant price savings of up to 90% over On-Demand Instances. Perfect for stateless and fault- tolerant workloads Faster Results Easily run multiple projects simultaneously and speed up job flows to generate business results faster and innovate faster Easy Access Launch spot instances via the RunInstances function, run-instances cmd, or from AWS Console. Integrated with other AWS and 3rd party services Resource Flexibility Flexibility of ad-hoc provisioning for multiple instance types with an option to hibernate, stop or terminate instances when reclaimed.
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Provision Amazon EC2 Spot Instances • Run Instances API • Launch configuration / Auto scaling groups API’s • EC2 Fleet and/or Spot Fleet API • RequestSpotInstances API
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EKS architecture Workers Workers Workers Availability zone Availability zone Availability zone etcd Master Nodes Availability zone Availability zone Availability zone etcd Master Nodes etcd Master Nodes
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EKS worker node provisioning with EC2 Spot • Launch Amazon EC2 Spot instances as part of AutoScaling group • Use Amazon EC2 Spot instances best practice of mixed instance types • Recommend using the node labels to identify Amazon EC2 Spot instances • Enables scheduling workloads selectively
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto scaling with Amazon EKS • Two dimensions to scaling • EC2 instance through K8s cluster AutoScaler • Scale out Amazon EC2 Spot instances • Pods through HPA • Scale out pods
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto scaling with EKS – Con’t … Amazon EC2 Autoscaling • Min • Max • Instance type • ASG group K8s Cluster Autoscaler • Min, max, instance type • K8s node groups • CA modes • Auto-discovery • Multi ASG • Single ASG • Master node • HPA
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto scaling workflow Instance Instance Instance Auto Scaling Group Worker Nodes Cluster Autoscaler Scale Up Desired Capacity +1 Instance Desired Capacity -1 Scale down Do I still need all these resources? Do I have enough resources? Instance
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Handling interruptions Instance gets terminated / maintenance / interrupted, workflow should be: • Stop directing new-traffic to the pods on terminating instance • Gracefully drain connections of traffic already being served • Re-instantiate pods elsewhere in the cluster
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Interrupt handler • Catch Amazon EC2 Spot interruption event • Leverage K8s functionality to set node state to DRAIN • Leverage K8s schedulers to re-instantiate pods
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What are we going to build VPC Availability zone Availability zone Availability zone Auto Scaling Auto Scaling Auto Scaling m4.large Spot t2.medium Spot On-Demand Instances Instances Instances Spot Instance Spot Instance Spot Instance Spot Instance Spot Instance Spot Instance Spot Interruption Cluster Autoscaler
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Workshop link https://eksworkshop.com/spot
  • 21. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.