-
Notifications
You must be signed in to change notification settings - Fork 174
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
Detach failure if node is removed from cluster #83
Comments
Thanks for the report. It's hard to judge what's right in this case.
That's very implementation dependent. Different drivers will do different things, usage of empty string is not described in CSI spec. It SHALL be "ID returned by One thing I could perhaps do here is to store the node ID in VolumeAttachment annotation. |
Thanks for quick response. Yes it is best not to alter the spec, so yes that my proposal is not possible. I trust that you find some elegant way to solve this. |
@jsafrane I like the idea of storing the node ID in the |
Yesterday our Kubernetes CSI workgroup decided that we'll put Node ID into VolumeAttachment annotation during attach / ControllerPublish. Downside of this approach is that it's not updated when a driver gets updated and starts reporting different NodeID than before. The driver must accept old Node ID in this case. /assing |
/assign |
@davidz627, sorry, I did not see your comment (github outage?) I could add a field for it, still I have bad feeling about it. If a driver is updated while a volume is attached, we should use the new NodeID. Using an old Node ID from VolumeAttachment annotation or field feels like workaround. |
I see now from your PR that this is a backup only when the Node is gone. I did not realize that before, annotation seems like the right way here. |
Problem
If node with volumes managed by CSI plugin is removed from Kubernetes cluster before volumes are detached then detaching will newer succeed.
function csiDetach (in pkg/controller/csi_handler.go +296 (master)) is failing always because it tries to get nodeID from kubernetes api and as node does not anymore exists it fails.
Environment
This behavior was produced in Openstack with Cinder-CSI plugin during scale down of worker nodes. As there Openstack cloud provider deleted the node from Kubernetes cluster when it found out that the virtual machine did not existed anymore.
Expected Behavior
Volume detach should not automatically fail if node where it was attached isn't anymore part of the kubernetes cluster. It should still try to detach the volume. The nodeID could be passed as empty string and then the actual detaching implementation could then decide if it possible to detach the volume or if it might already be detached.
In case of Openstack volumes are automatically detached when virtual machine is deleted.
The text was updated successfully, but these errors were encountered: