You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Containers are ephemeral — when a pod restarts, its filesystem is lost. Persistent storage decouples data from the container lifecycle. This lesson covers PersistentVolumes, PersistentVolumeClaims, StorageClasses, CSI drivers, and backup strategies.
┌──────────────────────────────────────┐
│ Pod │
│ ┌──────────────────────────────┐ │
│ │ Container │ │
│ │ volumeMount: /data │ │
│ └──────────────┬───────────────┘ │
└─────────────────┼────────────────────┘
│
┌─────────────────▼────────────────────┐
│ PersistentVolumeClaim (PVC) │
│ "I need 50Gi of fast SSD storage" │
└─────────────────┬────────────────────┘
│ binds to
┌─────────────────▼────────────────────┐
│ PersistentVolume (PV) │
│ "50Gi SSD volume, provisioned" │
└─────────────────┬────────────────────┘
│ backed by
┌─────────────────▼────────────────────┐
│ StorageClass │
│ "gp3-ssd" → CSI Driver → Cloud API │
└──────────────────────────────────────┘
A PV represents a piece of storage in the cluster, provisioned by an administrator or dynamically via a StorageClass.
apiVersion: v1
kind: PersistentVolume
metadata:
name: database-pv
spec:
capacity:
storage: 100Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: fast-ssd
csi:
driver: ebs.csi.aws.com
volumeHandle: vol-0abc123def456789
A PVC is a request for storage by a user.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-data
spec:
accessModes:
- ReadWriteOnce
storageClassName: fast-ssd
resources:
requests:
storage: 50Gi
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.