☸️ Kubernetes Management
Delete a Namespace stuck in Terminating
state
Terminating
stateIdentify the namespace that is stuck using
kubectl get namespaces
(this shall be$NAMESPACE
)Run the following to get the Namespace resource as JSON:
kubectl get namespace $NAMESPACE -o json > $NAMESPACE.json
Modify
$NAMESPACE.json
and set the property at.spec.finalizers
to[]
Run the following to apply the Namespace resource:
kubectl replace --raw "/api/v1/namespaces/$NAMESPACE/finalize -f ./$NAMESPACE.json
Your Namespace resource should be deleted, check with
kubectl get namespaces
Last updated
Was this helpful?