Scheduling, Resources & Health
Cheat sheet · https://pcornel.dk/topic.php?topic=6083
Answer
Scheduling, resources and health: the scheduler places pods on nodes that fit their requests, affinity and tolerations; limits cap usage; probes tell Kubernetes when a container is alive and ready.
Remember
Set requests to real usage and memory limits to protect nodes. A memory limit hit → OOMKilled (exit 137). Readiness gates traffic; liveness restarts; startup protects slow starts.
First checks
kubectl top pod— current CPU/memory usekubectl get pods -o wide— pods, status, node, IPkubectl describe pod <pod>— events and conditionskubectl logs <pod> [-c <c>] [--previous]— container logs (incl. previous crash)kubectl get events --sort-by=.lastTimestamp— recent cluster events
Verify in this order
pod requests → scheduler filters/scores nodes → bound → kubelet enforces limits → probes report health
Where it usually breaks
Common failures are impossible affinity rules, untolerated taints, oversized requests, CPU throttling, memory OOMKills, liveness probes causing restart storms, readiness probes masking dependency failures and node pressure triggering evictions.
Scheduling, Resources & Health verification boundary matrix
| Boundary | Inspect | Healthy interpretation | Do not infer |
|---|---|---|---|
| Intent | Requests and limits | Intended object/scope is explicit and versioned where relevant | Intent is already effective |
| Owning runtime/control plane | QoS classes / Node selectors | Owner accepts and reports the expected object state | Downstream dependencies are healthy |
| Effective state | Affinity/anti-affinity | Independent read-back matches the intended state | Every client sees the same result |
| Consumer outcome | Taints and tolerations | The original bounded check succeeds in the same time window | Production correctness outside this scope |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6083