namespace Terminating ☸️ Kubernetes

Namespace stuck in Terminating

A deleted namespace never disappears because some resource inside it, or the namespace’s own finalizer, can’t be cleaned up.

Seen on: Kubernetes

Meaning

Namespace deletion waits until every object inside is gone. Unavailable aggregated APIs (metrics.k8s.io, a removed webhook/CRD controller) or custom resources with finalizers block it. kubectl describe ns shows NamespaceContentRemaining / NamespaceFinalizersRemaining conditions.

Common causes

  • CRD instances with finalizers whose controller was uninstalled
  • Unavailable APIService (e.g. v1beta1.metrics.k8s.io)
  • Stuck PVCs/pods inside

⚡ Quick fix

  1. kubectl describe ns to see what remains
  2. Fix or delete broken APIServices
  3. Remove finalizers from leftover resources (only if their controller is gone)

Detailed fix by platform

Kubernetes

  1. bash
    kubectl describe ns old-app | sed -n '/Conditions/,$p'
    kubectl get apiservice | grep False
    kubectl api-resources --verbs=list --namespaced -o name | xargs -n1 kubectl get -n old-app --ignore-not-found --show-kind

How to diagnose

  1. Conditions — What content/finalizers remain?
  2. APIs — Unavailable APIServices?
  3. CRDs — Controllers still installed?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.