--- # Longhorn VolumeSnapshotClass — the CSI snapshot recipe for driver.longhorn.io. # # CONSUMES the snapshot.storage.k8s.io CRD registered by platform/external-snapshotter (controllers # pass), so — like the KubeVirt/CDI CRs — this CR is applied by the `platform-config` Flux # Kustomization (dependsOn: platform), not in the controllers pass. It lives HERE beside the Longhorn # component for locality and is referenced in place from platform-config/kustomization.yaml. # # WHY: this is what turns "Longhorn has a CSI driver" into "the cluster can take CSI VolumeSnapshots # of Longhorn PVCs". CDI's snapshot smart-clone (cdi-storageprofiles.yaml -> cloneStrategy: snapshot) # resolves the driver's VolumeSnapshotClass by matching driver name; this is the only one for # driver.longhorn.io, so CDI selects it unambiguously (no is-default-class annotation needed). # # type: snap -> an in-cluster Longhorn snapshot on the volume's own replicas (fast, no external # backupstore required). The alternative `type: bak` uploads to a backup target, which # is not configured until Phase 4 (Velero/backupTarget). Clone/restore stay in-cluster. # deletionPolicy: Delete -> when the VolumeSnapshot is deleted, its Longhorn snapshot is cleaned up. # CDI's clone snapshots are transient, so leaking them would waste replica space. apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshotClass metadata: name: longhorn labels: app.kubernetes.io/part-of: longhorn driver: driver.longhorn.io deletionPolicy: Delete parameters: type: snap