Pcornel
Containers

Scheduling, Resources & Health

Cheat sheet · https://pcornel.dk/topic.php?topic=6083

Back to the Topic

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 use
  • kubectl get pods -o wide — pods, status, node, IP
  • kubectl describe pod <pod> — events and conditions
  • kubectl 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

BoundaryInspectHealthy interpretationDo not infer
IntentRequests and limitsIntended object/scope is explicit and versioned where relevantIntent is already effective
Owning runtime/control planeQoS classes / Node selectorsOwner accepts and reports the expected object stateDownstream dependencies are healthy
Effective stateAffinity/anti-affinityIndependent read-back matches the intended stateEvery client sees the same result
Consumer outcomeTaints and tolerationsThe original bounded check succeeds in the same time windowProduction 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

Confirmation

Confirm action

Continue?