Machine stuck in Deleting. Is removing the finalizer safe?
No. Removing the finalizer from a Machine stuck in Deleting is not safe. The machine.cluster.x-k8s.io finalizer holds the Machine until the node is drained and the server is cleaned up at Hetzner. Without it the object disappears, and the server can stay behind in your Hetzner account, still running and still billed.
A Machine that hangs in Deleting is waiting for something. Usually it is one of these:
- The Machine or its Cluster is paused. A paused Machine is not deleted until you remove the
cluster.x-k8s.io/pausedannotation or setspec.pausedon the Cluster back tofalse. - The drain is still running. The pool's
nodeDrainTimeoutSecondslimits the drain, so with the default it does not block for long. If you set it to0, the drain waits without limit, for example on a PodDisruptionBudget. - On a control-plane Machine, the etcd member is removed before the server goes away. This step cannot finish while etcd is unhealthy.
- The HCloudMachine or HetznerBareMetalMachine cannot finish its own cleanup, for example because the Hetzner API returns an error.
Check the conditions on the Machine and the events on the HCloudMachine or HetznerBareMetalMachine behind it. Fix what they name, and the delete continues on its own. If the cause is not clear, contact support before you remove a finalizer, especially on a production cluster. It is easier to help while the Machine object still exists.
To take a node out of a cluster the normal way, follow Remove a specific node. For the drain setting, see Can we set the drain timeout and a pause between nodes?
Related questions
