I use this space to jot down quick notes sometimes, so I don’t have to go search for it every time. Today’s quick note is about how to kill resources on Kubernetes that are stuck terminating.
First way is to check if the resource deletion is being held back by a finalizer:
kubectl edit resourceType/name
Look for the finalizers
property and change it to an empty array
finalizers: []
If a pod is stuck, it can be force deleted by:
kubectl delete pod/name --grace-period=0 --force