Snapshots, clones and volume attributes
Point-in-time copies of a volume, restored or cloned into fresh claims through dataSource, group snapshots across several volumes, and VolumeAttributesClass for changing a live volume's performance.
Shows the lesson one block at a time. Arrow keys step, number keys jump to a scene, and Escape returns to the page where you were.
A PersistentVolume survives the loss of its pod. It does not survive someone deleting it, a migration that corrupts its tables, or a performance tier that turns out too slow. This lesson covers the storage operations beyond provisioning: copying a volume at a point in time, creating fresh volumes from those copies, and changing a volume’s performance while it stays in use. All of them work only with CSI drivers, and only with drivers that implement the operation.
Reconcile, in 7 scenes
Snapshot objects
Snapshots reuse the shape of persistent storage, one level up:
| Provisioning | Snapshots | Scope |
|---|---|---|
| StorageClass | VolumeSnapshotClass | Cluster |
| PersistentVolumeClaim | VolumeSnapshot | Namespace |
| PersistentVolume | VolumeSnapshotContent | Cluster |
A VolumeSnapshotA namespaced request to copy a claim’s volume at a point in time, the snapshot counterpart of a PersistentVolumeClaim. is what you create. A VolumeSnapshotContentThe cluster-scoped object that represents one real snapshot on the storage system, bound one-to-one to a VolumeSnapshot. is what the system creates for it, or what an administrator creates by hand to import a snapshot that already exists on the storage system. A VolumeSnapshotClassA cluster-scoped object that names the CSI driver, the deletion policy and driver parameters used to take snapshots. says how.
All three are CustomResourceDefinitions in snapshot.storage.k8s.io/v1, GA in Kubernetes 1.20, not core API types:
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: csi-snapclass
annotations:
snapshot.storage.kubernetes.io/is-default-class: "true"
driver: hostpath.csi.k8s.io
deletionPolicy: Retain
---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
name: orders-nightly
namespace: shop
spec:
volumeSnapshotClassName: csi-snapclass
source:
persistentVolumeClaimName: orders-db
A VolumeSnapshot that names no class gets the default class whose driver matches the driver of the claim’s StorageClass. That allows one default per driver; two defaults for the same driver make snapshot creation fail. Like a StorageClass, a VolumeSnapshotClass cannot be updated after creation.
deletionPolicy decides what deleting the VolumeSnapshot does. Delete removes the VolumeSnapshotContent and the snapshot on the storage system; Retain keeps both, so the copy outlives the namespace it was taken in. While a snapshot is being taken, its source claim counts as in use: deleting the claim is postponed until the snapshot is readyToUse or has failed.
A dynamically created VolumeSnapshot reports status.readyToUse once the storage system has cut the snapshot, and status.restoreSize, the minimum size of a volume restored from it.
The snapshot controller
Snapshots involve three separately installed pieces:
- The CRDs, which add the API types.
- The snapshot controller, a control plane add-on that watches VolumeSnapshots, creates and binds VolumeSnapshotContents, and handles deletion.
- The
csi-snapshottersidecar, which ships with the CSI driver’s controller plugin, watches VolumeSnapshotContents and calls the driver’sCreateSnapshotandDeleteSnapshot.
Upstream Kubernetes leaves the first two to the cluster’s distribution; the driver brings only the third. A cluster can therefore have a snapshot-capable driver and no snapshot API at all, or the API with no driver able to use it. kx has neither:
kubectl api-resources --api-group=snapshot.storage.k8s.io
NAME SHORTNAMES APIVERSION NAMESPACED KIND
kubectl get volumesnapshots
error: the server doesn't have a resource type "volumesnapshots"
kubectl get storageclass standard -o jsonpath='{.provisioner}'
rancher.io/local-path
kubectl get pvc data
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE data Bound pvc-85694271-5cb3-4bab-9fc4-fc111ace4711 1Gi RWO standard <unset> 30s
kind’s local-path provisioner is not a CSI driver, so even with the CRDs installed it could not take a snapshot or apply a volume attributes class. The upstream external-snapshotter project publishes the CRDs and the controller, and the CSI hostpath driver, hostpath.csi.k8s.io in the upstream examples, is a test driver that implements snapshots and clones.
Restore
Restoring creates a fresh claim whose dataSource names the snapshot. The provisioner creates a volume pre-filled with the snapshot’s data, and from then on the claim is independent of the snapshot:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: orders-db-restored
namespace: shop
spec:
storageClassName: csi-ssd
dataSource:
name: orders-nightly
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.io
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 20Gi
The rules follow from how provisioning works. The class must belong to the same driver that took the snapshot, and the request must be at least the snapshot’s restoreSize.
Its sibling dataSourceRef, GA in Kubernetes 1.33, accepts a PersistentVolumeClaim or any kind from a non-core API group, keeps exactly what you wrote, and rejects a disallowed value with an error instead of dropping it. That is how a volume populator, a controller you install, fills a volume from a custom resource such as a backup in object storage. When dataSourceRef has no namespace, the API server copies whichever of the two fields you set into the other, so tools that read only dataSource still see the source.
Clones
A clone is a claim whose dataSource names another claim. The driver creates a volume that starts as an exact copy of the source:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: orders-db-test
namespace: shop
spec:
storageClassName: csi-ssd
dataSource:
kind: PersistentVolumeClaim
name: orders-db
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 20Gi
Clones have their own rules:
- Only CSI drivers that implement cloning support it, and only through dynamic provisioning.
- The source must be in the same namespace.
dataSourcehas no namespace field; cross-namespace data sources throughdataSourceRef.namespaceare alpha behind theCrossNamespaceVolumeDataSourcefeature gate. - The requested size must be at least the source’s capacity, and both claims must use the same
volumeMode. - Kubernetes allows the destination to use a different StorageClass, which in practice has to belong to the same driver.
- The clone is independent from the start: either claim can be modified, snapshotted or deleted without affecting the other.
The upstream documentation asks for a source claim that is bound and not in use; whether a driver can clone a volume that a running pod is writing depends on the driver. A clone is a fast way to give a test environment yesterday’s production data without a dump and reload, provided both live in one namespace.
Group snapshots
A database that keeps data on one volume and its write-ahead log on another cannot be restored from two snapshots taken seconds apart: the log may describe writes that the data volume never received. A VolumeGroupSnapshotA request to snapshot every claim matching a label selector at the same point in time, GA in Kubernetes 1.36. captures several volumes together. Its API mirrors single snapshots with VolumeGroupSnapshot, VolumeGroupSnapshotContent and VolumeGroupSnapshotClass, in groupsnapshot.storage.k8s.io/v1:
apiVersion: groupsnapshot.storage.k8s.io/v1
kind: VolumeGroupSnapshotClass
metadata:
name: csi-groupsnapclass
driver: example.csi.k8s.io
deletionPolicy: Delete
---
apiVersion: groupsnapshot.storage.k8s.io/v1
kind: VolumeGroupSnapshot
metadata:
name: orders-daily
namespace: shop
spec:
volumeGroupSnapshotClassName: csi-groupsnapclass
source:
selector:
matchLabels:
group: orders
Label every claim that belongs to the application with group: orders first. The group snapshot produces one ordinary VolumeSnapshot per member, and restore works as for a single snapshot: one claim with a dataSource per member snapshot. The result is crash-consistent across all members without quiescing the application. The driver must implement the CSI group controller service and advertise the CREATE_DELETE_GET_VOLUME_GROUP_SNAPSHOT capability, and the group snapshot CRDs ship with the same external-snapshotter release as the single-snapshot ones.
VolumeAttributesClass
A StorageClass’s parameters are fixed when a volume is provisioned, and the class itself cannot be edited. Performance settings often need to change afterwards: a database outgrows its IOPS, or a batch volume needs throughput for one night. A VolumeAttributesClassA cluster-scoped object in storage.k8s.io/v1 that names a CSI driver and a set of mutable volume parameters, such as IOPS or throughput, that a claim can switch between. carries exactly those mutable settings. It is GA in Kubernetes 1.34.
apiVersion: storage.k8s.io/v1
kind: VolumeAttributesClass
metadata:
name: gold
driverName: csi.storage.example.com
parameters:
iops: "4000"
throughput: "60Mi"
A claim names one in spec.volumeAttributesClassName. At creation the provisioner passes its parameters to the driver with the rest of the request. Unlike almost everything else in a bound claim’s spec, the field is mutable: the API server allows only resources.requests and volumeAttributesClassName to change. Changing it makes the external-resizer call the driver’s ControllerModifyVolume, and the live volume changes in place, with the same PersistentVolume and no data copy:
kubectl patch pvc orders-db -n shop -p '{"spec":{"volumeAttributesClassName":"gold"}}'
The claim reports progress in its status. status.currentVolumeAttributesClassName names the class the volume actually has, and status.modifyVolumeStatus describes a change in flight. If the named class does not exist yet, the modification is Pending until it does. If the driver rejects the parameters, it is Infeasible; setting the field back to its previous value, including unset, cancels the change. The claim stays Bound throughout. A class’s parameters are immutable, so to change settings again, create another class and switch to it. kubectl get pvc shows the requested class in the VOLUMEATTRIBUTESCLASS column, <unset> when there is none.
VolumeAttributesClass works only where the CSI driver implements the ModifyVolume API. Parameters a class omits fall back to the driver’s defaults, which vary between drivers.
Consistency
A storage snapshot is crash-consistentHolding exactly what a sudden power loss would leave: every write the storage acknowledged, and nothing that was still in memory.. It records what the storage had acknowledged at one instant. Anything still in the application’s memory, in a database’s buffer pool or in the page cache waiting to be flushed is not in it. Restoring is equivalent to pulling the power cord and booting again.
What that protects:
- Deleted or overwritten data, as of the snapshot time.
- A failed migration or upgrade, if you snapshot right before it.
- A volume whose storage system lost it, as long as the snapshot is kept somewhere else.
What it does not:
- Application-level consistency. Databases designed to survive power loss replay their logs on start, but software that is not may not start from the copy at all.
- Consistency across volumes, unless they are taken as one group snapshot.
- Anything outside the volume: the Kubernetes objects, Secrets, and external services the application depends on.
- A disaster that takes out the storage system or the region holding the snapshots, unless they are copied elsewhere.
For application-consistent copies, quiesce first: have the database flush and pause writes, or freeze the file system, take the snapshot, then resume. Many teams use the database’s own backup tooling instead, such as logical dumps or continuous log archiving, and treat volume snapshots as the fast path for whole-volume recovery. Either way, a backup that has never been restored is a hypothesis: restore into a scratch namespace on a schedule.
kubectl --context kind-kx api-resources --api-group=snapshot.storage.k8s.iokubectl --context kind-kx kustomize 'https://github.com/kubernetes-csi/external-snapshotter/client/config/crd?ref=v8.7.0' | kubectl --context kind-kx create -f -kubectl --context kind-kx kustomize 'https://github.com/kubernetes-csi/external-snapshotter/deploy/kubernetes/snapshot-controller?ref=v8.7.0' | kubectl --context kind-kx create -f -kubectl --context kind-kx -n kube-system rollout status deployment/snapshot-controllerkubectl --context kind-kx api-resources --api-group=snapshot.storage.k8s.iokubectl --context kind-kx api-resources --api-group=groupsnapshot.storage.k8s.iokubectl --context kind-kx get csidriverskubectl --context kind-kx explain volumesnapshot.spec.source
For your own kind cluster kx: copy a command and paste it into your terminal. Run in the simulator runs the same command in this page's simulated cluster instead; nothing on this page touches your machine. The CRDs and controller install from the external-snapshotter v8.7.0 tag. kind ships no CSI driver, so get csidrivers lists none and nothing can be snapshotted yet; deploying the CSI hostpath driver adds one that supports snapshots and clones. Remove the controller and CRDs by running the same kustomize commands piped to kubectl --context kind-kx delete -f -.
Actual state
Check your understanding
Your first answer to each check is the one that counts. After a miss you can answer again; passing every check reconciles the lesson.
Lesson not yet reconciled
Desired: 5 objectives, 0 metReconciled: 5 of 5 objectives met
- Take a VolumeSnapshot and restore it into a PersistentVolumeClaim with dataSource. (not yet met)
- Clone a claim within a namespace and state the rules a clone must follow. (not yet met)
- Explain what the snapshot controller, its CRDs and the CSI driver's sidecar each do. (not yet met)
- Change a live volume's IOPS or throughput with a VolumeAttributesClass, GA in Kubernetes 1.34. (not yet met)
- Explain what a crash-consistent snapshot protects and what it does not. (not yet met)
Pass every check above to reconcile this lesson.
Every check has passed, so the desired state is met. First-try accuracy: 0 of 5. This lesson's review cards are in your queue.
Practice
Put this lesson to work on the simulated cluster. Everything runs in your browser, with nothing to install.
Changed since the notes
This lesson draws on an earlier set of study notes. Where the documentation contradicts a claim in them, qualifies it or has moved past it, the claim is listed here with the corrected statement and the source it was checked against.
Show 17 corrections
The notes saidDefault StorageClass 'marked with an annotation' makes simple PVCs work without choosing storage
CorrectedKubernetes behaviour is unchanged, but EKS clusters created on 1.30 or later ship the gp2 StorageClass without the storageclass.kubernetes.io/is-default-class annotation (upgraded clusters keep it), and EKS Auto Mode creates no StorageClass at all. A PVC without storageClassName stays Pending until you annotate a class as default, for example a gp3 class with provisioner ebs.csi.aws.com (add-on) or ebs.csi.eks.amazonaws.com (Auto Mode). The EBS CSI chart/add-on exposes defaultStorageClass.enabled (false by default). The AWS 1.30 release note itself rolled off the docs when 1.30 left support; the linked secondary sources record it.
The notes saidEFS throughput 'bursting (throughput scales with size) and provisioned'
CorrectedEFS has three throughput modes: Elastic (the recommended default for new file systems; scales automatically, billed per data read/written), Provisioned and Bursting. Switching to Provisioned or changing the amount locks some changes for 24 hours.
Sourcedocs.aws.amazon.com/efs/latest/ug/performance.html#throughput-modes
The notes said'Installing the EBS CSI Driver is required for EBS-backed PVCs… EKS add-on management simplifies installation'
CorrectedRequired on non-Auto Mode clusters (EKS add-on aws-ebs-csi-driver; driver latest v1.68.1). EKS Auto Mode includes block storage and does not need the add-on; its provisioner is ebs.csi.eks.amazonaws.com and you must create the StorageClass yourself. The add-on supports EKS Pod Identity from v1.26.0-eksbuild.1 as well as IRSA. IAM policy choices: AmazonEBSCSIDriverPolicyV2 (tag-based scoping), AmazonEBSCSIDriverEKSClusterScopedPolicy (cluster-scoped), or AmazonEBSCSIDriverPolicy (no tag restrictions).
The notes saidChanging EBS performance requires new StorageClass/volumes
CorrectedVolumeAttributesClass is GA in Kubernetes 1.34 (locked on from 1.36). The EBS CSI driver implements ControllerModifyVolume (since driver v1.19.0), so changing a bound PVC's volumeAttributesClassName modifies type, IOPS or throughput of the live volume with no new StorageClass or data copy. EKS Auto Mode docs describe migrating from the deprecated annotation-based volume-modifier-for-k8s to VolumeAttributesClass. EBS Elastic Volumes limits still apply.
The notes saidReadWriteOncePod access mode
CorrectedState the qualifiers: ReadWriteOncePod is GA since Kubernetes 1.29 (feature gate removed 1.31) and works only with CSI volumes; the scheduler enforces single-pod use. The EBS CSI driver supports it.
Sourcekubernetes.io/docs/concepts/storage/persistent-volumes#access-modes
The notes said'For EBS, expansion requires stopping I/O briefly while the filesystem is resized'
CorrectedEBS Elastic Volumes resize attached volumes online, and Kubernetes performs online filesystem expansion (ext4/xfs) while the pod runs; no I/O stop is needed. Note that the 'one modification per volume per 6 hours' rule in the suspected correction is itself stale: since 2026-01-15 EBS allows up to four modifications per volume in a rolling 24-hour window, and the EBS limitations list no longer carries the 6-hour wait.
The notes said'EBS volumes can only attach to one instance at a time, so they support only ReadWriteOnce'
CorrectedA simplification. io1/io2 volumes support Multi-Attach within one AZ, and the EBS CSI driver exposes it as ReadWriteMany for volumeMode: Block only (not filesystem mode); the application must coordinate writes (I/O fencing) to avoid corruption. ReadWriteOncePod is also supported. Shared filesystem RWX belongs to EFS.
The notes said'Pods stuck waiting for volume attachment often indicate zone mismatches'
CorrectedA zone mismatch surfaces at scheduling: the pod stays Pending with a 'volume node affinity conflict' event, and volumeBindingMode: WaitForFirstConsumer avoids it by provisioning in the pod's zone. Pods stuck in ContainerCreating waiting for attachment usually point to a Multi-Attach error (volume still attached to another node), a slow detach, or the node's EBS attachment limit.
Sourcekubernetes.io/docs/concepts/storage/storage-classes#volume-binding-mode
The notes said'Access modes are capabilities, not restrictions'
CorrectedPartly right: Kubernetes uses access modes to match PVCs to PVs and they do not enforce write protection once mounted. But ReadWriteOncePod is enforced (one pod cluster-wide), and ReadWriteOnce on attachable block storage such as EBS is effectively constrained to one node at attach time (Multi-Attach error).
Sourcekubernetes.io/docs/concepts/storage/persistent-volumes#access-modes
The notes saidvelero install --plugins velero/velero-plugin-for-aws:v1.7.0
CorrectedVelero v1.18.4 is the most recent stable release as of 2026-11-19 (v1.19 in release candidate) and pairs with velero-plugin-for-aws v1.14.x (plugin 1.13 pairs with Velero 1.17). File-system backup uses Kopia (the default uploader since Velero 1.12). Velero 1.17 removed Restic as a backup path, and restoring existing Restic backups is supported until v1.19.
Sourcegithub.com/vmware-tanzu/velero-plugin-for-aws%20;%20https://velero.io/blog/velero-1.17
The notes saidIn EKS … focus on backing up your resources (Velero)
CorrectedAWS Backup also backs up EKS clusters natively. It creates a composite recovery point holding the cluster state (Kubernetes manifests) and the persistent volumes (EBS, EFS, S3), and requires the cluster's authentication mode to be API or API_AND_CONFIG_MAP. Velero remains an option.
Sourcedocs.aws.amazon.com/aws-backup/latest/devguide/eks-backups.html
The notes saidExternal Secrets Operator usage / apiVersion: external-secrets.io/v1beta1 (grouped: notes 44, 45 and 53)
CorrectedESO's stable API is external-secrets.io/v1. ESO v0.17.0 (May 2025) stopped serving v1beta1, so v1beta1 ExternalSecret and SecretStore manifests are rejected by current releases (v2.15.0 is the most recent as of 2026-11-19). Change apiVersion to external-secrets.io/v1 in notes 44, 45 and 53.
Sourcegithub.com/external-secrets/external-secrets/releases/tag/v0.17.0
The notes saidS3 lifecycle StorageClass GLACIER / Glacier Deep Archive naming
CorrectedIn lifecycle rules, StorageClass GLACIER is the API name for S3 Glacier Flexible Retrieval (90-day minimum storage duration) and DEEP_ARCHIVE is S3 Glacier Deep Archive (180-day minimum). GLACIER_IR (Glacier Instant Retrieval) is a third option.
Sourcedocs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-transition-general-considerations.html
The notes saidDR tiers omit 'Backup & Restore' and equate 'passive DR' with pilot light
CorrectedConfirmed. AWS's DR whitepaper lists four strategies: backup and restore, pilot light, warm standby, and multi-site active/active. Backup and restore, pilot light and warm standby are all active/passive, so passive DR isn't a synonym for pilot light.
The notes saidECR replication registryId '123456789' is not a valid 12-digit account ID
CorrectedConfirmed. ReplicationDestination.registryId must match [0-9]{12}; use a 12-digit placeholder such as 123456789012.
Sourcedocs.aws.amazon.com/AmazonECR/latest/APIReference/API_ReplicationDestination.html
The notes said'Load balancers are regional and multi-AZ by default'
CorrectedConfirmed. An ALB requires subnets in at least two AZs, but an NLB can be enabled in one or more AZs (one subnet each), so its AZ coverage is whatever subnets you give it, and cross-zone load balancing is off by default for NLBs.
The notes saidVelero is installed with static IAM keys (--secret-file ./credentials-velero) rather than IRSA/Pod Identity
CorrectedConfirmed as a best-practice gap. The plugin README documents IAM-user keys and kube2iam (install with --no-secret), while EKS best practices recommend EKS Pod Identity, or IRSA, for pod credentials instead of long-lived keys. Use a role for the velero ServiceAccount and install with --no-secret.
Every correction across the guide, by note and topic.
Sources
Checked against kubernetes.io and AWS documentation for Kubernetes 1.37 on .
- kubernetes.io/docs/concepts/storage/volume-snapshots
- kubernetes.io/docs/concepts/storage/volume-snapshot-classes
- kubernetes.io/docs/concepts/storage/persistent-volumes
- kubernetes.io/docs/concepts/storage/volume-pvc-datasource
- kubernetes.io/docs/concepts/storage/volume-attributes-classes
- kubernetes.io/blog/2026/05/08/kubernetes-v1-36-volume-group-snapshot-ga
- github.com/kubernetes-csi/external-snapshotter
- docs.aws.amazon.com/eks/latest/userguide/csi-snapshot-controller.html
- docs.aws.amazon.com/eks/latest/userguide/create-storage-class.html
- github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/docs/modify-volume.md
- docs.aws.amazon.com/ebs/latest/userguide/ebs-modify-volume.html
- docs.aws.amazon.com/aws-backup/latest/devguide/eks-backups.html
- github.com/vmware-tanzu/velero-plugin-for-aws
- velero.io/blog/velero-1.17
- docs.aws.amazon.com/eks/latest/best-practices/identity-and-access-management.html
- docs.aws.amazon.com/whitepapers/latest/disaster-recovery-workloads-on-aws/disaster-recovery-options-in-the-cloud.html
- docs.aws.amazon.com/ebs/latest/userguide/ebs-snapshots.html
- docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-transition-general-considerations.html
- docs.aws.amazon.com/AmazonECR/latest/APIReference/API_ReplicationDestination.html
- github.com/external-secrets/external-secrets/releases/tag/v0.17.0
- docs.aws.amazon.com/elasticloadbalancing/latest/network/availability-zones.html
Snapshots, clones and volume attributes
↓ ↑ step, 1 to 7 scene, Esc leave