LoginSignup
0
0

[Troubleshooting]Kubernetesのnamespacesが消えないときの対処法

Posted at
helm uninstall 2.0.0 -n jupyterhub

などで不要なものを消そうとおもってもSTATUS Terminatingと表示されて消せないとき

まずすべきもの

対象の全podとserviceを削除してからuninstallする
しないと干渉する

kubectl delete networkpolicy --all -n ${name}
kubectl delete pods --all -n ${name}

それでもごみが残ってしまうとき

kubectl get namespace ${name} -o json>t.json

でt.jsonに情報を出力した後、内部のspec finalizersを空欄にする

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

その後kubernetesに反映させる

kubectl proxy &
curl -k -H "Content-Type: application/json" -X PUT --data-binary @t.json http://127.0.0.1:8001/api/v1/namespaces/${name}/finalize

参考

Command to delete all pods in all kubernetes namespaces

How to Delete a Kubernetes Namespace {Standard & Force Removal}

[小ネタ]Kubernetesで消せないNamespaceが発生した場合の対処方法 | DevelopersIO

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0