-
Notifications
You must be signed in to change notification settings - Fork 32
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
Multiple PVs referring to the same bucket cannot be consumed by one Pod #48
Comments
Can you clarify why this scenario needed two PVCs for the same volume in the same pod? Were the mount options different? |
Yes, the mount options could be different. For example, different PVs may consume the same bucket, but use |
And this is because the subpath feature does not work? |
There may be frameworks/operators that only know how to use PVC/PV and not csi ephemeral volumes, so it would be good to see if we can get similar feature parity. |
No, this is not related to the subPath feature.
I remember this issue will also happen on the PD CSI driver when different PVs pointing to the same underlaying disk ID on the To get similar feature parity, maybe we can modify the kubelet logic here https://github.com/kubernetes/kubernetes/blob/8f15859afc9cfaeb05d4915ffa204d84da512094/pkg/kubelet/volumemanager/cache/desired_state_of_world.go#L296-L298? |
Symptom
When multiple PVs are consuming the same bucket via the field
volumeHandle
, and the PVCs bound to these PVs are consumed by the same Pod, the volume mount will time out.For example, the following Pod will be stuck in the volume mount stage.
Root Cause
According to the kubelet code: https://github.com/kubernetes/kubernetes/blob/8f15859afc9cfaeb05d4915ffa204d84da512094/pkg/kubelet/volumemanager/cache/desired_state_of_world.go#L296-L298
In the case of using a CSI driver and a pre-provisioned PV, the volume name is specified via the volumeHandle. Different PVs will be treated as the same volume, therefore after kubelet mounts one of the PVs, the other PVs will be treated as already mounted. As a result, the Pod will be stuck in volume mount stage.
Solution
If for some reason, your Pod need to consume multiple volumes pointing to the same bucket, please consider using the following two approaches:
Please use CSI ephemeral inline volume to configure Pod if the Pod needs to mount the same bucket to different mount paths.
For example, the following Pod has two volumes referring to the same bucket
same-bucket-name
, but the volumes are mounted to different mount paths using different mount options.You can use PV/PVC with the subPath feature. For example:
The text was updated successfully, but these errors were encountered: