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

Machine controller blocks delete when named dsvolumes are attached #582

Open
dlipovetsky opened this issue Jan 16, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@dlipovetsky
Copy link
Contributor

Describe the bug

As of cdd179b, the Machine controller blocks delete when named disks are attached to the VM. This prevents Machine delete in the following cases:

(a) The Cluster is being deleted, and the Node corresponding to the Machine is not drained (by design).
(b) The kubelet running on the Machine's corresponding VM is not responding, and therefore the CSI driver cannot unmount detach the disks from the VM.
(c) The CSI driver is malfunctioning.

/cc @erkanerol

Reproduction steps

  1. Create CAPVCD cluster.
  2. Deploy VCD CSI.
  3. Create StorageClass.
  4. Create Pod that uses PVC.
  5. Delete Machine corresponding to the Node where the Pod is scheduled.
    ...

Expected behavior

The Machine controller should allow delete when named disk volumes are attached to the corresponding VM.

This means that the Machine controller should detach the named disk volumes on delete. Right now, to unblock the delete, some other API client (e.g. the CSI driver, or a tenant admin) must detach the disks from the VM. Please note that the two actions are equivalent with respect to data durability in scenarios (b) and (c).

Although we could try to address scenario (a) by changing Cluster API, the change would be limited by the design of drain. Namely, drain does not evict any Pods managed by a DaemonSet. So, if such a Pod uses persistent storage, the named disk would not be detached from the VM. In any case, graceful termination is not a guarantee, and applications cannot expect it.

For comparison, the AWS, Azure, GCP, and vSphere infrastructure providers do not block Machine delete in this case.

Additional context

Original discussion: https://kubernetes.slack.com/archives/C04JFT7GDGR/p1681728672112079

@dlipovetsky dlipovetsky added the bug Something isn't working label Jan 16, 2024
@balbiv
Copy link

balbiv commented May 13, 2024

Also for automated machine management it will be very helpful if the machine controller allows machine deletion when named disks are attached. This allows to (auto) recover from kubelet/CSI driver failures, or any other scenario where draining of the node is not possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants