Lesson 12: Resources and health probes
Until now we told Kubernetes what to run, but not how much power to give it or how to know whether it is actually healthy. This lesson closes both gaps. First, resources: for each container you can state requests — the guaranteed amount of CPU and memory that the scheduler uses to decide which node
requests is the seat you reserved so you are guaranteed a spot; limits is the line you may never cross; the probes are a pulse check ("are you alive?") and a readiness check ("are you ready to work?").
- Resource Requests
- The guaranteed amount of CPU and memory for a container. The scheduler uses it to pick a node with enough free room.
- Resource Limits
- The hard cap on CPU and memory. Exceeding the memory cap kills the container (OOMKilled), and CPU is throttled down to the cap.
- Health Probes
- Periodic checks the kubelet runs against a container: liveness (is it alive, otherwise restart) and readiness (is it ready for traffic).
- Millicores
- The unit of CPU in Kubernetes. 1000m equals one full core, so 250m is a quarter of a core.
- Mebibyte (Mi)
- A binary memory unit. One Mi is 1024×1024 bytes, so 128Mi is 128 mebibytes of memory.