How to Force Delete Kubernetes Namespaces

Riyaz Walikar

~ 1 min read

Quick post that shows with examples, how to delete a Kubernetes namespace that is forever stuck on 'Terminating' stage.

Introduction

Problem Statement

kubectl get ns secure-middleware

Solution

vi tmp.json

kubectl proxy
curl -k -H "Content-Type: application/json" -X PUT --data-binary @tmp.json http://127.0.0.1:8001/api/v1/namespaces/NAMESPACE-NAME/finalize

;