IT Panda Blog

Life is fantastic


  • Home

  • Tags

  • Categories

  • Archives

Kubernetes Namespace Stuck in status Terminating

Posted on 2019-11-10 In kubernetes

公司的DEV kubernetes环境需要重新搭建,在搭建的过程中,发现了一个有趣的现象,在尝试kubectl delete ns XX的时候, namespace一直卡在了Terminating的状态上.

在尝试了诸多方式后,只有直接调用ApiService的API才可行,具体方法:

1
2
3
4
5
kubectl get secrets
kubectl describe secrets xxx (anyone is good enough)
export TOKEN=(you get from above)
curl https://your-cluster-ip:6443/api/v1/namespaces --header "Authorization: Bearer $TOKEN" --insecure
curl -X PUT --data-binary @tmp.json https://your-cluster-ip:6443/api/v1/namespaces/the-namespace-you-wanto-delete/finalize -H "Content-Type: application/json" --header "Authorization: Bearer $TOKEN" --insecure

在取token的时候,任何一个secret都可以,只要可以访问apiservice即可.

附上references:
https://success.docker.com/article/kubernetes-namespace-stuck-in-terminating
https://github.com/kubernetes/kubernetes/issues/60807
https://github.com/kubernetes/kubectl/issues/151
https://medium.com/@newtondev/how-to-fix-kubernetes-namespace-deleting-stuck-in-terminating-state-5ed75792647e

kubernetes
Train Machine Learning models with MLflow, Deploy with Seldon
Elastic Search Too Many Open Files Error
Rex

Rex

25 posts
26 categories
49 tags
Links
  • GitHub
© 2019 – 2020 作者拥有版权,转载请注明出处