Backing up persistent volumes with CSI snapshots

You back up persistent volumes with Container Storage Interface (CSI) snapshots by editing the VolumeSnapshotClass custom resource (CR) of the cloud storage before you create the Backup CR, see CSI volume snapshots.

For more information see Creating a Backup CR.

Prerequisites

  • The cloud provider must support CSI snapshots.

  • You must enable CSI in the DataProtectionApplication CR.

Procedure

  • Add the metadata.labels.velero.io/csi-volumesnapshot-class: "true" key-value pair to the VolumeSnapshotClass CR:

    1. apiVersion: snapshot.storage.k8s.io/v1
    2. kind: VolumeSnapshotClass
    3. metadata:
    4. name: <volume_snapshot_class_name>
    5. labels:
    6. velero.io/csi-volumesnapshot-class: "true"
    7. driver: <csi_driver>
    8. deletionPolicy: Retain

You can now create a Backup CR.