Kubernetes CRD Deletion Hang

It is possible that the deletion of k8s CRD hang for indefinite time due to dependency issue.

If it happens, manually edit the CRD and empty the finalizers value block:

1
2
finalizers:
- xxx.finalizer.networking.gke.io

For programmatic way, what I did is running delete kubectl command in background and followed by a kubectl patch command to remove the finalizer block, for example the patch command:

1
2
3
kubectl path <crd type name> <crd resource name> \
{"metadata":{"finalizers":[]}} \
--type merge

The background delete command can be forcely killed at end or after some period of time if it does not fulfill.

0%