Add VolumeSnapshotClass for use with CSI plug-in
Purpose
The Velero CSI plugin for Velero uses a VolumeSnapshotClass with the proper annotations to create snapshots of PVCs using the CSI StorageClass driver. Currently the creation of this VolumeSnapshotClass isn't included in this package chart, which means the CSI plugin does not successfully create snapshots for PVCs using the CSI StorageClass driver.
Relavant logs
time="2021-08-30T23:52:16Z" level=info msg="Starting PVCBackupItemAction" backup=velero/gitlab-test-4 cmd=/plugins/velero-plugin-for-csi logSource="/go/src/velero-plugin-for-csi/internal/backup/pvc_action.go:58" pluginName=velero-plugin-for-csi
time="2021-08-30T23:52:16Z" level=info msg="Fetching storage class for PV awsebscsiprovisioner" backup=velero/gitlab-test-4 cmd=/plugins/velero-plugin-for-csi logSource="/go/src/velero-plugin-for-csi/internal/backup/pvc_action.go:102" pluginName=velero-plugin-for-csi
time="2021-08-30T23:52:16Z" level=info msg="1 errors encountered backup up item" backup=velero/gitlab-test-4 logSource="pkg/backup/backup.go:427" name=repo-data-gitlab-gitaly-0
time="2021-08-30T23:52:16Z" level=error msg="Error backing up item" backup=velero/gitlab-test-4 error="error executing custom action (groupResource=persistentvolumeclaims, namespace=gitlab, name=repo-data-gitlab-gitaly-0): rpc error: code = Unknown desc = failed to get volumesnapshotclass for storageclass awsebscsiprovisioner: failed to get volumesnapshotclass for provisioner ebs.csi.aws.com, ensure that the desired volumesnapshot class has the velero.io/csi-volumesnapshot-class label" error.file="/github.com/vmware-tanzu/velero/pkg/backup/item_backupper.go:331" error.function="github.com/vmware-tanzu/velero/pkg/backup.(*itemBackupper).executeActions" logSource="pkg/backup/backup.go:431" name=repo-data-gitlab-gitaly-0
Proposed Solution
The following VolumeSnapshotClass will resolve the above error once created.
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshotClass
metadata:
name: csi-volumesnapshotclass
annotations:
# Optional annotation to set this VolumeSnapshotClass as default
snapshot.storage.kubernetes.io/is-default-class: "true"
labels:
# Required label for Velero
velero.io/csi-volumesnapshot-class: "true"
driver: ebs.csi.aws.com
deletionPolicy: Delete
We should be adding this VolumeSnapshotClass in the event that .Values.addons.velero.plugins
contains csi
.