Skip to content

Commit bb74d14

Browse files
committed
Addressed review comments
- Add description on "ReferenceGrant API change" in "Risks and Mitigations" section and mark it a beta blocker - Allow not specifying namespace in `VolumeSnapshotLink` and provisioning from it without `ReferenceGrant` - Clearly describe that `ReferenceGrant` check continues until it is found - Add description on core API change to allow specifying namespace in "Alternatives" section
1 parent 0be0ea7 commit bb74d14

File tree

1 file changed

+38
-11
lines changed
  • keps/sig-storage/3294-provision-volumes-from-cross-namespace-snapshots

1 file changed

+38
-11
lines changed

keps/sig-storage/3294-provision-volumes-from-cross-namespace-snapshots/README.md

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ tags, and then generate with `hack/update-toc.sh`.
9292
- [<code>Secret</code> Handling](#-handling)
9393
- [Security](#security)
9494
- [Conflict on installing <code>VolumePopulator</code> CR for <code>VolumeSnapshotLink</code> across CSI drivers](#conflict-on-installing--cr-for--across-csi-drivers)
95+
- [ReferenceGrant API change](#referencegrant-api-change)
9596
- [Design Details](#design-details)
9697
- [Example flow of how this proposal works](#example-flow-of-how-this-proposal-works)
9798
- [API](#api)
@@ -320,6 +321,14 @@ As a result, there may be a conflict in creating it for each driver, if there ar
320321
To avoid this issue, it should be avoided to manage `VolumePopulator` CR for `VolumeSnapshotLink` in each CSI driver's repository.
321322
It should be managed in another single repository and the same CR should be used per cluster basis.
322323

324+
#### ReferenceGrant API change
325+
326+
Currently, `ReferenceGrant` exists in `gateway.networking.k8s.io` API, so users may be confused by using networking API for storage purpose.
327+
To avoid it, `ReferenceGrant` is planned to be moved to more generic place.
328+
As a result, `ReferenceGrant` API will be changed in the future, so `VolumeSnapshotLink` API will also need to be changed.
329+
330+
Changes in `VolumeSnapshotLink` API related to `ReferenceGrant` API changes will be a beta blocker.
331+
323332
## Design Details
324333

325334
<!--
@@ -420,6 +429,9 @@ type VolumeSnapshotLinkSpec struct {
420429
// VolumeSnapshotLinkSource specifies a reference to VolumeSnapshot.
421430
type VolumeSnapshotLinkSource struct {
422431
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
432+
// Namespace is the namespace of the snapshot. When unspecified, the local namespace is inferred.
433+
// Note that when a namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.
434+
// +optional
423435
Namespace string `json:"namespace" protobuf:"bytes,2,opt,name=namespace"`
424436
}
425437
```
@@ -448,10 +460,14 @@ sourceKind:
448460
#### (a) inside the existing CSI external-provisioner
449461
450462
Once populator is implemented inside the existing CSI external-provisioner, the CSI external provisioner:
451-
- Handles `VolumeSnapshotLink` CRD and `ReferenceGrant` CRD,
452-
- Checks if `VolumeSnapshotLink` is specified as `DataSourceRef`:
453-
- If specified, check if the access to the `VolumeSnapshot` referenced by the `VolumeSnapshotLink` is allowed by any `ReferenceGrant`s:
454-
- If allowed, use the `VolumeSnapshot` as a SnapshotSource to pass to the CSI driver for provision.
463+
1. Handles `VolumeSnapshotLink` CRD and `ReferenceGrant` CRD,
464+
2. Datasource is handled in the below reconciler loop:
465+
- If `VolumeSnapshotLink` isn't specified as `DataSourceRef`: Do the existing provisioner behavior.
466+
- Otherwise:
467+
- If namespace isn't specified in `VolumeSnapshotLink`: use the `VolumeSnapshot` referenced by the `VolumeSnapshotLink` as a SnapshotSource to pass to the CSI driver for provision.
468+
- Otherwise:
469+
- If the access to the `VolumeSnapshot` referenced by the `VolumeSnapshotLink` is allowed by any `ReferenceGrant`s: Use the `VolumeSnapshot` as a SnapshotSource to pass to the CSI driver for provision.
470+
- Otherwise: Do nothing (the `ReferenceGrant` check above will be repeated in the loop).
455471

456472
To enable this feature in CSI external provisioner, `--cross-namespace-snapshot=true`
457473
command line flag needs to be passed to the provisioner for each CSI plugin.
@@ -494,15 +510,19 @@ However, this behavior may be changed and provisioners may offload provisioning
494510
The implementation of provisioner and populator of this approach will be as follows:
495511

496512
- Provisioner:
497-
- Handles `VolumeSnapshotLink` CRD,
498-
- Checks if `VolumeSnapshotLink` is specified as `DataSourceRef`:
499-
- If specified, skip provisioning the volume
513+
1. Handles `VolumeSnapshotLink` CRD,
514+
2. Checks if `VolumeSnapshotLink` is specified as `DataSourceRef`:
515+
- If specified, skip provisioning the volume
500516

501517
- Populator:
502-
- Handles `VolumeSnapshotLink` CRD and `ReferenceGrant` CRD,
503-
- Checks if `VolumeSnapshotLink` is specified as `DataSourceRef`:
504-
- If specified, check if the access to the `VolumeSnapshot` referenced by the `VolumeSnapshotLink` is allowed by any `ReferenceGrant`s:
505-
- If allowed, use the `VolumeSnapshot` as a SnapshotSource to pass to the CSI driver for provision.
518+
1. Handles `VolumeSnapshotLink` CRD and `ReferenceGrant` CRD,
519+
2. Datasource is handled in the below reconciler loop:
520+
- If `VolumeSnapshotLink` isn't specified as `DataSourceRef`: Skip handling the Datasource.
521+
- Otherwise:
522+
- If namespace isn't specified in `VolumeSnapshotLink`: use the `VolumeSnapshot` referenced by the `VolumeSnapshotLink` as a SnapshotSource to pass to the CSI driver for provision.
523+
- Otherwise:
524+
- If the access to the `VolumeSnapshot` referenced by the `VolumeSnapshotLink` is allowed by any `ReferenceGrant`s: Use the `VolumeSnapshot` as a SnapshotSource to pass to the CSI driver for provision.
525+
- Otherwise: Do nothing (the `ReferenceGrant` check above will be repeated in the loop).
506526

507527
The above implementation is just separating the logics in approach (a) to two components, and it won't help improve efficiency nor simplify implementations.
508528
Therefore, the description in this section is just for discussion purpose and won't be implemented.
@@ -1096,6 +1116,13 @@ information to express the idea and why it was not acceptable.
10961116
- Need to handle [race conditions](https://github.com/kubernetes/enhancements/pull/2849#discussion_r682057570)
10971117
- Need to consider [referenced Secrets](https://github.com/kubernetes/enhancements/pull/2849#discussion_r692459041) from snapshot after transferred
10981118

1119+
- Change `PersistentVolumeClaimSpec` in core API to take namespace as a data source, instead of introducing a new `VolumeSnapshotLink` API:
1120+
- Pros:
1121+
- Can provide a simple API, which will provide a better UX
1122+
- Cons:
1123+
- Requires a core API change
1124+
- Needs to handle compatibility issues
1125+
10991126
## Infrastructure Needed (Optional)
11001127

11011128
<!--

0 commit comments

Comments
 (0)