Create a Volume Snapshot
Learn how to create point-in-time snapshots of WEKA Kubernetes volumes using the CSI snapshot capability.
Create point-in-time, application-consistent snapshots of WEKA persistent volumes using the Container Storage Interface (CSI) snapshot capability. Snapshots enable zero-copy cloning and rapid rollbacks without downtime.
For example manifests of dynamic snapshot, see the csi-wekafs repository.
Procedure overview
1
Confirm the snapshot controller is running
Kubernetes orchestrator (Kubeadm, GKE, OpenShift)
2
Confirm snapshot CRDs exist
Kubernetes orchestrator (Kubeadm, GKE, OpenShift)
3
Create a VolumeSnapshotClass
WEKA admin
4
Provision a volume and workload
WEKA admin
5
Create a snapshot
WEKA admin
6
Create a new volume from the snapshot
WEKA admin
Before you begin
Confirm the following prerequisites are in place:
Kubernetes v1.20 or newer.
CSI external-snapshot controller and Volume snapshot Custom Resource Definitions (CRDs) are deployed on the Kubernetes cluster. Your Kubernetes orchestrator manages these components.
A StorageClass for a Filesystem-backed volume or a Snapshot-backed volume. For sample manifests, see Filesystem-backed storageClass and Snapshot-backed storageClass.
Procedure
1. Confirm the snapshot controller is running
Verify that at least one snapshot-controller deployment is in Running state. It is typically deployed in the kube-system or csi-snapshotter namespace.
Example output:
If the command returns no results, deploy the external snapshot controller. For instructions, see external-snapshotter usage.
2. Confirm snapshot CRDs exist
Verify that the required volume snapshot CRDs exist in your Kubernetes cluster.
Example output:
If the command returns no results, create the CRDs. For instructions, see external-snapshotter usage.
3. Create a VolumeSnapshotClass
A VolumeSnapshotClass is required before you can create snapshots.
Check whether a WEKA VolumeSnapshotClass already exists:
If no resources are found, create one using the following manifest. For a ready-made example, see snapshotclass-csi-wekafs.yaml.
Apply the manifest:
Example output:
4. Provision a volume and workload
Create a filesystem-backed persistent volume and write data to it.
Apply the following manifest to create a Pod that writes a timestamp to the volume every 10 seconds:
Confirm that the Pod is writing data to the volume:
Example output:
5. Create a snapshot
Create a VolumeSnapshot for the persistent volume claim.
Apply the following manifest:
Confirm the snapshot is available and ready to use:
Example output:
6. Create a new volume from the snapshot
Restore data from the snapshot by provisioning a new persistent volume with the snapshot as its data source.
Apply the following manifest:
Attach a Pod to the new volume:
Confirm the new volume contains the data captured at snapshot time:
Example output:
The source volume contains additional entries written after the snapshot was taken:
Example output:
Last updated