I have stuck resources after delete a jitsi stack in my master node. The only pending resources are this two statefullset.appsset
, no pods are running.
If I execute the command:
kubectl delete statefulsets shard-0-jvb -n jitsi --force --grace-period=0 --cascade=orphan
The console freezes for hours and resources are not removed.
Any other way to force the destroying process?
The stack was created with Kustomize.
Posting the answer as community wiki, feel free to edit and expand.
Stuck objects in general
Sometimes objects can't be deleted due to finalizer
(s), you will need to find them by viewing at the whole object e.g. kubectl get pod pod-name -o json
.
Then there are two options:
fix what prevents dependent object to be deleted (for instance it was metrics server - see another answer on SO)
if it's not possible to fix, then finalizer
should be removed manually by kubectl edit resource_type resouce_name
Stuck statefulsets
Kubernetes documentation has two parts related to deleting statefulsets (it's a bit more complicated since usually they have persistent volumes as well).
Useful links: