100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

Kubernetes Storage (PV/PVC) Cheat Sheet

Kubernetes Storage (PV/PVC) Cheat Sheet

How PersistentVolumes, PersistentVolumeClaims, and StorageClasses provide durable, dynamically provisioned storage to pods.

2 PagesIntermediateFeb 8, 2026

Core Storage Objects

The three objects that make up Kubernetes' storage abstraction.

  • PersistentVolume (PV)- Cluster-level storage resource provisioned by an admin or dynamically by a StorageClass
  • PersistentVolumeClaim (PVC)- Namespaced request for storage by a pod; binds to a matching PV
  • StorageClass- Defines a provisioner and parameters for dynamic PV provisioning, e.g. EBS gp3
  • Access Modes- ReadWriteOnce, ReadOnlyMany, ReadWriteMany, ReadWriteOncePod - what the volume permits

StorageClass Definition

Dynamic provisioning class backed by AWS EBS gp3 volumes.

yaml
apiVersion: storage.k8s.io/v1kind: StorageClassmetadata:  name: fast-ssdprovisioner: ebs.csi.aws.comparameters:  type: gp3  fsType: ext4reclaimPolicy: DeletevolumeBindingMode: WaitForFirstConsumer

PersistentVolumeClaim

Request 10Gi of storage from the fast-ssd StorageClass.

yaml
apiVersion: v1kind: PersistentVolumeClaimmetadata:  name: data-pvcspec:  accessModes:    - ReadWriteOnce  storageClassName: fast-ssd  resources:    requests:      storage: 10Gi

Mounting a PVC in a Pod

Attach the PVC as a volume inside a container.

yaml
apiVersion: v1kind: Podmetadata:  name: appspec:  containers:    - name: app      image: myapp:1.0      volumeMounts:        - mountPath: /data          name: data-volume  volumes:    - name: data-volume      persistentVolumeClaim:        claimName: data-pvc

Reclaim Policies

What happens to a PV when its claim is deleted.

  • Retain- PV and underlying data are kept, must be manually reclaimed/deleted
  • Delete- PV and the underlying storage asset (e.g. EBS volume) are deleted automatically
  • Recycle (deprecated)- Basic scrub (`rm -rf`) then made available again, removed in newer Kubernetes versions
Pro Tip

Use `volumeBindingMode: WaitForFirstConsumer` on your StorageClass so the PV is provisioned in the same availability zone as the pod that will use it, avoiding cross-zone scheduling failures.

Was this cheat sheet helpful?

Explore Topics

#KubernetesStoragePVPVC#KubernetesStoragePVPVCCheatSheet#DevOps#Intermediate#CoreStorageObjects#StorageClassDefinition#PersistentVolumeClaim#MountingAPVCInAPod#Kubernetes#CheatSheet#SkillVeris
Advertisement
Sri Hayavadhana Info-Tech

Professional Web Designing Services

  • Responsive Websites
  • E-commerce Solutions
  • SEO Friendly Design
  • Fast & Secure
  • Support & Maintenance
Get a Free Quote

Share this Cheat Sheet