Back to all scenarios
Scenario #385
Storage
Kubernetes v1.26, StatefulSet with CSI driver
VolumeAttach Race on StatefulSet Rolling Update
Volume attach operations failed during parallel pod updates.
Find this helpful?
What Happened
Two pods in a StatefulSet update attempted to use the same PVC briefly due to quick scale down/up.
Diagnosis Steps
- 1Events: Multi-Attach error for volume.
- 2CSI logs showed repeated attach/detach.
Root Cause
StatefulSet update policy did not wait for volume detachment.
Fix/Workaround
• Set podManagementPolicy: OrderedReady.
Lessons Learned
StatefulSet updates need to be serialized with volume awareness.
How to Avoid
- 1Tune StatefulSet rollout policies.
- 2Monitor CSI attach/detach metrics.