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 | finalizers: |
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 | kubectl path <crd type name> <crd resource name> \ |
The background delete
command can be forcely killed at end or after some
period of time if it does not fulfill.