Back to all scenarios
Scenario #344
Storage
Kubernetes v1.23, hostPath volumes
Application Data Lost After Node Eviction
Node drained for maintenance led to permanent data loss for apps using hostPath volumes.
Find this helpful?
What Happened
Stateful workloads were evicted. When pods rescheduled on new nodes, the volume path was empty.
Diagnosis Steps
- 1Observed empty application directories post-scheduling.
- 2Confirmed hostPath location was not shared across nodes.
Root Cause
hostPath volumes are node-specific and not portable.
Fix/Workaround
• Migrated to CSI-based dynamic provisioning.
• Used NFS for shared storage.
Lessons Learned
hostPath is unsafe for stateful production apps.
How to Avoid
- 1Use portable CSI drivers for persistent data.
- 2Restrict hostPath usage with admission controllers.