-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Fix mount collision timeout issue #29673
Conversation
Removing label |
// GetUniqueVolumeNameForNonAttachableVolume returns the unique volume name | ||
// for a non-attachable volume. | ||
func GetUniqueVolumeNameForNonAttachableVolume(volumePlugin volume.VolumePlugin, podNamespace, podName, podSpecName string) api.UniqueVolumeName { | ||
return api.UniqueVolumeName(fmt.Sprintf("%s/%s-%s-%s", volumePlugin.GetPluginName(), podNamespace, podName, podSpecName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep that would great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pmorie, thanks for addressing this. Now I am still thinking whether this
change may affect our initial intention of avoiding operating mount/mount
for the same volume/pod. If for the same pod/volume, it is ok mount
parallel if the inner/outterspec name is different, then it should be fine.
On Wed, Jul 27, 2016 at 10:10 AM, Paul Morie notifications@github.com
wrote:
In pkg/volume/util/volumehelper/volumehelper.go
#29673 (comment)
:@@ -52,6 +52,12 @@ func GetUniqueVolumeName(pluginName, volumeName string) api.UniqueVolumeName {
return api.UniqueVolumeName(fmt.Sprintf("%s/%s", pluginName, volumeName))
}+// GetUniqueVolumeNameForNonAttachableVolume returns the unique volume name
+// for a non-attachable volume.
+func GetUniqueVolumeNameForNonAttachableVolume(volumePlugin volume.VolumePlugin, podNamespace, podName, podSpecName string) api.UniqueVolumeName {
- return api.UniqueVolumeName(fmt.Sprintf("%s/%s-%s-%s", volumePlugin.GetPluginName(), podNamespace, podName, podSpecName))
@jingxu97 https://github.com/jingxu97 I'm changing this to use the pod
UID instead of the namespace and name to aid you in #27970
#27970—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/kubernetes/pull/29673/files/e967f0d59934d271a8eca16f6582865614008d8f#r72480743,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ASSNxfEUFfXSNMgrEIUUJwFFRtyLn6B0ks5qZ5EagaJpZM4JWQGg
.
- Jing
@@ -92,6 +92,7 @@ func (grm *nestedPendingOperations) Run( | |||
grm.lock.Lock() | |||
defer grm.lock.Unlock() | |||
|
|||
// search for an existing operation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take it out.
// | ||
// TODO: in the future, we should be able to remove the volumeName | ||
// argument to this method -- since it is used only for attachable | ||
// volumes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add "why we do this" namely - "to ensure that the volume name used is unique."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll open an issue for follow-up.
For non-attachable volumes, do not call GetVolumeName on the plugin and instead generate a unique name based on the identity of the pod and the name of the volume within the pod.
@matchstick @saad-ali should be in a good state now, PTAL. |
GCE e2e build/test passed for commit f15684e. |
LGTM Thanks @pmorie |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit f15684e. |
Automatic merge from submit-queue |
…-upstream-release-1.3 Automated cherry pick of #29673
…-of-#29673-upstream-release-1.3 Automated cherry pick of kubernetes#29673
…-of-#29673-upstream-release-1.3 Automated cherry pick of kubernetes#29673
Short- or medium-term workaround for #29555. The root issue being fixed here is that the recent attach/detach work in the kubelet uses a unique volume name as a key that tracks the work that has to be done for each volume in a pod to attach/mount/umount/detach. However, the non-attachable volume plugins do not report unique names for themselves, which causes collisions when a single secret or configmap is mounted multiple times in a pod.
This is still a WIP -- I need to add a couple E2E tests that ensure that tests break in the future if there is a regression -- but posting for early review.
cc @kubernetes/sig-storage
Ultimately, I would like to refine this a bit further. A couple things I would like to change:
GetUniqueVolumeName
should be a property ONLY of attachable volumesWaitForControllerAttach
call that has to be done for those volume types now