Deleting namespace stuck at "Terminating" state


  • kubectl cluster-info
                       Kubernetes master is running at https://localhost:6443
                       KubeDNS is running at https://localhost:6443/api/v1/namespaces/kube-                                                 system/services/kube-dns:dns/proxy

      To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
  • now run the kube-proxy
  • kubectl proxy 
                      Starting to serve on 127.0.0.1:8001

                      save the ID to delete it later on :)

  • find your name-space that decided no to be deleted :) for us it will be cattle-system
  • kubectl get ns
                      cattle-system Terminating 1d
  • kubectl get namespace cattle-system -o json > tmp.json
  • edit the file and remove the finalizers
                       },
                       "spec": {
                      "finalizers": [
                                      "kubernetes"
                       ]
                       },

   after editing it should look like this +1

                      },
                      "spec": {
                      "finalizers": [
                      ]
                      },

curl -k -H "Content-Type: application/json" -X PUT --data-binary @tmp.json https://127.0.0.1:8001/api/v1/namespaces/annoying-namespace-to-delete/finalize

Comments

Popular posts from this blog

AWS Auto AMI(Instance) backup across all region

Digital-ocean-auto volume backup

How to Set Up an Nginx Ingress with Cert-Manager on DigitalOcean Kubernetes