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.

Snapshot functionality is not available for Directory-backed volumes by default. A snapshot of a Directory-backed volume creates a snapshot of the entire filesystem on which the directory resides.

Procedure overview

Step
Action
Responsibility

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:

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.

  1. Check whether a WEKA VolumeSnapshotClass already exists:

  2. If no resources are found, create one using the following manifest. For a ready-made example, see snapshotclass-csi-wekafs.yaml.

  3. Apply the manifest:

    Example output:

4. Provision a volume and workload

Create a filesystem-backed persistent volume and write data to it.

  1. Apply the following manifest to create a Pod that writes a timestamp to the volume every 10 seconds:

  2. Confirm that the Pod is writing data to the volume:

    Example output:

5. Create a snapshot

Create a VolumeSnapshot for the persistent volume claim.

  1. Apply the following manifest:

  2. 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.

  1. Apply the following manifest:

  2. Attach a Pod to the new volume:

  3. 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