Skip to content

Commit

Permalink
csi-inline-volumes.md: prepare for beta
Browse files Browse the repository at this point in the history
This adds the implementation history and checks which of the proposed
tests are implemented.
  • Loading branch information
pohly committed Jul 26, 2019
1 parent 31c753f commit 67d1638
Showing 1 changed file with 33 additions and 11 deletions.
44 changes: 33 additions & 11 deletions keps/sig-storage/20190122-csi-inline-volumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Ephemeral Inline CSI Volumes
authors:
- "@vladimirvivien"
- "@pohly"
owning-sig: sig-storage
participating-sigs:
- sig-storage
Expand All @@ -13,7 +14,7 @@ approvers:
- "@thockin"
- "@saad-ali"
creation-date: 2019-01-22
last-updated: 2019-01-30
last-updated: 2019-07-25
status: implementable
---

Expand Down Expand Up @@ -84,8 +85,9 @@ spec:
volumes:
- name: vol
csi:
driver: inline.storage.kubernetes.io
# Passed as NodePublishVolumeRequest.volume_context.
driver: some-csi-driver.example.com
# Passed as NodePublishVolumeRequest.volume_context,
# valid options depend on the driver.
volumeAttributes:
foo: bar
```
Expand Down Expand Up @@ -225,19 +227,39 @@ Since ephemeral volume requests will participate in only the mount/unmount volum
* Volume operation that use CSIVolumeSource can only work with proper feature gate enabled

### Ephemeral inline volumes unit tests
* Ensure required fields are provided
* Mount/Unmount should be triggered with CSIVolumeSource
* Expected generated volumeHandle is created properly
* 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)
* Mount/Unmount should be triggered with CSIVolumeSource: https://github.com/kubernetes/kubernetes/blob/10005d2e1e1425904f8c7bf5615e730fb0fea7c9/pkg/volume/csi/csi_mounter_test.go#L386
* Expected generated volumeHandle is created properly: https://github.com/kubernetes/kubernetes/blob/10005d2e1e1425904f8c7bf5615e730fb0fea7c9/pkg/volume/csi/csi_plugin_test.go#L177
* Ensure that CSIDriver.Spec.Mode field is validated properly: https://github.com/kubernetes/kubernetes/pull/80568
* Ensure volumeHandle conforms to resource naming format
* CSIVolumeSource info persists in CSI json file during mount/unmount
* Ensure Kubelet skips attach/detach when `CSIDriver.Mode = ephemeral`
* Ensure Kubelet skips inline logic when `CSIDriver.Mode = persistent` or `CSIDriver.Mode is empty`
* Ensure Kubelet skips inline logic when `CSIDriver.Mode = persistent` or `CSIDriver.Mode is empty`: covered by existing tests

### E2E tests
* Pod spec with an ephemeral inline volume request can be mounted/unmounted
* Two pods accessing the same ephemeral inline volumes
* Single pod referencing two distinct inline volume request from the same driver
* 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
* Two pods accessing the same ephemeral inline volume
* Single pod referencing two distinct inline volume request from the same driver
* CSI Kubelet code invokes driver operations during mount for ephemeral volumes
* CSI Kubelet code invokes driver operation during unmount of ephemeral volumes
* CSI Kubelet cleans up ephemeral volume paths once pod goes away
* Apply PodSecurity settings for allowed CSI drivers
* Apply PodSecurity settings for allowed CSI drivers


## Implementation History

1.15:
- Alpha status
- `CSIDriver.Mode` not added yet
- a CSI driver deployment can only be used for ephemeral inline
volumes or persistent volumes, but not both, because the driver
cannot determine the mode in its `NodePublishVolume` implementation

1.16:
- the same CSI driver deployment can support both modes by enabling
the pod info feature and checking the value of
`csi.storage.k8s.io/ephemeral`
(https://github.com/kubernetes/kubernetes/issues/79624)
- `CSIDriver.Mode` added and checked before calling a CSI driver for
an ephemeral inline volume
(https://github.com/kubernetes/kubernetes/pull/80568)

0 comments on commit 67d1638

Please sign in to comment.