SlideShare a Scribd company logo
Efficient Kubernetes scaling using Karpenter
EFFICIENT
KUBERNETES SCALING
USING KARPENTER_
Marko Bevc
Efficient Kubernetes scaling using Karpenter
ABOUT
ME_ ●
Head of Consultancy at The Scale Factory (B2B SaaS consultancy,
AWS Advanced consulting partner and K8s service provider)
●
Ops background, wearing different hats, engaged with many
different technologies
●
Open source contributor, maintainer and supporter
●
HashiCorp Ambassador, OpenUK Ambassador
●
Certifications and competencies: AWS, CKA, RHEL, HCTA
●
Fan of automation/simplifying things, hiking and travelling
@_MarkoB
https://www.linkedin.com/in/marko-bevc/
| @marko@hachyderm.io
KUBERNETES
SCALING_
• None out of the box – manual 👩‍💻👨‍💻
• Kubernetes resources:
–Pods – the smallest execution unit
–Nodes – compute/instances to run Pods on
–Other: storage, network, etc.
@_MarkoB
HPA
CONCEPT_
• Horizontal Pod Autoscaler
• Adding more instances(e.g. Pods)
• Doesn’t apply to non-scalable objects (e.g. DaemonSet)
• Target observed metrics (i.e. average CPU or memory
utilization)
• Scaling out
VPA
CONCEPT_
• Vertical Pod Autoscaler
• Adjusting size/power (e.g. resources/limits)
• “Right-sizing” your workloads to actual usage
• Most commonly used on a Deployment objects
• Scaling up
PODS
SCALING_
• Other approaches:
– HPA | VPA* (HorizontalPodAutoscaler | VerticalPodAutoscaler)
– GCP: MultidimPodAutoscaler
– KEDA (K8s Event Driven Autoscaling)
– Knative (K8s based serverless platform)
CLUSTER
AUTOSCALER_
• Industry ‘de-facto’ auto-scaling standard
• Cost efficiency – automatically adjusts cluster: scale up/down
• Leaning on existing Cloud building blocks
• Challenges: Node Group limitations (AZ, instance type, labels),
complex to use, tightly bound to the scheduler, global controller
CLUSTER
AUTOSCALER
SCALE-UP_
●
Reconciliation and filtering
●
Scale up (in-memory simulation, <10sec)
●
Expanders: random, most/least pods, price, priority
●
Scale down (<10min)
New Nodes
Pending Pods
10 sec
NODE
SCHEDULING_
@_MarkoB
Kubernetes
Control Plane
unscheduled
@_MarkoB
NODE
SCHEDULING_
Kubernetes
Control Plane
unscheduled
@_MarkoB
NODE CA
SCHEDULING_
Kubernetes
Control Plane
size, arch, GPU, etc.
@_MarkoB
NODE KARPENTER
SCHEDULING_
Kubernetes
Control Plane
KARPENTER
ARCHITECTURE_
@_MarkoB
https://karpenter.sh
KEY
CONCEPTS_
• Straightforward setup:
– Provision AWS IAM Roles for Service Accounts (IRSA)
– Install controllers (leader elect HA)
– Apply Provisioner CRD (configuration) – one or more!
– Deploy workloads
• Capacity life-cycle loop: watch evaluate provision remove
→ → →
• Well-known labels as Provisioner constraints:
– kubernetes.io/arch = amd64
– kubernetes.io/os = linux
– node.kubernetes.io/instance-type = m5.large
– topology.kubernetes.io/zone = eu-west-1
– karpenter.sh/capacity-type = on-demand | spot
●
Multi-dimension scaling (up/down and in/out)!
@_MarkoB
SCALING
UP_
• Provisioning and scaling
• Adding more just-in-time capacity to meet demand
• Early binding to nodes
• Scheduling constraints: resource.requests, nodeAffinity, nodeSelector,
PodDisruptionBudget, topologySpreadConstraints, inter-pod (anti-)affinity
• Removing scheduler tight coupling
@_MarkoB
New Node
Pending Pods
<10 sec
SCALING
IN_
@_MarkoB
<10 sec
Obsolete Node
Pending Pods
• Terminate obsolete capacity reducing costs
→
• Removing underutilised or empty nodes
• Node TTLs (emptiness & expiration)
• Consolidation
• Interruption
• Drift
CAPACITY
CONSOLIDATION_
●
Consolidation, a.k.a off-line bin packing
●
Rebalancing Node workloads based on utilisation (CPU, memory)
●
Mechanisms for cluster consolidation:
– Delete (on-demand | spot)
– Replace (on-demand)
●
Optimises for cost, minimising disruption obeying:
– Scheduling constraints (PDBs, AZ affinity, topology spread constraints)
– Termination grace period and expiration TTL
– Instance unhealthy events and spot events (termination)
●
Using least disruption when multiple Nodes that could be consolidated:
– Nodes running fewer pods
– Nodes that will expire soon
– Nodes with lower priority Pods
@_MarkoB
OTHER
OPTIONS_
●
Custom User Data and AMI (i.e. Bottlerocket)
●
Kubelet configuration (containerRuntime, systemReserved)
●
Taints (or startupTaints)
●
Control Pod Density
– Network limitations
●
Number of ENIs
●
Number of IP addresses that can be assigned to ENI
– Static Pod Density (podsPerCore)
– Dynamic Pod Density (maxPods)
– Limit Pod Density: topology spread, restrict instance types
@_MarkoB
TIME FOR
A DEMO!_
@_MarkoB
CONCLUSIONS_
& TAKEAWAYS
●
Capacity planning is hard! 🧪
●
Key advantages: 🔥
– Flexible, lowers complexity & portable
– Fast: provisioning latency <1min down to 15sec (group-less)
→
– Efficient: multi-dimension scaling, consolidation (delete or replace)
– Adaptive: right-sizing, interruption events
– Compliance (TTL)📖
●
To keep in mind: 🧑‍🏫
– Currently supported provider is AWS (adoption in the future?*)
– Not supporting Spot Rebalance Recommendations
– Careful with non-interruptable workloads, edge case of 1 replica
– https://github.com/aws/karpenter/issues ➡️ ⚒️
@_MarkoB
●
Resources:
– https://github.com/mbevc1/public-speaking/
– https://github.com/aws/karpenter/
– https://kubernetes.io/docs/reference/labels-annotations-taints/
– https://github.com/kubernetes/autoscaler
– https://docs.aws.amazon.com/eks/latest/userguide/cluster-autoscaler.html
– https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/proposals/
scalability_tests.md
– https://blog.kloia.com/karpenter-cluster-autoscaler-76d7f7ec0d0e
– https://blog.scaleway.com/understanding-kubernetes-autoscaling/
– https://aws.amazon.com/blogs/aws/introducing-karpenter-an-open-source-high-performance-
kubernetes-cluster-autoscaler/
FURTHER
READING_
@_MarkoB
KEEP IN
TOUCH_
https://www.scalefactory.com/
@_MarkoB
@mbevc1
@mbevc1
https://www.linkedin.com/in/marko-bevc/
https://www.scalefactory.com/
Web:
Twitter:
GitHub:
GitLab:
LinkedIn:

More Related Content

What's hot (20)

PPTX
KEDA Overview
Jeff Hollan
 
PDF
An intro to Kubernetes operators
J On The Beach
 
PPTX
Kubernetes Basics
Rishabh Kumar
 
PDF
Kubernetes
Meng-Ze Lee
 
PDF
Kubernetes Introduction
Peng Xiao
 
PDF
Kubernetes
erialc_w
 
PDF
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
SlideTeam
 
PDF
Kubernetes a comprehensive overview
Gabriel Carro
 
PPTX
Autoscaling in Kubernetes
Hrishikesh Deodhar
 
PPTX
Kubernetes Introduction
Martin Danielsson
 
PDF
Introduction to kubernetes
Gabriel Carro
 
PDF
MSA 전략 2: 마이크로서비스, 어떻게 구현할 것인가?
VMware Tanzu Korea
 
PDF
High Availability PostgreSQL with Zalando Patroni
Zalando Technology
 
PDF
Kubernetes Application Deployment with Helm - A beginner Guide!
Krishna-Kumar
 
PDF
Google Kubernetes Engine (GKE) deep dive
Akash Agrawal
 
PPTX
Kubernetes PPT.pptx
ssuser0cc9131
 
PDF
Kubernetes architecture
Janakiram MSV
 
PDF
Kubernetes Networking
CJ Cullen
 
PDF
Docker & kubernetes
NexThoughts Technologies
 
PDF
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Thomas Graf
 
KEDA Overview
Jeff Hollan
 
An intro to Kubernetes operators
J On The Beach
 
Kubernetes Basics
Rishabh Kumar
 
Kubernetes
Meng-Ze Lee
 
Kubernetes Introduction
Peng Xiao
 
Kubernetes
erialc_w
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
SlideTeam
 
Kubernetes a comprehensive overview
Gabriel Carro
 
Autoscaling in Kubernetes
Hrishikesh Deodhar
 
Kubernetes Introduction
Martin Danielsson
 
Introduction to kubernetes
Gabriel Carro
 
MSA 전략 2: 마이크로서비스, 어떻게 구현할 것인가?
VMware Tanzu Korea
 
High Availability PostgreSQL with Zalando Patroni
Zalando Technology
 
Kubernetes Application Deployment with Helm - A beginner Guide!
Krishna-Kumar
 
Google Kubernetes Engine (GKE) deep dive
Akash Agrawal
 
Kubernetes PPT.pptx
ssuser0cc9131
 
Kubernetes architecture
Janakiram MSV
 
Kubernetes Networking
CJ Cullen
 
Docker & kubernetes
NexThoughts Technologies
 
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Thomas Graf
 

Similar to Efficient Kubernetes scaling using Karpenter (20)

PPTX
Qubole @ AWS Meetup Bangalore - July 2015
Joydeep Sen Sarma
 
PDF
Seamless scaling of Kubernetes nodes
Marko Bevc
 
PDF
Big Data Day LA 2016/ Big Data Track - How To Use Impala and Kudu To Optimize...
Data Con LA
 
PDF
Lc3 beijing-june262018-sahdev zala-guangya
Sahdev Zala
 
PPTX
H-Hypermap Heatmap Analytics at Scale
David Smiley
 
PDF
Cluster schedulers
Anton Zadorozhniy
 
PDF
Hadoop and Spark
Shravan (Sean) Pabba
 
PPTX
Introducing Apache Kudu (Incubating) - Montreal HUG May 2016
Mladen Kovacevic
 
PDF
Running Kafka on Kubernetes, across three clouds at Adobe
DoKC
 
PDF
FOSS4G In The Cloud: Using Open Source to build Cloud based Spatial Infrastru...
Mohamed Sayed
 
PDF
H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...
Lucidworks
 
PDF
Facebook Presto presentation
Cyanny LIANG
 
PDF
MySQL in the Hosted Cloud
Colin Charles
 
PDF
Ippevent : openshift Introduction
kanedafromparis
 
PDF
Ceph for Big Science - Dan van der Ster
Ceph Community
 
PDF
Google Kubernetes Engine Deep Dive Meetup
Iftach Schonbaum
 
PDF
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
Radhika Puthiyetath
 
PPTX
Ceph Day New York 2014: Best Practices for Ceph-Powered Implementations of St...
Ceph Community
 
Qubole @ AWS Meetup Bangalore - July 2015
Joydeep Sen Sarma
 
Seamless scaling of Kubernetes nodes
Marko Bevc
 
Big Data Day LA 2016/ Big Data Track - How To Use Impala and Kudu To Optimize...
Data Con LA
 
Lc3 beijing-june262018-sahdev zala-guangya
Sahdev Zala
 
H-Hypermap Heatmap Analytics at Scale
David Smiley
 
Cluster schedulers
Anton Zadorozhniy
 
Hadoop and Spark
Shravan (Sean) Pabba
 
Introducing Apache Kudu (Incubating) - Montreal HUG May 2016
Mladen Kovacevic
 
Running Kafka on Kubernetes, across three clouds at Adobe
DoKC
 
FOSS4G In The Cloud: Using Open Source to build Cloud based Spatial Infrastru...
Mohamed Sayed
 
H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...
Lucidworks
 
Facebook Presto presentation
Cyanny LIANG
 
MySQL in the Hosted Cloud
Colin Charles
 
Ippevent : openshift Introduction
kanedafromparis
 
Ceph for Big Science - Dan van der Ster
Ceph Community
 
Google Kubernetes Engine Deep Dive Meetup
Iftach Schonbaum
 
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
Radhika Puthiyetath
 
Ceph Day New York 2014: Best Practices for Ceph-Powered Implementations of St...
Ceph Community
 
Ad

More from Marko Bevc (8)

PDF
Using HCP Waypoint
Marko Bevc
 
PDF
How secure are your Terraform sensitive values?
Marko Bevc
 
PDF
Who is afraid of privileged containers ?
Marko Bevc
 
PDF
Terraform 0.13: Rise of the modules
Marko Bevc
 
PDF
Who is afraid of privileged containers ?
Marko Bevc
 
PDF
Terraform 0.13: Rise of the modules
Marko Bevc
 
PDF
Who is afraid of privileged containers ?
Marko Bevc
 
PDF
Commodified IaC using Terraform Cloud
Marko Bevc
 
Using HCP Waypoint
Marko Bevc
 
How secure are your Terraform sensitive values?
Marko Bevc
 
Who is afraid of privileged containers ?
Marko Bevc
 
Terraform 0.13: Rise of the modules
Marko Bevc
 
Who is afraid of privileged containers ?
Marko Bevc
 
Terraform 0.13: Rise of the modules
Marko Bevc
 
Who is afraid of privileged containers ?
Marko Bevc
 
Commodified IaC using Terraform Cloud
Marko Bevc
 
Ad

Recently uploaded (20)

PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
July Patch Tuesday
Ivanti
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
July Patch Tuesday
Ivanti
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 

Efficient Kubernetes scaling using Karpenter