Skip to content

Commit d0f8310

Browse files
authored
Merge pull request kubernetes#3368 from dobsonj/kep-596-updates-1.25
KEP-596: Move GA milestone to 1.25, update PRR
2 parents 9449fee + b4200ce commit d0f8310

File tree

2 files changed

+105
-37
lines changed

2 files changed

+105
-37
lines changed

keps/sig-storage/596-csi-inline-volumes/README.md

Lines changed: 103 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
- [Ephemeral inline volume operations](#ephemeral-inline-volume-operations)
2222
- [Read-only volumes](#read-only-volumes)
2323
- [Test Plan](#test-plan)
24-
- [All unit tests](#all-unit-tests)
25-
- [Ephemeral inline volumes unit tests](#ephemeral-inline-volumes-unit-tests)
26-
- [E2E tests](#e2e-tests)
24+
- [Prerequisite testing updates](#prerequisite-testing-updates)
25+
- [Unit tests](#unit-tests)
26+
- [Integration tests](#integration-tests)
27+
- [e2e tests](#e2e-tests)
2728
- [Graduation Criteria](#graduation-criteria)
2829
- [Alpha](#alpha)
2930
- [Beta](#beta)
@@ -48,8 +49,8 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
4849
- [x] (R) Design details are appropriately documented
4950
- [x] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
5051
- [x] e2e Tests for all Beta API Operations (endpoints)
51-
- [ ] (R) Ensure GA e2e tests for meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
52-
- [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free
52+
- [x] (R) Ensure GA e2e tests for meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
53+
- [x] (R) Minimum Two Week Window for GA e2e tests to prove flake free
5354
- [x] (R) Graduation criteria is in place
5455
- [ ] (R) [all GA Endpoints](https://github.com/kubernetes/community/pull/1806) must be hit by [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
5556
- [x] (R) Production readiness review completed
@@ -137,7 +138,7 @@ For example, `csi-driver-nfs` allows anybody who can create a pod to mount any N
137138

138139
Downstream distributions and cluster admins that wish to exercise fine-grained control over which CSI drivers are allowed to use ephemeral inline volumes within a pod spec should do so with a 3rd party pod admission plugin or webhook (not part of this KEP).
139140

140-
We will update the documentation to include the security aspects of inline CSI volumes and recommend CSI driver vendors not implement inline volumes for persistent storage unless they also provide a 3rd party pod admission plugin.
141+
The [Kubernetes docs](https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/) and [CSI docs](https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html) have been updated to include the security aspects of inline CSI volumes and recommend CSI driver vendors not implement inline volumes for persistent storage unless they also provide a 3rd party pod admission plugin.
141142

142143
This is consistent with the proposal by sig-auth in [KEP-2579](https://github.com/kubernetes/enhancements/blob/787515fbfa386bed95ff4d21e472474f61d1c536/keps/sig-auth/2579-psp-replacement/README.md?plain=1#L512-L519) regarding how inline CSI volumes should be handled.
143144

@@ -263,7 +264,7 @@ To benefit from this behavior, the following should be implemented in the CSI dr
263264
* We can't trust cluster admins that they deploy the admission webhook mentioned above.
264265
* When both conditions above are satisfied, the driver MAY ignore the `readonly` flag in [NodePublish](https://github.com/container-storage-interface/spec/blob/5b0d4540158a260cb3347ef1c87ede8600afb9bf/csi.proto#L1375) and set up the volume as read-write. Kubelet then can apply fsGoup if needed. Seeing `ReadOnly: true` in the Pod spec, kubelet then tells CRI to bind-mount the volume to the container as read-only, while it's read-write on the host / in the CSI driver. This behavior is already implemented in Kubelet for all projected volumes (Secrets, ConfigMap, Projected and DownwardAPI), we're allowing ephemeral CSI driver to reuse it for their Secrets-like volumes.
265266

266-
This behavior will be documented in [github.com/kubernetes-csi/docs](http://github.com/kubernetes-csi/docs). Ignoring the `readonly` flag in [NodePublish](https://github.com/container-storage-interface/spec/blob/5b0d4540158a260cb3347ef1c87ede8600afb9bf/csi.proto#L1375) of in-line CSI volumes will be supported as a valid CSI driver behavior.
267+
This behavior is documented in the [CSI docs](https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html). Ignoring the `readonly` flag in [NodePublish](https://github.com/container-storage-interface/spec/blob/5b0d4540158a260cb3347ef1c87ede8600afb9bf/csi.proto#L1375) of in-line CSI volumes will be supported as a valid CSI driver behavior.
267268

268269
Examples where this is used by the Secrets Store CSI driver:
269270
- [NodePublish ReadOnly check](https://github.com/kubernetes-sigs/secrets-store-csi-driver/blob/d32ca72038650c79561092dab26bf6d5a9c9e40a/pkg/secrets-store/nodeserver.go#L174-L177)
@@ -272,32 +273,90 @@ Examples where this is used by the Secrets Store CSI driver:
272273

273274
### Test Plan
274275

275-
#### All unit tests
276+
[x] I/we understand the owners of the involved components may require updates to
277+
existing tests to make this code solid enough prior to committing the changes necessary
278+
to implement this enhancement.
276279

277-
* Volume operation that use CSIVolumeSource can only work with proper feature gate enabled
280+
##### Prerequisite testing updates
278281

279-
#### Ephemeral inline volumes unit tests
282+
<!--
283+
Based on reviewers feedback describe what additional tests need to be added prior
284+
implementing this enhancement to ensure the enhancements have also solid foundations.
285+
-->
286+
287+
##### Unit tests
288+
289+
<!--
290+
In principle every added code should have complete unit test coverage, so providing
291+
the exact set of tests will not bring additional value.
292+
However, if complete unit test coverage is not possible, explain the reason of it
293+
together with explanation why this is acceptable.
294+
-->
295+
296+
<!--
297+
Additionally, for Alpha try to enumerate the core package you will be touching
298+
to implement this enhancement and provide the current unit coverage for those
299+
in the form of:
300+
- <package>: <date> - <current test coverage>
301+
The data can be easily read from:
302+
https://testgrid.k8s.io/sig-testing-canaries#ci-kubernetes-coverage-unit
303+
304+
This can inform certain test coverage improvements that we want to do before
305+
extending the production code to implement this enhancement.
306+
-->
307+
308+
- `k8s.io/kubernetes/pkg/volume/csi`: `6/9/22` - `76.3`
309+
- `k8s.io/kubernetes/pkg/volume/csi/csi_attacher.go`: `6/9/22` - `78.2`
310+
- `k8s.io/kubernetes/pkg/volume/csi/csi_client.go`: `6/9/22` - `76.4`
311+
- `k8s.io/kubernetes/pkg/volume/csi/csi_mounter.go`: `6/9/22` - `82.1`
312+
- `k8s.io/kubernetes/pkg/volume/csi/csi_plugin.go`: `6/9/22` - `75.1`
313+
- `k8s.io/kubernetes/pkg/volume/csi/csi_util.go`: `6/9/22` - `93.2`
314+
315+
Specific unit tests that were implemented for this feature:
316+
- [Volume operations that use CSIVolumeSource can only work with proper feature gate enabled](https://github.com/kubernetes/kubernetes/blob/163aab43d7d1a279dfa4a261202a8f424933e7dd/pkg/volume/csi/csi_plugin_test.go#L668))
317+
- [Ensure required fields are provided: csi.storage.k8s.io/ephemeral](https://github.com/kubernetes/kubernetes/blob/163aab43d7d1a279dfa4a261202a8f424933e7dd/pkg/volume/csi/csi_mounter_test.go#L154-L160)
318+
- [Mount/Unmount should be triggered with CSIVolumeSource](https://github.com/kubernetes/kubernetes/blob/163aab43d7d1a279dfa4a261202a8f424933e7dd/pkg/volume/csi/csi_mounter_test.go#L504)
319+
- [driverPolicy is ReadWriteOnceWithFSTypeFSGroupPolicy with CSI inline volume](https://github.com/kubernetes/kubernetes/blob/163aab43d7d1a279dfa4a261202a8f424933e7dd/pkg/volume/csi/csi_mounter_test.go#L1205)
320+
- [Expected generated volumeHandle is created properly](https://github.com/kubernetes/kubernetes/blob/163aab43d7d1a279dfa4a261202a8f424933e7dd/pkg/volume/csi/csi_plugin_test.go#L280)
321+
- [CanSupport works with CSI inline volumes](https://github.com/kubernetes/kubernetes/blob/163aab43d7d1a279dfa4a261202a8f424933e7dd/pkg/volume/csi/csi_plugin_test.go#L372)
322+
- [ConstructVolumeSpec works with CSI inline volumes](https://github.com/kubernetes/kubernetes/blob/163aab43d7d1a279dfa4a261202a8f424933e7dd/pkg/volume/csi/csi_plugin_test.go#L506)
323+
- [NewMounter works with CSI inline volumes](https://github.com/kubernetes/kubernetes/blob/163aab43d7d1a279dfa4a261202a8f424933e7dd/pkg/volume/csi/csi_plugin_test.go#L757)
324+
- [CanAttach works with CSI inline volumes](https://github.com/kubernetes/kubernetes/blob/163aab43d7d1a279dfa4a261202a8f424933e7dd/pkg/volume/csi/csi_plugin_test.go#L995)
325+
- [FindAttachablePlugin works with CSI inline volumes](https://github.com/kubernetes/kubernetes/blob/163aab43d7d1a279dfa4a261202a8f424933e7dd/pkg/volume/csi/csi_plugin_test.go#L1049)
326+
- [CanDeviceMount works with CSI inline volumes](https://github.com/kubernetes/kubernetes/blob/163aab43d7d1a279dfa4a261202a8f424933e7dd/pkg/volume/csi/csi_plugin_test.go#L1125)
327+
- [FindDeviceMountablePluginBySpec works with CSI inline volumes](https://github.com/kubernetes/kubernetes/blob/163aab43d7d1a279dfa4a261202a8f424933e7dd/pkg/volume/csi/csi_plugin_test.go#L1177)
328+
- [Ensure that CSIDriver.VolumeLifecycleModes field is validated properly](https://github.com/kubernetes/kubernetes/pull/80568)
329+
330+
##### Integration tests
331+
332+
<!--
333+
This question should be filled when targeting a release.
334+
For Alpha, describe what tests will be added to ensure proper quality of the enhancement.
335+
336+
For Beta and GA, add links to added tests together with links to k8s-triage for those tests:
337+
https://storage.googleapis.com/k8s-triage/index.html
338+
-->
339+
340+
See E2E tests below.
280341

281-
* Ensure required fields are provided: csi.storage.k8s.io/ephemeral (https://github.com/pohly/kubernetes/blob/4bc5d065c919fc239e2c8b40e6a96e409ca011fd/pkg/volume/csi/csi_mounter_test.go#L140-L146)
282-
* Mount/Unmount should be triggered with CSIVolumeSource: https://github.com/kubernetes/kubernetes/blob/10005d2e1e1425904f8c7bf5615e730fb0fea7c9/pkg/volume/csi/csi_mounter_test.go#L386
283-
* Expected generated volumeHandle is created properly: https://github.com/kubernetes/kubernetes/blob/10005d2e1e1425904f8c7bf5615e730fb0fea7c9/pkg/volume/csi/csi_plugin_test.go#L177
284-
* Ensure that CSIDriver.VolumeLifecycleModes field is validated properly: https://github.com/kubernetes/kubernetes/pull/80568
285-
* Ensure volumeHandle conforms to resource naming format: TODO
286-
* CSIVolumeSource info persists in CSI json file during mount/unmount: TODO
287-
* Ensure Kubelet skips attach/detach when `CSIDriver.VolumeLifecycleModes = Ephemeral`: TODO
288-
* Ensure Kubelet skips inline logic when `CSIDriver.VolumeLifecycleModes = Persistent` or `CSIDriver.VolumeLifecycleModes is empty`: covered by existing tests
289-
* Add unit tests for feature gate enablement / disablement, similar to this [network policy strategy test](https://github.com/kubernetes/kubernetes/blob/b7c82bb83c1b3933b99fbc5fdcffa59fd6441617/pkg/registry/networking/networkpolicy/strategy_test.go#L246-L281): TODO
342+
##### e2e tests
290343

291-
#### E2E tests
344+
<!--
345+
This question should be filled when targeting a release.
346+
For Alpha, describe what tests will be added to ensure proper quality of the enhancement.
292347

293-
* Pod spec with an ephemeral inline volume request can be mounted/unmounted: https://github.com/pohly/kubernetes/blob/4bc5d065c919fc239e2c8b40e6a96e409ca011fd/test/e2e/storage/csi_mock_volume.go#L356-L371, https://github.com/pohly/kubernetes/blob/4bc5d065c919fc239e2c8b40e6a96e409ca011fd/test/e2e/storage/testsuites/ephemeral.go#L110-L115
294-
* Two pods accessing an ephemeral inline volume which has the same attributes in both pods: "should support two pods which share the same data" in `ephemeral.go` (upcoming PR)
295-
* Single pod referencing two distinct inline volume request from the same driver: "should support multiple inline ephemeral volumes" in `ephemeral.go` (upcoming PR)
296-
* CSI Kubelet code invokes driver operations during mount for ephemeral volumes: `checkPodLogs` in `csi_mock_volume.go` (upcoming PR)
297-
* CSI Kubelet code invokes driver operation during unmount of ephemeral volumes: `checkPodLogs` in `csi_mock_volume.go` (upcoming PR)
298-
* CSI Kubelet cleans up ephemeral volume paths once pod goes away: TODO
299-
* Enable testing of an external ephemeral CSI driver: https://github.com/kubernetes/kubernetes/pull/79983/files#diff-e5fc8d9911130b421b74b1ebc273f458
300-
* Enable testing of the csi-host-path-driver in ephemeral mode in Kubernetes-CSI Prow jobs and Kubernetes itself: TODO
348+
For Beta and GA, add links to added tests together with links to k8s-triage for those tests:
349+
https://storage.googleapis.com/k8s-triage/index.html
350+
351+
We expect no non-infra related flakes in the last month as a GA graduation criteria.
352+
-->
353+
354+
- [TestPattern: CSI Ephemeral-volume (default fs)](https://github.com/kubernetes/kubernetes/blob/7c127b33dafc530f7ca0c165ddb47db86eb45880/test/e2e/storage/framework/testpattern.go#L98-L102): [test coverage](https://storage.googleapis.com/k8s-triage/index.html?test=.*CSI%20Ephemeral-volume%20%5C%28default%20fs%5C%29.*)
355+
- [should create read-only inline ephemeral volume](https://github.com/kubernetes/kubernetes/blob/7c127b33dafc530f7ca0c165ddb47db86eb45880/test/e2e/storage/testsuites/ephemeral.go#L175): [test coverage](https://storage.googleapis.com/k8s-triage/index.html?test=should%20create%20read-only%20inline%20ephemeral%20volume)
356+
- [should create read/write inline ephemeral volume](https://github.com/kubernetes/kubernetes/blob/7c127b33dafc530f7ca0c165ddb47db86eb45880/test/e2e/storage/testsuites/ephemeral.go#L196): [test coverage](https://storage.googleapis.com/k8s-triage/index.html?test=should%20create%20read%2Fwrite%20inline%20ephemeral%20volume)
357+
- [should support two pods which have the same volume definition](https://github.com/kubernetes/kubernetes/blob/7c127b33dafc530f7ca0c165ddb47db86eb45880/test/e2e/storage/testsuites/ephemeral.go#L277): [test coverage](https://storage.googleapis.com/k8s-triage/index.html?test=should%20support%20two%20pods%20which%20have%20the%20same%20volume%20definition)
358+
- [should support multiple inline ephemeral volumes](https://github.com/kubernetes/kubernetes/blob/7c127b33dafc530f7ca0c165ddb47db86eb45880/test/e2e/storage/testsuites/ephemeral.go#L315): [test coverage](https://storage.googleapis.com/k8s-triage/index.html?test=should%20support%20multiple%20inline%20ephemeral%20volumes)
359+
- [contain ephemeral=true when using inline volume](https://github.com/kubernetes/kubernetes/blob/7c127b33dafc530f7ca0c165ddb47db86eb45880/test/e2e/storage/csi_mock_volume.go#L495): [test coverage](https://storage.googleapis.com/k8s-triage/index.html?test=contain%20ephemeral%3Dtrue%20when%20using%20inline%20volume)
301360

302361

303362
### Graduation Criteria
@@ -314,12 +373,15 @@ Examples where this is used by the Secrets Store CSI driver:
314373

315374
#### GA
316375

317-
- Remove dependency on deprecated `PodSecurityPolicy` and document new strategy
318-
- Upgrade / downgrade manual testing, document results in PRR questionnaire.
319-
- Conformance tests implemented / promoted
320-
- Updated documentation as described in [Security Considerations](#security-considerations) and [Read-only volumes](#read-only-volumes)
321-
- Fix for [#79980 - CSI volume reconstruction](https://github.com/kubernetes/kubernetes/issues/79980)
322-
- Ensure our sponsored [NFS](https://github.com/kubernetes-csi/csi-driver-nfs) and [SMB](https://github.com/kubernetes-csi/csi-driver-smb) CSI drivers align with the new guidance in [Security Considerations](#security-considerations)
376+
- [x] Remove dependency on deprecated `PodSecurityPolicy` and document new strategy
377+
- [x] Fix for [#89290 - CSI Inline volume panic when calling applyFSGroup](https://github.com/kubernetes/kubernetes/issues/89290)
378+
- [x] Fix for [#79980 - CSI volume reconstruction](https://github.com/kubernetes/kubernetes/issues/79980)
379+
- [x] Updated documentation as described in [Security Considerations](#security-considerations) and [Read-only volumes](#read-only-volumes)
380+
- [ ] Upgrade / downgrade manual testing, document results in the [upgrade / rollback section](#rollout-upgrade-and-rollback-planning).
381+
- [ ] Provide measurements for the [Scalability section](#scalability) (time taken to start a pod)
382+
- [ ] Ensure our sponsored [NFS](https://github.com/kubernetes-csi/csi-driver-nfs) and [SMB](https://github.com/kubernetes-csi/csi-driver-smb) CSI drivers align with the new guidance in [Security Considerations](#security-considerations)
383+
- [ ] Conformance tests implemented / promoted
384+
- [ ] Feature flag set to GA
323385

324386

325387
## Production Readiness Review Questionnaire
@@ -389,7 +451,7 @@ Examples where this is used by the Secrets Store CSI driver:
389451

390452
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
391453

392-
To be documented as part of manual GA testing.
454+
TODO: To be documented as part of manual GA testing.
393455

394456
<!--
395457
Describe manual testing that was done and the outcomes.
@@ -571,5 +633,11 @@ implementation more complex.
571633
(https://github.com/kubernetes/kubernetes/pull/80568, merged)
572634

573635
1.24:
636+
- Remove dependency on deprecated `PodSecurityPolicy` and document new strategy
637+
- Fix for [#89290 - CSI Inline volume panic when calling applyFSGroup](https://github.com/kubernetes/kubernetes/issues/89290)
638+
- Updated documentation as described in [Security Considerations](#security-considerations) and [Read-only volumes](#read-only-volumes)
639+
640+
1.25:
641+
- Fix for [#79980 - CSI volume reconstruction](https://github.com/kubernetes/kubernetes/issues/79980)
574642
- GA status
575643

keps/sig-storage/596-csi-inline-volumes/kep.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ approvers:
1818
- "@saad-ali"
1919

2020
stage: "stable"
21-
latest-milestone: "v1.24"
21+
latest-milestone: "v1.25"
2222

2323
milestone:
2424
alpha: "v1.15"
2525
beta: "v1.16"
26-
stable: "v1.24"
26+
stable: "v1.25"
2727

2828
feature-gates:
2929
- name: CSIInlineVolume

0 commit comments

Comments
 (0)