Skip to content

Commit 3111d48

Browse files
committed
Addressed review comments
1 parent 2d2bd7f commit 3111d48

File tree

2 files changed

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

2 files changed

+81
-40
lines changed

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

Lines changed: 79 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ tags, and then generate with `hack/update-toc.sh`.
8787
- [Story 1](#story-1)
8888
- [Story 2](#story-2)
8989
- [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional)
90-
- [Provisioning PVs from cross-namespace PVs](#provisioning-pvs-from-cross-namespace-pvs)
90+
- [Provisioning PVCs from cross-namespace PVCs](#provisioning-pvcs-from-cross-namespace-pvcs)
9191
- [Risks and Mitigations](#risks-and-mitigations)
9292
- [Secret Handling](#secret-handling)
9393
- [Security](#security)
@@ -100,6 +100,10 @@ tags, and then generate with `hack/update-toc.sh`.
100100
- [(1) Populate data from snapshot to provisioned PV](#1-populate-data-from-snapshot-to-provisioned-pv)
101101
- [(2) Provision PV with data via CSI call](#2-provision-pv-with-data-via-csi-call)
102102
- [Test Plan](#test-plan)
103+
- [Prerequisite testing updates](#prerequisite-testing-updates)
104+
- [Unit tests](#unit-tests)
105+
- [Integration tests](#integration-tests)
106+
- [e2e tests](#e2e-tests)
103107
- [Graduation Criteria](#graduation-criteria)
104108
- [Alpha](#alpha)
105109
- [Beta](#beta)
@@ -197,7 +201,7 @@ demonstrate the interest in a KEP within the wider Kubernetes community.
197201

198202
By using [volume snapshots feature](https://kubernetes.io/docs/concepts/storage/volume-snapshots/), users can provision volumes from snapshots.
199203
However, it only works for the `VolumeSnapshot` in the same namespace,
200-
therefore users can't provision a volume in one namespace from a `VolumeSnapshot` in the other namespace.
204+
therefore users can't provision a persistent volume claim in one namespace from a `VolumeSnapshot` in the other namespace.
201205
On the other hand, as discussed in other KEP PRs (https://github.com/kubernetes/enhancements/pull/643,
202206
https://github.com/kubernetes/enhancements/pull/1112, and https://github.com/kubernetes/enhancements/pull/2849), there are use cases that require to share the `VolumeSnapshot` across namespaces.
203207
For such use cases, this KEP proposes a method for provisioning volumes from cross-namespace snapshots.
@@ -208,15 +212,15 @@ For such use cases, this KEP proposes a method for provisioning volumes from cro
208212
List the specific goals of the KEP. What is it trying to achieve? How will we
209213
know that this has succeeded?
210214
-->
211-
- Provision of PVs from `VolumeSnapshot`s in other namespaces
215+
- Provision of PVCs from `VolumeSnapshot`s in other namespaces
212216

213217
### Non-Goals
214218

215219
<!--
216220
What is out of scope for this KEP? Listing non-goals helps to focus discussion
217221
and make progress.
218222
-->
219-
- Provision of PVs from PVCs in other namespaces (Please also see [Provisioning PVs from cross-namespace PVs](#provisioning-pvs-from-cross-namespace-pvs))
223+
- Provision of PVCs from PVCs in other namespaces (Please also see [Provisioning PVCs from cross-namespace PVCs](#provisioning-pvcs-from-cross-namespace-pvcs))
220224
- Copy or move of `VolumeSnapshot`s to other namespaces (Please also see [Alternatives](#alternatives))
221225
- Clone of `VolumeSnapshotContent`s
222226

@@ -267,10 +271,10 @@ Go in to as much detail as necessary here.
267271
This might be a good place to talk about core concepts and how they relate.
268272
-->
269273

270-
#### Provisioning PVs from cross-namespace PVs
274+
#### Provisioning PVCs from cross-namespace PVCs
271275

272-
The conclusion of the original discussion ([here](https://docs.google.com/document/d/17H1k4lqdtJwZSjNRaQue-FhMhyk14JA_MoURpoxha5Q/edit#bookmark=id.nj4e1ocn8b23) and [here](https://docs.google.com/document/d/17H1k4lqdtJwZSjNRaQue-FhMhyk14JA_MoURpoxha5Q/edit#bookmark=id.h1eqongxseo)) on transfer feature was that we should avoid implementing transfer of PVCs, because there will be more race conditions for PVs than snapshots.
273-
However, we might have a room to reconsider if this cross-namespace-provision approach can solve the issue of race for PVCs, although transfer approach can't seems to resolve the issue easily.
276+
The conclusion of the original discussion ([here](https://docs.google.com/document/d/17H1k4lqdtJwZSjNRaQue-FhMhyk14JA_MoURpoxha5Q/edit#bookmark=id.nj4e1ocn8b23) and [here](https://docs.google.com/document/d/17H1k4lqdtJwZSjNRaQue-FhMhyk14JA_MoURpoxha5Q/edit#bookmark=id.h1eqongxseo)) on transfer feature was that we should avoid implementing transfer of PVCs, because there will be more race conditions for PVCs than snapshots.
277+
However, we might have a room to reconsider if this cross-namespace-provision approach can solve the issue of race for PVCs, although transfer approach can't seem to resolve the issue easily.
274278

275279
### Risks and Mitigations
276280

@@ -288,13 +292,13 @@ Consider including folks who also work outside the SIG or subproject.
288292

289293
#### Secret Handling
290294

291-
TBD: Unlike transfer feature, this idea doesn't require transfer of secert, but it may need to be discussed
292-
(We would need to go back to discussion around https://github.com/kubernetes/enhancements/pull/2849#issuecomment-962168202).
295+
Unlike transfer feature, this idea doesn't need to involve any transfers of Secert, therefore there will be no issue on Secret handling.
296+
From a populator, Secrets are only referenced through snapshots that exist in the same namespace (As commented [here](https://github.com/kubernetes/enhancements/pull/2849#issuecomment-962168202), depending on the driver implementation, there may be very little chance that some CSI drivers won't work well in a very rare situation. However, such drivers can avoid this issue separately, by turning off this feature, implementing their own populator, and so on).
293297

294298
#### Security
295299

296-
TBD: Use of `ReferencePolicy` should remove the risk, but it may need to be discussed
297-
(We would need to check again for [the original use case of Gateway APIs](https://github.com/kubernetes/enhancements/pull/2849#issuecomment-919107307), and review if there are any security risks).
300+
By using [`ReferencePolicy`](https://gateway-api.sigs.k8s.io/concepts/security-model/#2-referencepolicy), only allowed snapshots can be accessed beyond the namespace boundary (Please also see [original discussion on security](https://github.com/kubernetes/enhancements/pull/2849#issuecomment-919107307)).
301+
Therefore, no malicious user will be able to access to prohibited snapshots.
298302

299303
## Design Details
300304

@@ -307,17 +311,17 @@ proposal will be implemented, this is the place to discuss them.
307311

308312
### Example flow of how this proposal works
309313

310-
Let's use [Story 1](#story-1) as an example and let's assume:
314+
Let's use [Story 1](#story-1) as an example and let's assume the following:
311315
- There are two namespaces, prod and test,
312-
- Alice manages the prod namesapce and Bob manages the test namespace,
316+
- Alice manages the prod namespace and Bob manages the test namespace,
313317
- Alice would like to allow `VolumeSnapshot` foo-backup in the prod namespace to be consumed in the test namespace for testing,
314318
- Bob would like to create a PV for PVC foo-testing in the test namespace from the `VolumeSnapshot` foo-backup in the prod namespace.
315319

316320
Once this proposal is implemented, it can be achieved by doing the following steps:
317321

318322
1. In the prod namespace, Alice creates a `ReferencePolicy` bar that allows referencing to the `VolumeSnapshot` foo-backup in the prod namespace from any `VolumeSnapshotLinks` in the test namespace,
319323
```yaml
320-
apiVersion: gateway.networking.k8s.io/v1alpha2
324+
apiVersion: gateway.networking.k8s.io/v1alpha2
321325
kind: ReferencePolicy
322326
metadata:
323327
name: bar
@@ -346,7 +350,7 @@ Once this proposal is implemented, it can be achieved by doing the following ste
346350
```
347351
3. In the test namespace, Bob creates a `PersistentVolumeClaim` foo-testing that references the `VolumeSnapshotLink` foo-link as a data source,
348352
```yaml
349-
apiVersion: v1
353+
apiVersion: v1
350354
kind: PersistentVolumeClaim
351355
metadata:
352356
name: foo-testing
@@ -480,14 +484,7 @@ Therefore, the description in this section is just for discussion purpose and wo
480484

481485
<!--
482486
**Note:** *Not required until targeted at a release.*
483-
484-
Consider the following in developing a test plan for this enhancement:
485-
- Will there be e2e and integration tests, in addition to unit tests?
486-
- How will it be tested in isolation vs with other components?
487-
488-
No need to outline all of the test cases, just the general strategy. Anything
489-
that would count as tricky in the implementation, and anything particularly
490-
challenging to test, should be called out.
487+
The goal is to ensure that we don't accept enhancements with inadequate testing.
491488

492489
All code is expected to have adequate tests (eventually with coverage
493490
expectations). Please adhere to the [Kubernetes testing guidelines][testing-guidelines]
@@ -496,18 +493,62 @@ when drafting this test plan.
496493
[testing-guidelines]: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
497494
-->
498495

499-
- For Alpha, unit tests and e2e tests for provisioning PV from `VolumeSnapshotLink` are added.
500-
- unit tests:
501-
- feature enabeld case:
502-
- Verify that PV is provisioned from VS in other namsepace if allowed by ReferencePolicy
503-
- Verify that PV isn't provisioned from VS in other namsepace if not allowed by ReferencePolicy
504-
- feature disabled case:
505-
- Verify that provisioning from VolumeSnapshotLink returns error if the feature is disabled
506-
- e2e tests:
507-
- Verify that PV is provisioned from VS in other namsepace if allowed by ReferencePolicy
508-
- Verify that PV isn't provisioned from VS in other namsepace if not allowed by ReferencePolicy
509-
- For Beta, scalability tests are added to exercise this feature.
510-
- For GA, the introduced e2e tests will be promoted to conformance.
496+
[x] I/we understand the owners of the involved components may require updates to
497+
existing tests to make this code solid enough prior to committing the changes necessary
498+
to implement this enhancement.
499+
500+
##### Prerequisite testing updates
501+
502+
<!--
503+
Based on reviewers feedback describe what additional tests need to be added prior
504+
implementing this enhancement to ensure the enhancements have also solid foundations.
505+
-->
506+
507+
##### Unit tests
508+
509+
<!--
510+
In principle every added code should have complete unit test coverage, so providing
511+
the exact set of tests will not bring additional value.
512+
However, if complete unit test coverage is not possible, explain the reason of it
513+
together with explanation why this is acceptable.
514+
-->
515+
516+
<!--
517+
Additionally, for Alpha try to enumerate the core package you will be touching
518+
to implement this enhancement and provide the current unit coverage for those
519+
in the form of:
520+
- <package>: <date> - <current test coverage>
521+
The data can be easily read from:
522+
https://testgrid.k8s.io/sig-testing-canaries#ci-kubernetes-coverage-unit
523+
This can inform certain test coverage improvements that we want to do before
524+
extending the production code to implement this enhancement.
525+
-->
526+
527+
- external-provisioner/pkg/controller/: 2022/5/31 - 81.1%
528+
529+
##### Integration tests
530+
531+
<!--
532+
This question should be filled when targeting a release.
533+
For Alpha, describe what tests will be added to ensure proper quality of the enhancement.
534+
For Beta and GA, add links to added tests together with links to k8s-triage for those tests:
535+
https://storage.googleapis.com/k8s-triage/index.html
536+
-->
537+
538+
- No integration tests for csi external provisioner.
539+
540+
##### e2e tests
541+
542+
<!--
543+
This question should be filled when targeting a release.
544+
For Alpha, describe what tests will be added to ensure proper quality of the enhancement.
545+
For Beta and GA, add links to added tests together with links to k8s-triage for those tests:
546+
https://storage.googleapis.com/k8s-triage/index.html
547+
We expect no non-infra related flakes in the last month as a GA graduation criteria.
548+
-->
549+
550+
- Verify that PV is provisioned from VS in other namsepace if allowed by ReferencePolicy: <link to test coverage>
551+
- Verify that PV isn't provisioned from VS in other namsepace if not allowed by ReferencePolicy: <link to test coverage>
511552

512553
### Graduation Criteria
513554

@@ -649,7 +690,7 @@ well as the [existing list] of feature gates.
649690
- [x] Other
650691
- Describe the mechanism:
651692
- Will enabling / disabling the feature require downtime of the control
652-
plane? No.
693+
plane? No, it won't require downtime of the entire control plane. However, it will require a downtime of each provisioner whose enablement is being changed.
653694
- Will enabling / disabling the feature require downtime or reprovisioning
654695
of a node? (Do not assume `Dynamic Kubelet Config` feature is enabled). No.
655696

@@ -660,7 +701,7 @@ Any change of default behavior may be surprising to users or break existing
660701
automations, so be extremely careful here.
661702
-->
662703

663-
Yes, `VolumeSnapshotLink` CRD can be used as a `DataSourceRef` for provisioning PV.
704+
Yes, `VolumeSnapshotLink` CRD can be used as a `DataSourceRef` for PVC.
664705

665706
###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
666707

@@ -679,7 +720,7 @@ Yes, by specifying `--cross-namespace-snapshot=false` command line flag of CSI e
679720

680721
###### What happens if we reenable the feature if it was previously rolled back?
681722

682-
`VolumeSnapshotLink` CRD can be used as a `DataSourceRef` for provisioning PV, again.
723+
`VolumeSnapshotLink` CRD can be used as a `DataSourceRef` for PVC, again.
683724

684725
###### Are there any tests for feature enablement/disablement?
685726

keps/sig-storage/3294-provision-volumes-from-cross-namespace-snapshots/kep.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ authors:
55
- "@mkimuram"
66
owning-sig: sig-storage
77
participating-sigs:
8-
- sig-storage
9-
status: provisional
8+
- sig-network
9+
status: implementable
1010
creation-date: 2022-04-06
1111
reviewers:
1212
- "@xing-yang"

0 commit comments

Comments
 (0)