Recover a Stuck Namespace Termination (Finalizers)
Advanced · 30 minutes · 5 tasks, checked automatically · 100 points
In this advanced troubleshooting lab you will deliberately create a namespace that gets permanently stuck in the Terminating state — a very common real-world incident caused by custom finalizers that have no controller to process them. You will diagnose why the namespace will not delete, safely patch away the blocking finalizers, and confirm the namespace is fully gone. Along the way you will also practice the same technique on individual resources (a ConfigMap with a custom finalizer) so you understand the pattern at both the resource and namespace level.
What you’ll learn
- Understand how Kubernetes finalizers block resource and namespace deletion
- Diagnose a stuck Terminating namespace by inspecting its metadata
- Patch finalizers off resources and namespaces to recover from the stuck state
How this lab works
- Start the lab: One click starts a real Kubernetes cluster on your computer (kind), with kubectl ready in a toolbox terminal.
- Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work reads your live cluster and says, task by task, what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Cluster: A real Kubernetes cluster on your computer (kind)
- Kubernetes: 1.34.8
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
- A kind cluster created in the Kubernetes Playground
Topics: kubernetes, troubleshooting, finalizers, namespaces, terminating, kubectl, incident-response, garbage-collection
Create a free account to start this lab.
Keep going
- Debug a Broken Cluster: CrashLoopBackOff, ImagePullBackOff, and Pending Pods
- Troubleshoot Failed PVC Binding and Volume Mounts
- Inject Faults and Test Resilience with Chaos Mesh
- Debug a Failing Admission Webhook Blocking All Deployments
- Diagnose Pending Pods: Scheduling and Insufficient Resources
- Fix CrashLoopBackOff: Logs, Exit Codes, and Probes