SlideShare uma empresa Scribd logo
1 de 24
Baixar para ler offline
EFFICIENT
KUBERNETES SCALING
USING KARPENTER_
Marko Bevc
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:

Mais conteúdo relacionado

Mais procurados

[넥슨] kubernetes 소개 (2018)
[넥슨] kubernetes 소개 (2018)[넥슨] kubernetes 소개 (2018)
[넥슨] kubernetes 소개 (2018)용호 최
 
Kubernetes 101 for Beginners
Kubernetes 101 for BeginnersKubernetes 101 for Beginners
Kubernetes 101 for BeginnersOktay Esgul
 
Deep dive into Kubernetes Networking
Deep dive into Kubernetes NetworkingDeep dive into Kubernetes Networking
Deep dive into Kubernetes NetworkingSreenivas Makam
 
Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Weaveworks
 
Rancher Rodeo
Rancher RodeoRancher Rodeo
Rancher RodeoSUSE
 
Autoscaling Kubernetes
Autoscaling KubernetesAutoscaling Kubernetes
Autoscaling Kubernetescraigbox
 
Docker & Kubernetes 기초 - 최용호
Docker & Kubernetes 기초 - 최용호Docker & Kubernetes 기초 - 최용호
Docker & Kubernetes 기초 - 최용호용호 최
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes IntroductionEric Gustafson
 
The Case for Chaos
The Case for ChaosThe Case for Chaos
The Case for ChaosBruce Wong
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetesGabriel Carro
 
Traffic Control with Envoy Proxy
Traffic Control with Envoy ProxyTraffic Control with Envoy Proxy
Traffic Control with Envoy ProxyMark McBride
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 introTerry Cho
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Ryan Jarvinen
 
Kubernetes Architecture
 Kubernetes Architecture Kubernetes Architecture
Kubernetes ArchitectureKnoldus Inc.
 

Mais procurados (20)

[넥슨] kubernetes 소개 (2018)
[넥슨] kubernetes 소개 (2018)[넥슨] kubernetes 소개 (2018)
[넥슨] kubernetes 소개 (2018)
 
Kubernetes 101 for Beginners
Kubernetes 101 for BeginnersKubernetes 101 for Beginners
Kubernetes 101 for Beginners
 
Deep dive into Kubernetes Networking
Deep dive into Kubernetes NetworkingDeep dive into Kubernetes Networking
Deep dive into Kubernetes Networking
 
Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)
 
Autoscaling in Kubernetes
Autoscaling in KubernetesAutoscaling in Kubernetes
Autoscaling in Kubernetes
 
Rancher Rodeo
Rancher RodeoRancher Rodeo
Rancher Rodeo
 
Autoscaling Kubernetes
Autoscaling KubernetesAutoscaling Kubernetes
Autoscaling Kubernetes
 
Docker & Kubernetes 기초 - 최용호
Docker & Kubernetes 기초 - 최용호Docker & Kubernetes 기초 - 최용호
Docker & Kubernetes 기초 - 최용호
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
The Case for Chaos
The Case for ChaosThe Case for Chaos
The Case for Chaos
 
DevOps with Kubernetes
DevOps with KubernetesDevOps with Kubernetes
DevOps with Kubernetes
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Traffic Control with Envoy Proxy
Traffic Control with Envoy ProxyTraffic Control with Envoy Proxy
Traffic Control with Envoy Proxy
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Kubernetes Architecture
 Kubernetes Architecture Kubernetes Architecture
Kubernetes Architecture
 
Kubernetes PPT.pptx
Kubernetes PPT.pptxKubernetes PPT.pptx
Kubernetes PPT.pptx
 
Kubernetes
KubernetesKubernetes
Kubernetes
 

Semelhante a Efficient Kubernetes scaling using Karpenter

Qubole @ AWS Meetup Bangalore - July 2015
Qubole @ AWS Meetup Bangalore - July 2015Qubole @ AWS Meetup Bangalore - July 2015
Qubole @ AWS Meetup Bangalore - July 2015Joydeep Sen Sarma
 
Seamless scaling of Kubernetes nodes
Seamless scaling of Kubernetes nodesSeamless scaling of Kubernetes nodes
Seamless scaling of Kubernetes nodesMarko Bevc
 
Big Data Day LA 2016/ Big Data Track - How To Use Impala and Kudu To Optimize...
Big Data Day LA 2016/ Big Data Track - How To Use Impala and Kudu To Optimize...Big Data Day LA 2016/ Big Data Track - How To Use Impala and Kudu To Optimize...
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
Lc3 beijing-june262018-sahdev zala-guangyaLc3 beijing-june262018-sahdev zala-guangya
Lc3 beijing-june262018-sahdev zala-guangyaSahdev Zala
 
H-Hypermap Heatmap Analytics at Scale
H-Hypermap Heatmap Analytics at ScaleH-Hypermap Heatmap Analytics at Scale
H-Hypermap Heatmap Analytics at ScaleDavid Smiley
 
Introducing Apache Kudu (Incubating) - Montreal HUG May 2016
Introducing Apache Kudu (Incubating) - Montreal HUG May 2016Introducing Apache Kudu (Incubating) - Montreal HUG May 2016
Introducing Apache Kudu (Incubating) - Montreal HUG May 2016Mladen Kovacevic
 
Running Kafka on Kubernetes, across three clouds at Adobe
Running Kafka on Kubernetes, across three clouds at AdobeRunning Kafka on Kubernetes, across three clouds at Adobe
Running Kafka on Kubernetes, across three clouds at AdobeDoKC
 
FOSS4G In The Cloud: Using Open Source to build Cloud based Spatial Infrastru...
FOSS4G In The Cloud: Using Open Source to build Cloud based Spatial Infrastru...FOSS4G In The Cloud: Using Open Source to build Cloud based Spatial Infrastru...
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...
H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...
H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...Lucidworks
 
Facebook Presto presentation
Facebook Presto presentationFacebook Presto presentation
Facebook Presto presentationCyanny LIANG
 
MySQL in the Hosted Cloud
MySQL in the Hosted CloudMySQL in the Hosted Cloud
MySQL in the Hosted CloudColin Charles
 
Ippevent : openshift Introduction
Ippevent : openshift IntroductionIppevent : openshift Introduction
Ippevent : openshift Introductionkanedafromparis
 
Ceph for Big Science - Dan van der Ster
Ceph for Big Science - Dan van der SterCeph for Big Science - Dan van der Ster
Ceph for Big Science - Dan van der SterCeph Community
 
Google Kubernetes Engine Deep Dive Meetup
Google Kubernetes Engine Deep Dive MeetupGoogle Kubernetes Engine Deep Dive Meetup
Google Kubernetes Engine Deep Dive MeetupIftach Schonbaum
 
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
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 Day New York 2014: Best Practices for Ceph-Powered Implementations of St...Ceph Day New York 2014: Best Practices for Ceph-Powered Implementations of St...
Ceph Day New York 2014: Best Practices for Ceph-Powered Implementations of St...Ceph Community
 

Semelhante a Efficient Kubernetes scaling using Karpenter (20)

Qubole @ AWS Meetup Bangalore - July 2015
Qubole @ AWS Meetup Bangalore - July 2015Qubole @ AWS Meetup Bangalore - July 2015
Qubole @ AWS Meetup Bangalore - July 2015
 
Seamless scaling of Kubernetes nodes
Seamless scaling of Kubernetes nodesSeamless scaling of Kubernetes nodes
Seamless scaling of Kubernetes nodes
 
Big Data Day LA 2016/ Big Data Track - How To Use Impala and Kudu To Optimize...
Big Data Day LA 2016/ Big Data Track - How To Use Impala and Kudu To Optimize...Big Data Day LA 2016/ Big Data Track - How To Use Impala and Kudu To Optimize...
Big Data Day LA 2016/ Big Data Track - How To Use Impala and Kudu To Optimize...
 
Lc3 beijing-june262018-sahdev zala-guangya
Lc3 beijing-june262018-sahdev zala-guangyaLc3 beijing-june262018-sahdev zala-guangya
Lc3 beijing-june262018-sahdev zala-guangya
 
H-Hypermap Heatmap Analytics at Scale
H-Hypermap Heatmap Analytics at ScaleH-Hypermap Heatmap Analytics at Scale
H-Hypermap Heatmap Analytics at Scale
 
Cluster schedulers
Cluster schedulersCluster schedulers
Cluster schedulers
 
Hadoop and Spark
Hadoop and SparkHadoop and Spark
Hadoop and Spark
 
Introducing Apache Kudu (Incubating) - Montreal HUG May 2016
Introducing Apache Kudu (Incubating) - Montreal HUG May 2016Introducing Apache Kudu (Incubating) - Montreal HUG May 2016
Introducing Apache Kudu (Incubating) - Montreal HUG May 2016
 
Running Kafka on Kubernetes, across three clouds at Adobe
Running Kafka on Kubernetes, across three clouds at AdobeRunning Kafka on Kubernetes, across three clouds at Adobe
Running Kafka on Kubernetes, across three clouds at Adobe
 
FOSS4G In The Cloud: Using Open Source to build Cloud based Spatial Infrastru...
FOSS4G In The Cloud: Using Open Source to build Cloud based Spatial Infrastru...FOSS4G In The Cloud: Using Open Source to build Cloud based Spatial Infrastru...
FOSS4G In The Cloud: Using Open Source to build Cloud based Spatial Infrastru...
 
H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...
H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...
H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...
 
Facebook Presto presentation
Facebook Presto presentationFacebook Presto presentation
Facebook Presto presentation
 
HPC in the Cloud
HPC in the CloudHPC in the Cloud
HPC in the Cloud
 
MySQL in the Hosted Cloud
MySQL in the Hosted CloudMySQL in the Hosted Cloud
MySQL in the Hosted Cloud
 
Ippevent : openshift Introduction
Ippevent : openshift IntroductionIppevent : openshift Introduction
Ippevent : openshift Introduction
 
Ceph for Big Science - Dan van der Ster
Ceph for Big Science - Dan van der SterCeph for Big Science - Dan van der Ster
Ceph for Big Science - Dan van der Ster
 
Google Kubernetes Engine Deep Dive Meetup
Google Kubernetes Engine Deep Dive MeetupGoogle Kubernetes Engine Deep Dive Meetup
Google Kubernetes Engine Deep Dive Meetup
 
Kudu demo
Kudu demoKudu demo
Kudu demo
 
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
 
Ceph Day New York 2014: Best Practices for Ceph-Powered Implementations of St...
Ceph Day New York 2014: Best Practices for Ceph-Powered Implementations of St...Ceph Day New York 2014: Best Practices for Ceph-Powered Implementations of St...
Ceph Day New York 2014: Best Practices for Ceph-Powered Implementations of St...
 

Mais de Marko Bevc

Using HCP Waypoint
Using HCP WaypointUsing HCP Waypoint
Using HCP WaypointMarko Bevc
 
How secure are your Terraform sensitive values?
How secure are your Terraform sensitive values?How secure are your Terraform sensitive values?
How secure are your Terraform sensitive values?Marko Bevc
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Marko Bevc
 
Terraform 0.13: Rise of the modules
Terraform 0.13: Rise of the modulesTerraform 0.13: Rise of the modules
Terraform 0.13: Rise of the modulesMarko Bevc
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Marko Bevc
 
Terraform 0.13: Rise of the modules
Terraform 0.13: Rise of the modulesTerraform 0.13: Rise of the modules
Terraform 0.13: Rise of the modulesMarko Bevc
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Marko Bevc
 
Commodified IaC using Terraform Cloud
Commodified IaC using Terraform CloudCommodified IaC using Terraform Cloud
Commodified IaC using Terraform CloudMarko Bevc
 

Mais de Marko Bevc (8)

Using HCP Waypoint
Using HCP WaypointUsing HCP Waypoint
Using HCP Waypoint
 
How secure are your Terraform sensitive values?
How secure are your Terraform sensitive values?How secure are your Terraform sensitive values?
How secure are your Terraform sensitive values?
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?
 
Terraform 0.13: Rise of the modules
Terraform 0.13: Rise of the modulesTerraform 0.13: Rise of the modules
Terraform 0.13: Rise of the modules
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?
 
Terraform 0.13: Rise of the modules
Terraform 0.13: Rise of the modulesTerraform 0.13: Rise of the modules
Terraform 0.13: Rise of the modules
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?
 
Commodified IaC using Terraform Cloud
Commodified IaC using Terraform CloudCommodified IaC using Terraform Cloud
Commodified IaC using Terraform Cloud
 

Último

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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 organizationRadu Cotescu
 
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 AutomationSafe Software
 
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 WorkerThousandEyes
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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 Processorsdebabhi2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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 WorkerThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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.pptxHampshireHUG
 

Último (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
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
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 

Efficient Kubernetes scaling using Karpenter

  • 1.
  • 3.
  • 4. 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
  • 5. 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
  • 6. 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
  • 7. 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
  • 8. PODS SCALING_ • Other approaches: – HPA | VPA* (HorizontalPodAutoscaler | VerticalPodAutoscaler) – GCP: MultidimPodAutoscaler – KEDA (K8s Event Driven Autoscaling) – Knative (K8s based serverless platform)
  • 9. 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
  • 10. 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
  • 14. size, arch, GPU, etc. @_MarkoB NODE KARPENTER SCHEDULING_ Kubernetes Control Plane
  • 16. 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
  • 17. 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
  • 18. 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
  • 19. 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
  • 20. 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
  • 22. 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
  • 23. ● 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