「Kubernetes」- Namespace 卡在 Terminating 状态

解决方案

# kubectl get namespace <terminating-namespace> -o json >tmp.json

  {
      "apiVersion": "v1",
      "kind": "Namespace",
      "metadata": {
          "creationTimestamp": "2018-11-19T18:48:30Z",
          "deletionTimestamp": "2018-11-19T18:59:36Z",
          "name": "<terminating-namespace>",
          "resourceVersion": "1385077",
          "selfLink": "/api/v1/namespaces/<terminating-namespace>",
          "uid": "b50c9ea4-ec2b-11e8-a0be-fa163eeb47a5"
      },
      "spec": {
         "finalizers": []
      },
      "status": {
          "phase": "Terminating"
      }
  }
  
kubectl proxy

curl -k -H "Content-Type: application/json" -X PUT --data-binary @tmp.json http://127.0.0.1:8001/api/v1/namespaces/<terminating-namespace>/finalize

临时记录

删除其他资源:

kubectl -n rook-ceph patch cephclusters.ceph.rook.io rook-ceph -p '{"metadata":{"finalizers": []}}' --type=merge

参考文献

A namespace is stuck in the Terminating state – IBM Documentation
rook-ceph stuck in Terminating state : unable to delete · Issue #2668 · rook/rook · GitHub