Volumes and Persistent Storage
Part of the Kubernetes course
Everything you have deployed so far has been amnesiac on purpose. A Pod starts, does its job, and when it dies the filesystem it was writing to dies with it. For a web server handing out pages that is exactly right. For a database it is a disaster, and the first time you find out is when a node reboots and your data is simply gone.
The reason is worth being precise about, because it is not an accident. A Pod is one running copy of your application, and Kubernetes treats it as disposable: it will move Pods between machines, replace them during an update, and restart them when they crash. If the data lived inside the Pod, moving the Pod would move the data, and moving data between machines is not something a scheduler can do casually.
Want to learn Kubernetes Volumes and Persistent Storage in a real environment?
Click below, get a fresh Linux box with Kubernetes ready to go, and work through Volumes and Persistent Storage hands-on with an AI tutor that knows your code.
Start this lessonVolumes and Persistent StorageWhat you'll learn
- EmptyDir
- PersistentVolumeClaim
- StorageClass
- PVC manifest
- Mount in a Deployment
