Skip to content
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

Mount command failed, status: Failure, The volume is existed and is attached #30

Closed
SacDin opened this issue Jan 16, 2018 · 3 comments
Closed

Comments

@SacDin
Copy link

SacDin commented Jan 16, 2018

While upgrading / rolling update on the deployment, the system tries to create new pod, attach and then shutdown old pods. In this process, new replica sets are unable to attach to volume because old ones are already attached.

Error :

MountVolume.SetUp failed for volume "myservice-db" : mount command failed, status: Failure, reason: myservice-db is existed and is attached
@yasker
Copy link
Member

yasker commented Jan 16, 2018

It sounds like a problem with Kubernetes rolling update and persistent volumes which only supports Access Mode ReadWriteOnce (which is basically all the block storage solutions, including EBS, Google Persistent Disk, AzureDisk, see here)

In its current form, it cannot update pods with attached volume. According to rolling update design doc, Kubernetes will start the new pod first, then stop the old pod. Since the volume attached to the pod is RWO, it cannot be attached again to the new pod before it was detached from the old one first.

A similar issue was filed with Azure at kubernetes/kubernetes#52236 , with a recommendation to use AzureFile instead of AzureDisk.

@SacDin
Copy link
Author

SacDin commented Jan 17, 2018

So, there is no solution as of now ?

@yasker
Copy link
Member

yasker commented Mar 14, 2018

I just realize you can use statefulset instead of deployment, which is aware of the different PVCs associated with the pods. And it will do the right thing - stop the old one, then start the new one with the same volume.

@yasker yasker closed this as completed Mar 14, 2018
mantissahz pushed a commit to mantissahz/longhorn that referenced this issue Jul 27, 2022
Issues with volume detail page and node page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants