liveBook · Manning

Resource utilization

As explained in Kubernetes for Developers

A CPU metric is a measurement of processor consumption or capacity associated with a workload.

Resource utilization measures how much processor capacity a workload consumes. In Kubernetes, observe Pod CPU usage under startup, normal, and high load to choose practical resource requests and avoid waste. section 5.2

Use CPU measurements to guide deployment and scaling decisions:

  • Run kubectl top pods and observe usage after startup data becomes available; startup memory provides a lower bound for burstable workloads. section 5.2
  • Begin with an intentionally high resource request, apply realistic load, and reduce the request toward observed high-water usage. section 5.2
  • Use CPU utilization with a Horizontal Pod Autoscaler to add or remove replicas when average usage crosses a target percentage of requested CPU. section 6.2

Scaling a CPU-bound workload

A Deployment requests 250m CPU per Pod, while an HPA maintains between 1 and 10 replicas at a 20% average CPU-utilization target. Repeated requests to a CPU-intensive endpoint raise utilization and cause Kubernetes to create additional Pods.

How Kubernetes for Developers covers it

How deep it goes
Explains observation, load testing, request adjustment, and HPA behavior, but does not develop CPU measurement internals.
Examples
Demonstrates kubectl top, Apache Bench load, CPU-intensive request handling, and worker Pods scaled from two to ten replicas.
What it assumes
Assumes a deployed Kubernetes workload and introduces measurement, requests, load testing, and autoscaling through practical scenarios.
What you can do after
Configure resource requests and a CPU-based Horizontal Pod Autoscaler, then observe scaling with kubectl.
How it connects
Connects resource utilization with Kubernetes Pods, resource requests, resource limits, and the Horizontal Pod Autoscaler.

Also explained in

Compare how 8 books explain resource utilization →

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.