Storage Errors — FailedMount, Pending PVCs, Multi-Attach and Full Volumes
Volumes that will not provision, attach, mount, fit or grow: Pending claims, attach and mount failures, Multi-Attach, full disks and stuck resizes, with the commands to prove each one and how it differs on EKS, AKS and GKE.
Overview
Storage is the most location-bound part of Kubernetes. A block disk lives in one availability zone, most block disks attach to one node at a time, and every node can hold only a limited number of them. Most storage incidents come down to one of those three facts, plus a fourth: Kubernetes does not watch how full a volume is, so a full disk looks perfectly healthy to the cluster.
A volume goes through a fixed path before a container can write to it: the claim is provisioned (a disk is created and a PersistentVolume bound), the pod is scheduled to a node that can use that disk, the disk is attached to the node, the kubelet mounts it into the pod, and later the disk may be expanded. Each stage is run by a different component and reports its failure on a different object: provisioning on the PVC, scheduling on the pod as FailedScheduling, attach on the pod as FailedAttachVolume and in the VolumeAttachment, mount on the pod as FailedMount. Read the event, find the stage, and you know which component to look at.
The map below puts every failure on this page on that path. Each red box is one of the sections that follow.
The one idea to keep: find the stage first, then the component. kubectl describe pvc and kubectl describe pod tell you which stage stopped; the CSI driver's logs and the cloud's own disk API tell you why.
Symptom to first command
Each symptom below points at its most likely cause and the first command to run. The sections that follow take them one at a time.
- Pod stuck ContainerCreating with FailedAttachVolume or FailedMount: the disk is still attached elsewhere, the node is at its attach limit, the CSI node plugin is down, or the cloud permissions are wrong. Start with kubectl describe pod -n prod.
- PVC stays Pending: a missing StorageClass or default, a failing provisioner, or WaitForFirstConsumer waiting for a pod. Start with kubectl describe pvc data-orders -n prod.
- Multi-Attach error or Waiting for detach on the new pod: a ReadWriteOnce disk is still attached to the old pod's node. Start with kubectl describe pvc data-orders -n prod (the Used By line).
- App fails with No space left on device while the pod is still Ready: the volume is full of bytes or of inodes. Start with kubectl exec -n prod -- df -h /data and df -i /data.
- PVC resized but the pod still sees the old size: the node-side filesystem expansion is pending or failed. Start with kubectl get pvc data-orders -n prod -o jsonpath='{.status.conditions}'.
- MountVolume.SetUp slow, or permission denied writing the volume: a recursive fsGroup ownership change, a missing fsGroup, or SELinux labels. Start with kubectl get pod -n prod -o jsonpath='{.spec.securityContext}'.
- driver name ... not found in the list of registered CSI drivers: the CSI node plugin is not running or not registered on that node. Start with kubectl get csinode -o yaml.
- Pod Pending with didn't match PersistentVolume's node affinity: the disk is in a zone with no schedulable node. Start with kubectl get pv -o jsonpath='{.spec.nodeAffinity}'.
Key concepts
- PersistentVolumeClaim (PVC)
- StorageClass
- WaitForFirstConsumer
- Access modes
- VolumeAttachment
- CSI controller and node plugins
- CSINode
- Out-of-service taint
- Two-stage expansion
- VolumeAttributesClass
Interview questions
- A node running orders-0 of a StatefulSet lost power. The pod shows Terminating and no replacement starts. Walk me through recovering it.
- Our Postgres pod is Running and Ready, but the app logs No space left on device. How do you handle it, and what would have caught it earlier?
- We raised a PVC from 20Gi to 50Gi an hour ago. kubectl get pv says 50Gi but the database still sees 20G. What is going on?
- After a deploy, the new pod of our single-replica orders Deployment is stuck in ContainerCreating with a Multi-Attach error, and the old pod is still running. Why, and how do you fix it for good?
- How does debugging storage differ on EKS, AKS and GKE?
- The cluster autoscaler removed nodes in one zone overnight. This morning a StatefulSet pod is Pending with a node affinity message, and the autoscaler is not adding nodes. Walk me through it.
- A new analytics pod with a volume of several million small files takes many minutes to start and sits in ContainerCreating. Nothing is failing. What is happening?
Sign up free to read the full topic
More DevOps topics
- SLO / SLI / Error Budgets
- SLSA — Software Supply Chain Security
- Software Supply Chain Security
- SonarQube — Quality Gates, Web API, Administration, Errors and Mistakes
- Sources — Git, OCI, Helm, Bucket
- Static Analysis for C/C++ in CI
- Strangler Fig
- Team Topologies
- Tekton
- Terraform — Production Errors, Mistakes and Recovery
- Terraform & OpenTofu
- Terraform count vs for_each
Start free on Cariara · Coding problems · System design studio