Node Volume Attach Limits

A Pod stays Pending, its event saying all three Nodes exceed max volume count, though each still has spare CPU and memory. What limit is that, who sets it, and what has to happen before the Pod is placed?

Play the animation 7 steps, animated, plays on a computer or a tablet

Node Volume Attach Limits, Kubernetes diagram

Node Volume Attach Limits, step by step

  1. The ceiling is not a Kubernetes setting. The CSI node plugin reports it as max_volumes_per_node in NodeGetInfo, and Kubelet writes it into CSINode as allocatable.count, rewriting it on a period if its CSIDriver sets one. Zero means no ceiling. Real drivers report from a handful to a few hundred.

    Play from step 1
  2. Now the cluster fills. More Pods with claims are scheduled, more disks attach, and every Node walks up to its own ceiling: eight of eight on all three, twenty four of twenty four across the cluster. No alarm fires, because a Node sitting exactly at its ceiling is a healthy Node.

    Play from step 2
  3. Now Pod web-0 is created and asks for one volume of its own. Before the Scheduler scores any Node it filters out the ones that cannot take the Pod at all, and one filter exists for this ceiling: NodeVolumeLimits. The filter skips a Pod with no claim and no migrated in-tree volume.

    Play from step 3
  4. The filter reads allocatable.count for the driver from each CSINode and counts what the Node already holds of that driver: the volumes of its Pods, plus any VolumeAttachment none of them uses, each volume once. Eight plus the one web-0 needs is over eight, so all three are rejected before scoring.

    Play from step 4
  5. So web-0 stays Pending, and its event reads zero of three Nodes are available, three Nodes exceed max volume count. Every one of those Nodes has spare CPU and spare memory, which is what makes this hard to recognise: the cluster looks half empty and the Pod will not schedule.

    Play from step 5
  6. Here a detach unblocks web-0. For a driver that attaches, the VolumeAttachment holds the slot, not the Pod, so deleting a Pod frees nothing until that object is gone, usually seconds to tens of seconds later. One completes on Node-3, the count drops to seven, and web-0 is requeued and placed there.

    Play from step 6
  7. Every lever here is about the ceiling and none is about CPU. Fewer volumes per Pod is the cheapest: four claims of one driver take four of its slots, less any volume already in use on that Node. More Nodes buy more slots, and an instance type that reports a higher ceiling buys more per Node.

    Play from step 7

Sources