helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

Add an option for creating VolumeSnapshotClass for velero chart

Open janaurka opened this issue 2 years ago • 3 comments

Describe the problem/challenge you have Currently the velero helm-chart does not have the ability to create volumesnapshotclass, which is required to take a backup/snapshot of a PVC.

An example volumesnapshotclass for an AKS cluster which (mostly) comes with the Azure CNI pre-installed:

---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
  name: csi-azuredisk-vsc
  labels:
    velero.io/csi-volumesnapshot-class: "true" 
driver: disk.csi.azure.com
deletionPolicy: Delete
parameters:
  incremental: "true"  # available values: "true", "false" ("true" by default for Azure Public Cloud, and "false" by default for Azure Stack Cloud)

Source -> without the required velero.io/csi-volumesnapshot-class: "true" label.

Describe the solution you'd like Add a feature to the helm chart, which allows creating VolumeSnapshotClasses like:

createVolumeSnapshotClass: enabled # defaults to disabled
volumeSnapshotClasses:
  - name: csi-azuredisk-vsc
    driver: disk.csi.azure.com
    deletionPolicy: Delete
    parameters:
      - incremental: true
    additionalLabels: # velero.io/csi-volumesnapshot-class: "true" should always be added 
      - label1: true
      - label2: test

Anything else you would like to add: Basically this could also be done during the CSI driver installation, though the velero label is required, so this would be a cool feature for the velero chart, if the csi driver does not support creating a VolumeSnapshotClass and would ease things for operators who want to use velero for snapshotting PVCs.

Note: I would be willing to add this feature to the helm-chart, but I first like to have a positive feedback, if this is considered a potentially merge able feature request.

janaurka avatar Jan 30 '23 13:01 janaurka

@janaurka

  • Is your case, how are the snapshot CRD and the snapshot controller installed in the cluster?
  • Is there any open helm chart that support creating the VolumeSnapshotClass?

jenting avatar Jan 31 '23 02:01 jenting

@jenting

  • Is your case, how are the snapshot CRD and the snapshot controller installed in the cluster?

In AKS, the snapshot controller can be enabled for example via terraform using snapshot_controller_enabled attribute and the CRD volumesnapshotclasses.snapshot.storage.k8s.io is available afterward. however, a snapshot class is required to complete the snapshots for the disks. Hence it may be a good idea to ship the optional configuration for VolumeSnapshotClass in the velero helm chart as this is a manual step for now.

ishuar avatar Dec 06 '23 00:12 ishuar

Personally I don't think Velero helm chart should involve the life cycle management of the volume snapshot CRDs.

Instead, consider create your own chart which depends on the Velero helm chart and volume snapshot helm chart.

jenting avatar Dec 06 '23 04:12 jenting