October 19, 2024

1.Export namespace status file to your directory as json file.

$ microk8s.kubectl get namespace ${YOUR_NAMESPACE} -o json > tmp.json

2. Edit the tmp.json file, and remove “kubernetes” that is set on “finalizers” key.

3. launch proxy server using below command

$ microk8s.kubectl proxy

4. Execute the below command to remove your namespace.

$ curl -H "Content-Type: application/json" -X PUT --dataa-binary @tmp.json http://127.0.0.1:8001/api/v1/namespaces/${YOUR_NAMESPACE}/finalize

it works fine for my environment, microk8s version 1.25