Back to all scenarios
Scenario #373
Storage
Kubernetes v1.24, default EmptyDir

Pod Reboots Erase Data on EmptyDir Volume

Pod restarts caused in-memory volume to be wiped, resulting in lost logs.

Find this helpful?
What Happened

Logging container used EmptyDir with memory medium. Node rebooted, and logs were lost.

Diagnosis Steps
  • 1Post-reboot, EmptyDir was reinitialized.
  • 2Logs had disappeared from the container volume.
Root Cause

EmptyDir with medium: Memory is ephemeral and tied to node lifecycle.

Fix/Workaround
• Switched to hostPath for logs or persisted to object storage.
Lessons Learned

Understand EmptyDir behavior before using for critical data.

How to Avoid
  • 1Use PVs or centralized logging for durability.
  • 2Avoid medium: Memory unless necessary.