Kubernetes Storage
Compare ephemeral and persistent storage options and understand how Kubernetes separates application pods from durable data.
Why Storage Is Different in Kubernetes
Pods are replaceable. Their writable container filesystem is usually ephemeral. That is a great fit for stateless apps but not for databases, uploads, or shared documents.
Ephemeral vs Persistent Storage
| Type | Examples | Lifetime |
|---|---|---|
| Ephemeral | container writable layer, emptyDir | Usually tied to pod lifetime |
| Persistent | PV and PVC backed storage | Designed to outlive pod replacement |
Common Volume Types
| Volume type | Best for |
|---|---|
emptyDir | Temporary working files shared within a pod |
hostPath | Development or special node-local use cases |
| PV and PVC | Durable storage abstraction |
Storage Abstraction Diagram
Pod → PVC → PV → Storage backend
Pod
mounts /data
PVC
claim · namespace
requests: 10Gi RWO
PV
cluster-wide resource
capacity: 50Gi
Storage
AWS EBS / GCP PD
NFS / hostPath
PV lifecycle phases
Sub-pages in This Section
| Sub-topic | What you will learn |
|---|---|
| Persistent Volumes and Claims | How PVs and PVCs bind and how pods consume them |
| StorageClasses | Dynamic provisioning and storage policies |
Key Mental Model
Workloads should be easy to replace. Data should not be. Kubernetes storage abstractions help separate those concerns.
Persistent Need
Why do many applications need persistent storage in Kubernetes?
emptyDir Lifetime
What is generally true about `emptyDir`?