You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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
Copy file name to clipboardExpand all lines: keps/sig-storage/3294-provision-volumes-from-cross-namespace-snapshots/README.md
+38-11Lines changed: 38 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,7 @@ tags, and then generate with `hack/update-toc.sh`.
92
92
-[<code>Secret</code> Handling](#-handling)
93
93
-[Security](#security)
94
94
-[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)
95
96
-[Design Details](#design-details)
96
97
-[Example flow of how this proposal works](#example-flow-of-how-this-proposal-works)
97
98
-[API](#api)
@@ -320,6 +321,14 @@ As a result, there may be a conflict in creating it for each driver, if there ar
320
321
To avoid this issue, it should be avoided to manage `VolumePopulator` CR for `VolumeSnapshotLink` in each CSI driver's repository.
321
322
It should be managed in another single repository and the same CR should be used per cluster basis.
322
323
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
+
323
332
## Design Details
324
333
325
334
<!--
@@ -420,6 +429,9 @@ type VolumeSnapshotLinkSpec struct {
420
429
// VolumeSnapshotLinkSource specifies a reference to VolumeSnapshot.
421
430
type VolumeSnapshotLinkSource struct {
422
431
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.
#### (a) inside the existing CSI external-provisioner
449
461
450
462
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).
455
471
456
472
To enable this feature in CSI external provisioner, `--cross-namespace-snapshot=true`
457
473
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
494
510
The implementation of provisioner and populator of this approach will be as follows:
495
511
496
512
- 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
500
516
501
517
- 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).
506
526
507
527
The above implementation is just separating the logics in approach (a) to two components, and it won't help improve efficiency nor simplify implementations.
508
528
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.
1096
1116
- Need to handle [race conditions](https://github.com/kubernetes/enhancements/pull/2849#discussion_r682057570)
1097
1117
- Need to consider [referenced Secrets](https://github.com/kubernetes/enhancements/pull/2849#discussion_r692459041) from snapshot after transferred
1098
1118
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
0 commit comments