liveBook · Manning

Resource contention

As explained in Kubernetes for Developers

Resource contention is competition among workloads for finite computing resources on shared infrastructure.

Resource contention occurs when workloads compete for finite resources such as memory or CPU on shared Kubernetes infrastructure. Kubernetes protects the node by applying the requests, limits, and eviction rules declared for Pods. section 5.1.3 section 5.1.1

During contention, Kubernetes responds according to the resource and workload configuration:

  • The scheduler places Pods using resource requests, while limits constrain usage after scheduling. section 5.1.1
  • A Pod exceeding its memory limit is restarted, while one exceeding its CPU limit is throttled. section 5.1.1
  • Pods using more memory than requested may be evicted; managed workloads such as Deployments can reschedule evicted Pods. section 5.1.3
  • Best-effort Pods are most vulnerable, while Guaranteed Pods with equal requests and limits are protected from eviction. section 5.1.3 section 5.1.2
  • Frequent evictions indicate that requests may be too low or that the cluster needs additional capacity. section 5.1.3

A protected critical workload

A Deployment can request 200m CPU and 250Mi memory, set higher limits, and assign a high-priority class. Setting requests equal to limits instead makes the Pod Guaranteed; enabling preemption can allow the priority class to remove lower-priority Pods when capacity is unavailable.

How Kubernetes for Developers covers it

How deep it goes
Connects requests, limits, QoS, priority, eviction, and rescheduling, but stops short of detailed capacity-sizing procedures.
Examples
Uses timeserver Deployments, CPU and memory settings, QoS classes, eviction-order figures, and priority-class YAML.
What it assumes
Assumes Kubernetes Pods and containers, while establishing how requests and limits govern scheduling and runtime behavior.
What you can do after
Diagnose frequent evictions and configure requests, limits, QoS, priority, and cluster capacity accordingly.
How it connects
Connects resource requests, resource limits, quality of service, Pod eviction, priority classes, preemption, and workload rescheduling.

Also explained in

Compare how 3 books explain resource contention →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes for Developers. The section links point to the parts of the book it draws on.