Velero with Longhorn CSI snapshot support #7909
-
We are currently using Velero's Container Storage Interface (CSI) snapshot support and it's CSI volume data movement feature. connected to Longhorn storage which supports CSI snapshots. The issue we face is that the backups use a lot of disk space, as Longhorn replicates the data of each snapshot the same way it does for all of our Kubernetes volumes. Moreover it retains these volumes, as it's the default behaviour of our storage class, so volumes created during backups are never deleted even if the backup has expired and no longer exists. We are looking for a way to remove the volumes created by the snapshots after the backup is deleted: is there a way to specify a different storage class for Velero's backup (we could create one with a Delete reclaim policy instead of a Retain one) or another way to solve this issue and delete the volumes from expired backups? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You need to provide a VolumeSnapshotClass with a special parameter so longhorn can decide its a "longhorn-backup" or "longhorn-snapshot" - both can be snapshotted via CSI but backups will remain, while snapshots will be deleted. Detailed explanation volumesnapshotclass.yaml kind: VolumeSnapshotClass
apiVersion: snapshot.storage.k8s.io/v1
metadata:
name: longhorn-backup-vsc
labels:
velero.io/csi-volumesnapshot-class: "true"
driver: driver.longhorn.io
deletionPolicy: Delete
parameters:
type: snap |
Beta Was this translation helpful? Give feedback.
-
Users have several choices when selecting VolumeSnapshotClass in the Velero CSI backup. |
Beta Was this translation helpful? Give feedback.
Users have several choices when selecting VolumeSnapshotClass in the Velero CSI backup.
Please check this document for details:
https://velero.io/docs/v1.14/csi/#implementation-choices