☸️ 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.jsonModify
$NAMESPACE.jsonand set the property at.spec.finalizersto[]Run the following to apply the Namespace resource:
kubectl replace --raw "/api/v1/namespaces/$NAMESPACE/finalize -f ./$NAMESPACE.jsonYour Namespace resource should be deleted, check with
kubectl get namespaces
Last updated
Was this helpful?