diff --git a/keps/sig-storage/20190122-csi-inline-volumes.md b/keps/sig-storage/20190122-csi-inline-volumes.md index 727d55ef07c6..c39e6f3174fd 100644 --- a/keps/sig-storage/20190122-csi-inline-volumes.md +++ b/keps/sig-storage/20190122-csi-inline-volumes.md @@ -2,6 +2,7 @@ title: Ephemeral Inline CSI Volumes authors: - "@vladimirvivien" + - "@pohly" owning-sig: sig-storage participating-sigs: - sig-storage @@ -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 --- @@ -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 ``` @@ -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 \ No newline at end of file +* 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)