Kubernetes tip: Force delete terminating pod
How to get rid of pods that are stuck in the "Terminating" state
Here’s a really quick tip about an annoying Kubernetes issue I’ve encountered from time to time while updating my deployments.
Sometimes, for obscure reasons, pods get stuck in the “Terminating” state. There’s an open issue about this on Github.
It can apparently happen because of a lack of memory, timeouts, issues with volumes, etc. Since the issue is not resolved, there are only workarounds at this time.
The one that has worked for me is the following:
kubectl delete pods <pod> --grace-period=0 --force
This kills the problematic pods (pretty violently). Personally I only do this on my development workstation, so it’s all right. But be careful if you use this on a production system ;-)
That's it for today! ✨
About Sébastien
I'm Sébastien Dubois, and I'm on a mission to help knowledge workers escape information overload. After 20+ years in IT and seeing too many brilliant minds drowning in digital chaos, I've decided to help people build systems that actually work. Through the Knowii Community, my courses, products & services and my Website, I share practical and battle-tested systems. You can follow me on X 🐦 and on BlueSky 🦋.
I am an author, founder, and coach. I write books and articles about Knowledge Work, Personal Knowledge Management, Note-taking, Lifelong Learning, Personal Organization, and Zen Productivity. I also craft lovely digital products.
If you want to follow my work, then become a member and join our community.
Ready to get to the next level?
If you're tired of information overwhelm and ready to build a reliable knowledge system:
- 🎯 Join Knowii and get access to my complete knowledge transformation system
- 📚 Take the Course and Master Knowledge Management
- 🚀 Start with a Rock-solid System: the Obsidian Starter Kit
- 🦉 Get Personal Coaching: Work with me 1-on-1
- 🛒 Check out my other products and services. These will give you a rock-solid starting point for your note-taking and Knowledge Management efforts