Skip to content
S. Sonbarse
← All labsSimulation

Scheduler

Why is this pod Pending?

Drive load into a small Kubernetes cluster. Watch the HPA calculation, the scheduler placing pods by resource requests, the Cluster Autoscaler adding nodes, and a StatefulSet that cannot simply move.

800m
60%
Replicas
6
Nodes
3
Pending
0
  • Deployment: web
  • StatefulSet: db, pinned to a zone
  • DaemonSet: log agent
  • node-1Zone a
    • log-agent-node-1
    • db-0
    • web-0
    • web-3
    55% CPU requested
  • node-2Zone b
    • log-agent-node-2
    • db-1
    • web-1
    • web-4
    55% CPU requested
  • node-3Zone c
    • log-agent-node-3
    • db-2
    • web-2
    • web-5
    55% CPU requested

Controller decisions

  1. HPA: ceil(800m / 250m / 60%) gives 6 replicas (bounds 2 to 40)
  2. Scheduler: every pod is bound

How the model works

Replicas come from the HPA formula. Pods are filtered by free CPU, memory and zone, then scored to spread across zones. Each StatefulSet ordinal is pinned to the zone of its volume.

What it leaves out

  • It solves to the final state at once, so there are no stabilization windows or scale-up delays.
  • It models requests and not actual usage, and leaves out taints, affinity and disruption budgets.

Covers

  • Deployments
  • StatefulSets
  • DaemonSets
  • HPA
  • Cluster Autoscaler
Next labWhat does this one-line change really do?