-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetVolumeCapabilities incorrectly errors when multiple volume capabilities are specified in the PV #153
Comments
That is the heuristics. See external-attacher/pkg/controller/util.go Lines 182 to 204 in 08983ee
For I am afraid that Kubernetes and CSI access modes aren't really compatible. Kubernetes tracks what PV supports and does not really track how it's used in a pod (does a pod with non-RO VolumeMount want ReadWriteOnce or ReadWriteMany?). In this case, we could add ReadOnly flag from Pod's In addition, what should A/D controller and CSI driver do when a pod with RW volumeMount is scheduled to a node to a node that already has RO attachment? IMO, CSI does not support modification of existing attachments and it does not support attaching the same volume twice. |
Right, that makes sense. I guess this is more of a migration compatibility case then. It looks like for in-tree GCE PD if It may be that the "correct" solution for migration is to add some more logic to I agree with your assessment, with the current state of our accessmodes and readonly flags there is no way to "fix" this in a satisfying way. This is something we should consider when working on this fix for: kubernetes/kubernetes#70505 as well |
According to kubernetes/kubernetes#70505, external-attacher also uses readOnly field in CSIPersistentVolumeSource. Can we not ignore/override accessmode check in this case? |
|
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale Important open issue that still has an undefined solution. Freezing so that we don't lose it |
A PersistentVolume can contain multiple access modes:
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes
When multiple access modes are given to the
CreateVolume
call it is the drivers responsibility to provision a volume that satisfies all access modes:Then once the driver provisions a volume the external provisioner then copies the multiple access modes to the PV:
https://github.com/kubernetes-csi/external-provisioner/blob/1730a1e31d92b454e72c8c443369b3338d2f3599/pkg/controller/controller.go#L521
However, when we try to attach the volume, the external attacher rejects multiple access modes on the PV:
external-attacher/pkg/controller/util.go
Line 190 in 08983ee
Since the PV supports multiple AccessModes in Kubernetes, but the CSI call to
ControllerPublishVolume
accepts only one AccessMode. It is actually the external-attacher's job to "pick" the correct access mode based on other information (or some heuristic) before passing it to the CSI Driver. Throwing an error is not intended behavior./cc @saad-ali @msau42 @jsafrane
The text was updated successfully, but these errors were encountered: