VSC-only snapshot model in snapshot-controller and csi-snapshotter#27
Open
duckhawk wants to merge 1 commit into
Open
VSC-only snapshot model in snapshot-controller and csi-snapshotter#27duckhawk wants to merge 1 commit into
duckhawk wants to merge 1 commit into
Conversation
Add support for a VSC-only snapshot model in snapshot-controller and
the csi-snapshotter sidecar shipped by storage-foundation.
VolumeSnapshotContent objects can now be created and reconciled
without a corresponding VolumeSnapshot. This enables internal Deckhouse
controllers (e.g. storage-foundation VCR/VRR) to drive CSI snapshot
and restore operations via service-level APIs without exposing
VolumeSnapshot resources to user namespaces.
Changes:
- crds/snapshot.storage.k8s.io_volumesnapshotcontents.yaml:
spec.volumeSnapshotRef is no longer in 'required' and its
x-kubernetes-validations rule allows the field to be completely
empty (VSC-only) while keeping the legacy name+namespace constraint
when it is set.
- doc-ru CRD updated to match.
- images/snapshot-controller/patches/003-vsc-only-model.patch and
images/csi-external-snapshotter/patches/v8.5.0/003-vsc-only-model.patch:
patch external-snapshotter v8.5.0 so that common-controller and the
csi-snapshotter sidecar:
* reconcile VSCs with empty volumeSnapshotRef as VSC-only,
* derive CSI snapshot identity from VolumeSnapshotContent.UID when
volumeSnapshotRef.UID is empty,
* perform CreateSnapshot / DeleteSnapshot for VSC-only objects,
* keep the existing finalizer and deletion semantics,
* preserve full backward compatibility for VSCs that still carry
volumeSnapshotRef.
- patches/README.md files updated to describe the new patch.
The change does not trigger restarts of control-plane components,
ingress controllers, or other critical cluster services.
Mirrors deckhouse/snapshot-controller#34.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for a VSC-only snapshot model in the snapshot-controller and the
csi-snapshotterexternal-snapshotter sidecar shipped bystorage-foundation.With this change,
VolumeSnapshotContentobjects can be created and processed withouta corresponding
VolumeSnapshot. This enables internal controllers (e.g. storage-foundationVCR/VRR) to perform CSI snapshot and restore operations using service-level APIs without
exposing
VolumeSnapshotresources to user namespaces.The implementation is backward-compatible and preserves existing behavior for legacy
VolumeSnapshot-based workflows.This change does not trigger restarts of control-plane components, ingress controllers,
or other critical cluster services.
This PR mirrors deckhouse/snapshot-controller#34 in the storage-foundation module.
Why do we need it, and what problem does it solve?
Some internal Deckhouse components (virtualization, managed services, backup infrastructure)
require the ability to:
without creating
VolumeSnapshotor temporary PVC objects in user namespaces.The standard CSI snapshot workflow enforces a strict
VolumeSnapshot ↔ VolumeSnapshotContentbinding, which makes it unsuitable for service-level, short-lived operations where:
This PR removes the hard requirement for
VolumeSnapshotRefinVolumeSnapshotContentand allows the controller and sidecar to work directly with VSC as the source of truth,
enabling a clean, secure, and minimal service workflow.
What is the expected result?
After applying these changes:
VolumeSnapshotContentcan be created without `spec.volumeSnapshotRef`.`volumeSnapshotRef` in `required`, and its `x-kubernetes-validations` rule allows
the field to be entirely empty (VSC-only) while keeping the legacy name+namespace
constraint when it is set.
`VolumeSnapshot` exists.
Correctness can be verified by:
Implementation notes
The Go-side changes are delivered as a single patch applied to upstream
`kubernetes-csi/external-snapshotter` v8.5.0:
Both image patch directories ship the identical patch so that the
`snapshot-controller` and `csi-snapshotter` binaries are built from
the same source tree.
The patch touches:
finalizer handling, legacy fallback when `volumeSnapshotRef` is set.
`volumeSnapshotRef.UID` is empty when generating the CSI snapshot name.
`syncContent` and `shouldDelete`, extra logging.
`DeletionTimestamp` time-precision in equality checks.
legacy paths.
The patch was verified by:
001/002 CVE patches);
Checklist