SlideShare a Scribd company logo
K8s Resource Allocation
Victor Morales
Agenda
• Lifecycle of a Pod
• Request and Limits
• Quality of Service Classes
• Best Effort
• Burstable
• Guaranteed
• Demo – Virtlet VM with Burstable QoS class
• Demo – Virtlet VM with Guaranteed QoS class
• CPU Management Policies
Lifecycle of a Pod
Requests are important at schedule time, and limits are important at run time.
Requests and Limits
• Request is a critical input to
the scheduler.
• Limit is important to Kubelet
(the daemon on each node that is
responsible for pod health). Exceeding
a memory limit makes your
container process a candidate
for oom-killing. But
Kubernetes does not
terminate pods for exceeding
CPU limits.
Quality of Service Classes
Pods that need to stay up and consistently good can request guaranteed
resources, while pods with less exacting requirements can use
resources with less/no guarantee.
Best Effort
Pods are dangerous because Kubernetes has no idea where to put
them and when to kill so it’s forced to guess.
https://medium.com/better-programming/the-kubernetes-quality-of-service-conundrum-eebbbb5f89cf
Burstable
• Pods are good for cost optimization.
• Reduces the possibility of node CPU starvation.
• If one pod expands out (noisy neighbor) at one time is OK.
Guarantee
• Pods are considered top-priority
and are not be killed until they
exceed their limits.
• They remove the possibility of
scaling out into more CPU, but it
reserves the exact amount that
your containers are going to
need.
Demo
https://github.com/electrocucaracha/k8s-SuspendResume-demo
Demo – Virtlet VM with Burstable QoS class
Demo – Virtlet VM with Burstable QoS class
Create Virtlet VM
Create Linux Pod
Destroy Linux Pod
Suspend Virtlet VM
Create Linux Pod
Demo – Virtlet VM with Guaranteed QoS class
Demo – Virtlet VM with Guaranteed QoS class
Create Virtlet VM
Create Linux Pod
Destroy Virtlet VM
Resources
Requests and Limits
• https://www.noqcks.io/notes/2018/02/03/understanding-kubernetes-resources/
• https://mcrthr.com/kubernetes-cpu-limits
• https://medium.com/@betz.mark/understanding-resource-limits-in-kubernetes-memory-
6b41e9a955f9
• https://medium.com/@betz.mark/understanding-resource-limits-in-kubernetes-cpu-time-
9eff74d3161b
Quality of Service
• https://medium.com/better-programming/the-kubernetes-quality-of-service-conundrum-
eebbbb5f89cf
• https://www.weave.works/blog/kubernetes-pod-resource-limitations-and-quality-of-service
• https://medium.com/google-cloud/quality-of-service-class-qos-in-kubernetes-bb76a89eb2c6
• https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/
Backup
CPU Management Policies & CriticalPodAdmissionHandler
CPU Management Policies
Enables better placement of sensitive workloads in the Kubelet by
allocating exclusive CPUs to certain pod containers.
• none: Provides no affinity beyond what the OS scheduler does
automatically (CFS quota). Default
• static: Allocates exclusive CPUs to pod containers in the Guaranteed
QoS class with integer CPUs requests.
https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/
https://kubernetes.io/blog/2018/07/24/feature-highlight-cpu-manager/
CriticalPodAdmissionHandler
IsCriticalPod returns true if the pod bears the critical pod annotation key or if pod's priority
is greater than or equal to SystemCriticalPriority. Both the default scheduler and the
kubelet use this function to make admission and scheduling decisions.
CriticalPodAdmissionHandler is an AdmissionFailureHandler that handles admission failure
for Critical Pods. If the ONLY admission failures are due to insufficient resources, then
CriticalPodAdmissionHandler evicts pods so that the critical pod can be admitted. For
evictions, the CriticalPodAdmissionHandler evicts a set of pods that frees up the required
resource requests. The set of pods is designed to minimize impact, and is prioritized
according to the ordering:
minimal impact for guaranteed pods > minimal impact for burstable pods > minimal impact
for besteffort pods.
minimal impact is defined as follows: fewest pods evicted > fewest total requests of pods.
finding the fewest total requests of pods is considered besteffort.

More Related Content

What's hot

Autoscaled Distributed Automation using AWS at Selenium London MeetUp
Autoscaled Distributed Automation using AWS at Selenium London MeetUpAutoscaled Distributed Automation using AWS at Selenium London MeetUp
Autoscaled Distributed Automation using AWS at Selenium London MeetUp
aragavan
 
Developing the Stratoscale System at Scale - Muli Ben-Yehuda, Stratoscale - D...
Developing the Stratoscale System at Scale - Muli Ben-Yehuda, Stratoscale - D...Developing the Stratoscale System at Scale - Muli Ben-Yehuda, Stratoscale - D...
Developing the Stratoscale System at Scale - Muli Ben-Yehuda, Stratoscale - D...
DevOpsDays Tel Aviv
 
Migrating Enterprise Microservices From Cloud Foundry to Kubernetes
Migrating Enterprise Microservices From Cloud Foundry to KubernetesMigrating Enterprise Microservices From Cloud Foundry to Kubernetes
Migrating Enterprise Microservices From Cloud Foundry to Kubernetes
Tony Erwin
 
Muli Ben-Yehuda, Stratoscale - The Road to a Hyper-Converged OpenStack, OpenS...
Muli Ben-Yehuda, Stratoscale - The Road to a Hyper-Converged OpenStack, OpenS...Muli Ben-Yehuda, Stratoscale - The Road to a Hyper-Converged OpenStack, OpenS...
Muli Ben-Yehuda, Stratoscale - The Road to a Hyper-Converged OpenStack, OpenS...
Cloud Native Day Tel Aviv
 
Cdn gslb-20151209
Cdn gslb-20151209Cdn gslb-20151209
Cdn gslb-20151209
Eric Ahn
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolith Stay productive while slicing up the monolith
Stay productive while slicing up the monolith
Markus Eisele
 
Velocity - NxtGen Oxford
Velocity - NxtGen OxfordVelocity - NxtGen Oxford
Velocity - NxtGen OxfordPhil Pursglove
 
Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...
Boris Kravtsov
 
Nikolay Sh Gslb For Xen App
Nikolay Sh   Gslb For Xen AppNikolay Sh   Gslb For Xen App
Nikolay Sh Gslb For Xen AppLiudmila Li
 
Peformance Evaluation of Container-based Vi
Peformance Evaluation of Container-based ViPeformance Evaluation of Container-based Vi
Peformance Evaluation of Container-based ViMiguel Xavier
 
Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...
Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...
Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...
Jelastic Multi-Cloud PaaS
 
Cloud stack overview
Cloud stack overviewCloud stack overview
Cloud stack overview
gavin_lee
 
Ceph and Apache CloudStack
Ceph and Apache CloudStackCeph and Apache CloudStack
Ceph and Apache CloudStack
ke4qqq
 
Application Deployment and Management at Scale at 1&1
Application Deployment and Management at Scale at 1&1Application Deployment and Management at Scale at 1&1
Application Deployment and Management at Scale at 1&1
Matt Baldwin
 
XPDDS17: Virtualization at Huawei: Usage, Value-add and Challenges - Jinsong ...
XPDDS17: Virtualization at Huawei: Usage, Value-add and Challenges - Jinsong ...XPDDS17: Virtualization at Huawei: Usage, Value-add and Challenges - Jinsong ...
XPDDS17: Virtualization at Huawei: Usage, Value-add and Challenges - Jinsong ...
The Linux Foundation
 
DevOps with ActiveMQ, Camel, Fabric8, and HawtIO
DevOps with ActiveMQ, Camel, Fabric8, and HawtIO DevOps with ActiveMQ, Camel, Fabric8, and HawtIO
DevOps with ActiveMQ, Camel, Fabric8, and HawtIO
Christian Posta
 
ElasticKube, a Container Management Platform for Kubernetes
ElasticKube, a Container Management Platform for KubernetesElasticKube, a Container Management Platform for Kubernetes
ElasticKube, a Container Management Platform for Kubernetes
Matt Baldwin
 
Vm mobility
Vm mobilityVm mobility
Vm mobility
hypervnu
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling Out
Sander Temme
 
Run tests at scale with on-demand Selenium Grid using AWS Fargate
Run tests at scale with on-demand Selenium Grid using AWS FargateRun tests at scale with on-demand Selenium Grid using AWS Fargate
Run tests at scale with on-demand Selenium Grid using AWS Fargate
Megha Mehta
 

What's hot (20)

Autoscaled Distributed Automation using AWS at Selenium London MeetUp
Autoscaled Distributed Automation using AWS at Selenium London MeetUpAutoscaled Distributed Automation using AWS at Selenium London MeetUp
Autoscaled Distributed Automation using AWS at Selenium London MeetUp
 
Developing the Stratoscale System at Scale - Muli Ben-Yehuda, Stratoscale - D...
Developing the Stratoscale System at Scale - Muli Ben-Yehuda, Stratoscale - D...Developing the Stratoscale System at Scale - Muli Ben-Yehuda, Stratoscale - D...
Developing the Stratoscale System at Scale - Muli Ben-Yehuda, Stratoscale - D...
 
Migrating Enterprise Microservices From Cloud Foundry to Kubernetes
Migrating Enterprise Microservices From Cloud Foundry to KubernetesMigrating Enterprise Microservices From Cloud Foundry to Kubernetes
Migrating Enterprise Microservices From Cloud Foundry to Kubernetes
 
Muli Ben-Yehuda, Stratoscale - The Road to a Hyper-Converged OpenStack, OpenS...
Muli Ben-Yehuda, Stratoscale - The Road to a Hyper-Converged OpenStack, OpenS...Muli Ben-Yehuda, Stratoscale - The Road to a Hyper-Converged OpenStack, OpenS...
Muli Ben-Yehuda, Stratoscale - The Road to a Hyper-Converged OpenStack, OpenS...
 
Cdn gslb-20151209
Cdn gslb-20151209Cdn gslb-20151209
Cdn gslb-20151209
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolith Stay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Velocity - NxtGen Oxford
Velocity - NxtGen OxfordVelocity - NxtGen Oxford
Velocity - NxtGen Oxford
 
Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...
 
Nikolay Sh Gslb For Xen App
Nikolay Sh   Gslb For Xen AppNikolay Sh   Gslb For Xen App
Nikolay Sh Gslb For Xen App
 
Peformance Evaluation of Container-based Vi
Peformance Evaluation of Container-based ViPeformance Evaluation of Container-based Vi
Peformance Evaluation of Container-based Vi
 
Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...
Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...
Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...
 
Cloud stack overview
Cloud stack overviewCloud stack overview
Cloud stack overview
 
Ceph and Apache CloudStack
Ceph and Apache CloudStackCeph and Apache CloudStack
Ceph and Apache CloudStack
 
Application Deployment and Management at Scale at 1&1
Application Deployment and Management at Scale at 1&1Application Deployment and Management at Scale at 1&1
Application Deployment and Management at Scale at 1&1
 
XPDDS17: Virtualization at Huawei: Usage, Value-add and Challenges - Jinsong ...
XPDDS17: Virtualization at Huawei: Usage, Value-add and Challenges - Jinsong ...XPDDS17: Virtualization at Huawei: Usage, Value-add and Challenges - Jinsong ...
XPDDS17: Virtualization at Huawei: Usage, Value-add and Challenges - Jinsong ...
 
DevOps with ActiveMQ, Camel, Fabric8, and HawtIO
DevOps with ActiveMQ, Camel, Fabric8, and HawtIO DevOps with ActiveMQ, Camel, Fabric8, and HawtIO
DevOps with ActiveMQ, Camel, Fabric8, and HawtIO
 
ElasticKube, a Container Management Platform for Kubernetes
ElasticKube, a Container Management Platform for KubernetesElasticKube, a Container Management Platform for Kubernetes
ElasticKube, a Container Management Platform for Kubernetes
 
Vm mobility
Vm mobilityVm mobility
Vm mobility
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling Out
 
Run tests at scale with on-demand Selenium Grid using AWS Fargate
Run tests at scale with on-demand Selenium Grid using AWS FargateRun tests at scale with on-demand Selenium Grid using AWS Fargate
Run tests at scale with on-demand Selenium Grid using AWS Fargate
 

Similar to Kubernetes Resources Allocation

Lc3 beijing-june262018-sahdev zala-guangya
Lc3 beijing-june262018-sahdev zala-guangyaLc3 beijing-june262018-sahdev zala-guangya
Lc3 beijing-june262018-sahdev zala-guangya
Sahdev Zala
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptx
Knoldus Inc.
 
Kubernetes Problem-Solving
Kubernetes Problem-SolvingKubernetes Problem-Solving
Kubernetes Problem-Solving
All Things Open
 
Burst workloads Cutting costs with Kubernetes and Virtual Kubelet
Burst workloads Cutting costs with Kubernetes and Virtual KubeletBurst workloads Cutting costs with Kubernetes and Virtual Kubelet
Burst workloads Cutting costs with Kubernetes and Virtual Kubelet
Adi Polak
 
Cloud Architecture Tutorial - Running in the Cloud (3of3)
Cloud Architecture Tutorial - Running in the Cloud (3of3)Cloud Architecture Tutorial - Running in the Cloud (3of3)
Cloud Architecture Tutorial - Running in the Cloud (3of3)
Adrian Cockcroft
 
Sql Start! 2020 - SQL Server Lift & Shift su Azure
Sql Start! 2020 - SQL Server Lift & Shift su AzureSql Start! 2020 - SQL Server Lift & Shift su Azure
Sql Start! 2020 - SQL Server Lift & Shift su Azure
Marco Obinu
 
WORKSHOP: Microservices as Containers on AWS
WORKSHOP: Microservices as Containers on AWSWORKSHOP: Microservices as Containers on AWS
WORKSHOP: Microservices as Containers on AWS
Casey Lee
 
Scu2016 Azure Best practices
Scu2016 Azure Best practicesScu2016 Azure Best practices
Scu2016 Azure Best practices
Alexandre Verkinderen
 
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Andrew Miller
 
Concurrency at Scale: Evolution to Micro-Services
Concurrency at Scale:  Evolution to Micro-ServicesConcurrency at Scale:  Evolution to Micro-Services
Concurrency at Scale: Evolution to Micro-Services
Randy Shoup
 
The impact of cloud NSBCon NY by Yves Goeleven
The impact of cloud NSBCon NY by Yves GoelevenThe impact of cloud NSBCon NY by Yves Goeleven
The impact of cloud NSBCon NY by Yves Goeleven
Particular Software
 
The Kubernetes WebLogic revival (part 2)
The Kubernetes WebLogic revival (part 2)The Kubernetes WebLogic revival (part 2)
The Kubernetes WebLogic revival (part 2)
Simon Haslam
 
Containerising bootiful microservices javaeeconf
Containerising bootiful microservices javaeeconfContainerising bootiful microservices javaeeconf
Containerising bootiful microservices javaeeconf
Ivan Vasyliev
 
Kubernetes Cairo Meetup_dec_2019
Kubernetes Cairo Meetup_dec_2019Kubernetes Cairo Meetup_dec_2019
Kubernetes Cairo Meetup_dec_2019
Ahmed Atef
 
KCD2022 Predictive Autoscaling Patterns in k8s.pdf
KCD2022 Predictive Autoscaling Patterns in k8s.pdfKCD2022 Predictive Autoscaling Patterns in k8s.pdf
KCD2022 Predictive Autoscaling Patterns in k8s.pdf
RobertoCarratalaSanc1
 
JPrime_JITServer.pptx
JPrime_JITServer.pptxJPrime_JITServer.pptx
JPrime_JITServer.pptx
Grace Jansen
 
USAA Mono-to-Serverless.pdf
USAA Mono-to-Serverless.pdfUSAA Mono-to-Serverless.pdf
USAA Mono-to-Serverless.pdf
RichHagarty
 
Best Practices with Azure Kubernetes Services
Best Practices with Azure Kubernetes ServicesBest Practices with Azure Kubernetes Services
Best Practices with Azure Kubernetes Services
QAware GmbH
 
20191201 kubernetes managed weblogic revival - part 2
20191201 kubernetes managed weblogic revival - part 220191201 kubernetes managed weblogic revival - part 2
20191201 kubernetes managed weblogic revival - part 2
makker_nl
 
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Tony Erwin
 

Similar to Kubernetes Resources Allocation (20)

Lc3 beijing-june262018-sahdev zala-guangya
Lc3 beijing-june262018-sahdev zala-guangyaLc3 beijing-june262018-sahdev zala-guangya
Lc3 beijing-june262018-sahdev zala-guangya
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptx
 
Kubernetes Problem-Solving
Kubernetes Problem-SolvingKubernetes Problem-Solving
Kubernetes Problem-Solving
 
Burst workloads Cutting costs with Kubernetes and Virtual Kubelet
Burst workloads Cutting costs with Kubernetes and Virtual KubeletBurst workloads Cutting costs with Kubernetes and Virtual Kubelet
Burst workloads Cutting costs with Kubernetes and Virtual Kubelet
 
Cloud Architecture Tutorial - Running in the Cloud (3of3)
Cloud Architecture Tutorial - Running in the Cloud (3of3)Cloud Architecture Tutorial - Running in the Cloud (3of3)
Cloud Architecture Tutorial - Running in the Cloud (3of3)
 
Sql Start! 2020 - SQL Server Lift & Shift su Azure
Sql Start! 2020 - SQL Server Lift & Shift su AzureSql Start! 2020 - SQL Server Lift & Shift su Azure
Sql Start! 2020 - SQL Server Lift & Shift su Azure
 
WORKSHOP: Microservices as Containers on AWS
WORKSHOP: Microservices as Containers on AWSWORKSHOP: Microservices as Containers on AWS
WORKSHOP: Microservices as Containers on AWS
 
Scu2016 Azure Best practices
Scu2016 Azure Best practicesScu2016 Azure Best practices
Scu2016 Azure Best practices
 
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
 
Concurrency at Scale: Evolution to Micro-Services
Concurrency at Scale:  Evolution to Micro-ServicesConcurrency at Scale:  Evolution to Micro-Services
Concurrency at Scale: Evolution to Micro-Services
 
The impact of cloud NSBCon NY by Yves Goeleven
The impact of cloud NSBCon NY by Yves GoelevenThe impact of cloud NSBCon NY by Yves Goeleven
The impact of cloud NSBCon NY by Yves Goeleven
 
The Kubernetes WebLogic revival (part 2)
The Kubernetes WebLogic revival (part 2)The Kubernetes WebLogic revival (part 2)
The Kubernetes WebLogic revival (part 2)
 
Containerising bootiful microservices javaeeconf
Containerising bootiful microservices javaeeconfContainerising bootiful microservices javaeeconf
Containerising bootiful microservices javaeeconf
 
Kubernetes Cairo Meetup_dec_2019
Kubernetes Cairo Meetup_dec_2019Kubernetes Cairo Meetup_dec_2019
Kubernetes Cairo Meetup_dec_2019
 
KCD2022 Predictive Autoscaling Patterns in k8s.pdf
KCD2022 Predictive Autoscaling Patterns in k8s.pdfKCD2022 Predictive Autoscaling Patterns in k8s.pdf
KCD2022 Predictive Autoscaling Patterns in k8s.pdf
 
JPrime_JITServer.pptx
JPrime_JITServer.pptxJPrime_JITServer.pptx
JPrime_JITServer.pptx
 
USAA Mono-to-Serverless.pdf
USAA Mono-to-Serverless.pdfUSAA Mono-to-Serverless.pdf
USAA Mono-to-Serverless.pdf
 
Best Practices with Azure Kubernetes Services
Best Practices with Azure Kubernetes ServicesBest Practices with Azure Kubernetes Services
Best Practices with Azure Kubernetes Services
 
20191201 kubernetes managed weblogic revival - part 2
20191201 kubernetes managed weblogic revival - part 220191201 kubernetes managed weblogic revival - part 2
20191201 kubernetes managed weblogic revival - part 2
 
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
 

More from Victor Morales

KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Open Discussion: Nephio Test-infra project
Open Discussion: Nephio Test-infra projectOpen Discussion: Nephio Test-infra project
Open Discussion: Nephio Test-infra project
Victor Morales
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitos
Victor Morales
 
CCOSS + KCD Mexico 2024 - Embracing GitOps in Telecom with Nephio
CCOSS + KCD Mexico 2024 - Embracing GitOps in Telecom with NephioCCOSS + KCD Mexico 2024 - Embracing GitOps in Telecom with Nephio
CCOSS + KCD Mexico 2024 - Embracing GitOps in Telecom with Nephio
Victor Morales
 
Nephio 101
Nephio 101Nephio 101
Nephio 101
Victor Morales
 
Tips and tricks for contributing to an Open Source project.pptx
Tips and tricks for contributing to an Open Source project.pptxTips and tricks for contributing to an Open Source project.pptx
Tips and tricks for contributing to an Open Source project.pptx
Victor Morales
 
Understanding the Cloud-Native origins.pptx
Understanding the Cloud-Native origins.pptxUnderstanding the Cloud-Native origins.pptx
Understanding the Cloud-Native origins.pptx
Victor Morales
 
My OPNFV journey
My OPNFV journeyMy OPNFV journey
My OPNFV journey
Victor Morales
 
Deciphering Kubernetes Networking
Deciphering Kubernetes NetworkingDeciphering Kubernetes Networking
Deciphering Kubernetes Networking
Victor Morales
 
Removing Language Barriers for Spanish-speaking Professionals
Removing Language Barriers for Spanish-speaking ProfessionalsRemoving Language Barriers for Spanish-speaking Professionals
Removing Language Barriers for Spanish-speaking Professionals
Victor Morales
 
Understanding kube proxy in ipvs mode
Understanding kube proxy in ipvs modeUnderstanding kube proxy in ipvs mode
Understanding kube proxy in ipvs mode
Victor Morales
 
How to contribute to an open source project and don’t die during the Code Rev...
How to contribute to an open source project and don’t die during the Code Rev...How to contribute to an open source project and don’t die during the Code Rev...
How to contribute to an open source project and don’t die during the Code Rev...
Victor Morales
 
Mutating Admission Webhook creation
Mutating Admission Webhook creationMutating Admission Webhook creation
Mutating Admission Webhook creation
Victor Morales
 
Deep dive networking
Deep dive networkingDeep dive networking
Deep dive networking
Victor Morales
 
GW Tester
GW TesterGW Tester
GW Tester
Victor Morales
 
Pod Sandbox workflow creation from Dockershim
Pod Sandbox workflow creation from DockershimPod Sandbox workflow creation from Dockershim
Pod Sandbox workflow creation from Dockershim
Victor Morales
 
Kubernetes fundamentals
Kubernetes fundamentalsKubernetes fundamentals
Kubernetes fundamentals
Victor Morales
 
Cloud native fundamentals
Cloud native fundamentalsCloud native fundamentals
Cloud native fundamentals
Victor Morales
 
Building cloud native network functions - outcomes from the gw-tester nsm imp...
Building cloud native network functions - outcomes from the gw-tester nsm imp...Building cloud native network functions - outcomes from the gw-tester nsm imp...
Building cloud native network functions - outcomes from the gw-tester nsm imp...
Victor Morales
 
Reference CNF development journey and outcomes
Reference CNF development journey and outcomesReference CNF development journey and outcomes
Reference CNF development journey and outcomes
Victor Morales
 

More from Victor Morales (20)

KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Open Discussion: Nephio Test-infra project
Open Discussion: Nephio Test-infra projectOpen Discussion: Nephio Test-infra project
Open Discussion: Nephio Test-infra project
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitos
 
CCOSS + KCD Mexico 2024 - Embracing GitOps in Telecom with Nephio
CCOSS + KCD Mexico 2024 - Embracing GitOps in Telecom with NephioCCOSS + KCD Mexico 2024 - Embracing GitOps in Telecom with Nephio
CCOSS + KCD Mexico 2024 - Embracing GitOps in Telecom with Nephio
 
Nephio 101
Nephio 101Nephio 101
Nephio 101
 
Tips and tricks for contributing to an Open Source project.pptx
Tips and tricks for contributing to an Open Source project.pptxTips and tricks for contributing to an Open Source project.pptx
Tips and tricks for contributing to an Open Source project.pptx
 
Understanding the Cloud-Native origins.pptx
Understanding the Cloud-Native origins.pptxUnderstanding the Cloud-Native origins.pptx
Understanding the Cloud-Native origins.pptx
 
My OPNFV journey
My OPNFV journeyMy OPNFV journey
My OPNFV journey
 
Deciphering Kubernetes Networking
Deciphering Kubernetes NetworkingDeciphering Kubernetes Networking
Deciphering Kubernetes Networking
 
Removing Language Barriers for Spanish-speaking Professionals
Removing Language Barriers for Spanish-speaking ProfessionalsRemoving Language Barriers for Spanish-speaking Professionals
Removing Language Barriers for Spanish-speaking Professionals
 
Understanding kube proxy in ipvs mode
Understanding kube proxy in ipvs modeUnderstanding kube proxy in ipvs mode
Understanding kube proxy in ipvs mode
 
How to contribute to an open source project and don’t die during the Code Rev...
How to contribute to an open source project and don’t die during the Code Rev...How to contribute to an open source project and don’t die during the Code Rev...
How to contribute to an open source project and don’t die during the Code Rev...
 
Mutating Admission Webhook creation
Mutating Admission Webhook creationMutating Admission Webhook creation
Mutating Admission Webhook creation
 
Deep dive networking
Deep dive networkingDeep dive networking
Deep dive networking
 
GW Tester
GW TesterGW Tester
GW Tester
 
Pod Sandbox workflow creation from Dockershim
Pod Sandbox workflow creation from DockershimPod Sandbox workflow creation from Dockershim
Pod Sandbox workflow creation from Dockershim
 
Kubernetes fundamentals
Kubernetes fundamentalsKubernetes fundamentals
Kubernetes fundamentals
 
Cloud native fundamentals
Cloud native fundamentalsCloud native fundamentals
Cloud native fundamentals
 
Building cloud native network functions - outcomes from the gw-tester nsm imp...
Building cloud native network functions - outcomes from the gw-tester nsm imp...Building cloud native network functions - outcomes from the gw-tester nsm imp...
Building cloud native network functions - outcomes from the gw-tester nsm imp...
 
Reference CNF development journey and outcomes
Reference CNF development journey and outcomesReference CNF development journey and outcomes
Reference CNF development journey and outcomes
 

Recently uploaded

Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
veerababupersonal22
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 

Recently uploaded (20)

Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 

Kubernetes Resources Allocation

  • 2. Agenda • Lifecycle of a Pod • Request and Limits • Quality of Service Classes • Best Effort • Burstable • Guaranteed • Demo – Virtlet VM with Burstable QoS class • Demo – Virtlet VM with Guaranteed QoS class • CPU Management Policies
  • 3. Lifecycle of a Pod Requests are important at schedule time, and limits are important at run time.
  • 4. Requests and Limits • Request is a critical input to the scheduler. • Limit is important to Kubelet (the daemon on each node that is responsible for pod health). Exceeding a memory limit makes your container process a candidate for oom-killing. But Kubernetes does not terminate pods for exceeding CPU limits.
  • 5. Quality of Service Classes Pods that need to stay up and consistently good can request guaranteed resources, while pods with less exacting requirements can use resources with less/no guarantee.
  • 6. Best Effort Pods are dangerous because Kubernetes has no idea where to put them and when to kill so it’s forced to guess. https://medium.com/better-programming/the-kubernetes-quality-of-service-conundrum-eebbbb5f89cf
  • 7. Burstable • Pods are good for cost optimization. • Reduces the possibility of node CPU starvation. • If one pod expands out (noisy neighbor) at one time is OK.
  • 8. Guarantee • Pods are considered top-priority and are not be killed until they exceed their limits. • They remove the possibility of scaling out into more CPU, but it reserves the exact amount that your containers are going to need.
  • 10. Demo – Virtlet VM with Burstable QoS class
  • 11. Demo – Virtlet VM with Burstable QoS class Create Virtlet VM Create Linux Pod Destroy Linux Pod Suspend Virtlet VM Create Linux Pod
  • 12. Demo – Virtlet VM with Guaranteed QoS class
  • 13. Demo – Virtlet VM with Guaranteed QoS class Create Virtlet VM Create Linux Pod Destroy Virtlet VM
  • 14. Resources Requests and Limits • https://www.noqcks.io/notes/2018/02/03/understanding-kubernetes-resources/ • https://mcrthr.com/kubernetes-cpu-limits • https://medium.com/@betz.mark/understanding-resource-limits-in-kubernetes-memory- 6b41e9a955f9 • https://medium.com/@betz.mark/understanding-resource-limits-in-kubernetes-cpu-time- 9eff74d3161b Quality of Service • https://medium.com/better-programming/the-kubernetes-quality-of-service-conundrum- eebbbb5f89cf • https://www.weave.works/blog/kubernetes-pod-resource-limitations-and-quality-of-service • https://medium.com/google-cloud/quality-of-service-class-qos-in-kubernetes-bb76a89eb2c6 • https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/
  • 15. Backup CPU Management Policies & CriticalPodAdmissionHandler
  • 16. CPU Management Policies Enables better placement of sensitive workloads in the Kubelet by allocating exclusive CPUs to certain pod containers. • none: Provides no affinity beyond what the OS scheduler does automatically (CFS quota). Default • static: Allocates exclusive CPUs to pod containers in the Guaranteed QoS class with integer CPUs requests. https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/ https://kubernetes.io/blog/2018/07/24/feature-highlight-cpu-manager/
  • 17. CriticalPodAdmissionHandler IsCriticalPod returns true if the pod bears the critical pod annotation key or if pod's priority is greater than or equal to SystemCriticalPriority. Both the default scheduler and the kubelet use this function to make admission and scheduling decisions. CriticalPodAdmissionHandler is an AdmissionFailureHandler that handles admission failure for Critical Pods. If the ONLY admission failures are due to insufficient resources, then CriticalPodAdmissionHandler evicts pods so that the critical pod can be admitted. For evictions, the CriticalPodAdmissionHandler evicts a set of pods that frees up the required resource requests. The set of pods is designed to minimize impact, and is prioritized according to the ordering: minimal impact for guaranteed pods > minimal impact for burstable pods > minimal impact for besteffort pods. minimal impact is defined as follows: fewest pods evicted > fewest total requests of pods. finding the fewest total requests of pods is considered besteffort.

Editor's Notes

  1. At a very high level, the scheduler controller maintains a queue of pods to be deployed for the cluster and then for each workload in the queue looks for a node with enough available compute resources to fulfill the `request` for that pod and assigns the pod to that node. Limits are ignored during scheduling. Once a pod is scheduled to a node, the Kubelet on that node picks up the change, and installs and starts the pod. In Kubernetes versions < 1.8 pod priority is ignored by the scheduler, in 1.11 the above story is modified so that pods are scheduled in priority order. In 1.8-1.10 this feature was in alpha and had to be explicitly enabled in the Kubernetes config.
  2. What happens if you don’t set these properties on your container, or set them to inaccurate values? As with memory, if you set a limit but don’t set a request kubernetes will default the request to the limit. This can be fine if you have very good knowledge of how much cpu time your workload requires. How about setting a request with no limit? In this case kubernetes is able to accurately schedule your pod, and the kernel will make sure it gets at least the number of shares asked for, but your process will not be prevented from using more than the amount of cpu requested, which will be stolen from other process’s cpu shares when available. Setting neither a request nor a limit is the worst-case scenario: the scheduler has no idea what the container needs, and the process’s use of cpu shares is unbounded, which may affect the node adversely. And that’s a good segue into the last thing I want to talk about: ensuring default limits in a namespace.
  3. RunContainerError https://github.com/kubernetes/kubernetes/blob/v1.15.3/pkg/kubelet/container/sync_result.go#L38
  4. When CPU manager is enabled with the “static” policy, it manages a shared pool of CPUs. Initially this shared pool contains all the CPUs in the compute node. When a container with integer CPU request in a Guaranteed pod is created by the Kubelet, CPUs for that container are removed from the shared pool and assigned exclusively for the lifetime of the container. Other containers are migrated off these exclusively allocated CPUs. All non-exclusive-CPU containers (Burstable, BestEffort and Guaranteed with non-integer CPU) run on the CPUs remaining in the shared pool. When a container with exclusive CPUs terminates, its CPUs are added back to the shared CPU pool.
  5. http://www.programmersought.com/article/32681342263/ https://github.com/kubernetes/kubernetes/blob/v1.15.3/pkg/kubelet/types/pod_update.go#L145-L160 https://github.com/kubernetes/kubernetes/blob/v1.15.3/pkg/kubelet/preemption/preemption.go#L61-L88