Kubernetes namespace terminating

Source: Internet
Author: User
Tags etcd


1.kubectl get namespace annoying-namespace-to-delete -o json > tmp.json
Then edit Tmp.json and remove"kubernetes"

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

And it should delete your namespace,

2.Kubernetes forced to delete the terminating state of the pod,namespace manually built kubernetes, using the native dashboard, feel uncomfortable, The Administration Web page for Kubernetes was then proxied using Rancher2.0. For unknown reasons, the rancher service cannot be enabled, and the rancher dependent namespace (Cattle-system) is removed, and the state is always terminating. This is the background. Workaround:
    1. You can use the Force Delete command in Kubectl
      # Delete pod
      Kubectl Delete pod podname--force--grace-period=0

      # Delete Namespace
      Kubectl Delete namespace NamespaceName--force--grace-period=0
    1. If the above method cannot be deleted, the second method can be used to delete the source data directly from the ETCD ( This is one of the most violent ways, we do not recommend the direct operation of the data in the ETCD, before the operation please confirm that you know what you are doing. )
      # Remove the pod named pod-to-be-deleted-0 under the default namespace
      Etcdctl_api=3 Etcdctl del/registry/pods/default/pod-to-be-deleted-0

      # Delete namespace that need to be deleted
      Etcdctl Del/registry/namespaces/namespacename

Kubernetes namespace terminating

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.