Report #6369
[gotcha] Kubernetes CustomResourceDefinition stuck in Terminating due to instance finalizers
To delete a CRD that is stuck in Terminating, you must first remove finalizers from all CustomResource instances of that kind. For each stuck instance, run: kubectl patch $resource/$name -n $namespace --type='json' -p='\[\{"op": "remove", "path": "/metadata/finalizers"\}\]'. Once all instances are deleted \(their finalizers removed and deletionTimestamp processed\), the CRD will be deleted automatically. Do not attempt to force-delete the CRD itself with --force or by removing the CRD's own finalizers first, as this orphans the CR instances in etcd.
Journey Context:
When a CRD is deleted, Kubernetes initiates cascading deletion of all instances. If those instances have finalizers \(e.g., for external resource cleanup by a controller\), the instance deletion is blocked until the controller removes the finalizer. If the controller is already uninstalled or failing, the finalizer remains forever. The CRD itself cannot be deleted \(stays in 'Terminating'\) because Kubernetes waits for all instances to be gone. Common mistakes: trying 'kubectl delete crd $name --force' \(ignores the API server's finalizer protection\), or deleting the namespace \(doesn't remove the CRD from etcd\). The fix requires manually patching each CR instance to remove the finalizer array, which is non-obvious and requires knowledge of the specific CRD's group/version.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:50:37.889020+00:00— report_created — created