Working with Volume Snapshots

1. Installing VolumeSnapshot CRDs

kubectl apply -k https://github.com/kubernetes-csi/external-snapshotter/client/config/crd
kubectl apply -k https://github.com/kubernetes-csi/external-snapshotter/deploy/kubernetes/snapshot-controller
CRDPurpose
VolumeSnapshotClassDefines snapshotter parameters
VolumeSnapshotUser request for snapshot
VolumeSnapshotContentCluster-scoped backing snapshot

2. Creating VolumeSnapshotClass

apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata: { name: ebs-snap }
driver: ebs.csi.aws.com
deletionPolicy: Delete
parameters:
  tagSpecification_1: "Backup=k8s"

3. Creating VolumeSnapshot

apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata: { name: data-snap-2026-05 }
spec:
  volumeSnapshotClassName: ebs-snap
  source:
    persistentVolumeClaimName: data
SourceField
PVCpersistentVolumeClaimName
Pre-existingvolumeSnapshotContentName

4. Listing VolumeSnapshots

kubectl get volumesnapshot
kubectl get vsc                 # cluster contents
StatusMeaning
ReadyToUsetrue when snapshot complete
RestoreSizeMin PVC size for restore

5. Describing VolumeSnapshot Details

FieldInfo
Source PVCOrigin
CreationTimeSnapshot creation
Bound ContentVolumeSnapshotContent name

6. Restoring PVC from Snapshot

apiVersion: v1
kind: PersistentVolumeClaim
metadata: { name: data-restore }
spec:
  storageClassName: gp3
  dataSource:
    name: data-snap-2026-05
    kind: VolumeSnapshot
    apiGroup: snapshot.storage.k8s.io
  accessModes: [ReadWriteOnce]
  resources: { requests: { storage: 50Gi } }

7. Configuring Snapshot Deletion Policy

deletionPolicyEffect
DeleteSnapshot in backend also removed
RetainSnapshot stays in backend (manual cleanup)

8. Using Snapshot with CSI Drivers

DriverNotes
EBS CSIEBS snapshots; cross-AZ restore supported
GCE PD CSIRegional/zonal snapshots
Azure Disk CSISnapshot to same region
Ceph RBDNative RBD snapshots

9. Deleting VolumeSnapshots

kubectl delete volumesnapshot data-snap-2026-05

10. Troubleshooting Snapshot Issues

SymptomCause
ReadyToUse=falseDriver still creating snapshot
Cannot restore PVCSize mismatch; check restoreSize
Stuck deletionFinalizer blocked by backend error
Snapshotter pod crashCheck controller logs in kube-system