5

删除无法删掉的namespace

 1 year ago
source link: https://chanjarster.github.io/post/k8s/delete-namespace/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

删除无法删掉的namespace

2022-08-04 1 分钟阅读 k8s

删除一直删不掉的Namespace。

参考资料:https://aws.amazon.com/cn/premiumsupport/knowledge-center/eks-terminated-namespaces/

1)保存一个与以下类似的 JSON 文件:

kubectl get namespace <terminating-namespace> -o json > tempfile.json

2)编辑该 JSON 文件,找到 finalizer 数组,清空它。

3)要应用更改,请运行一个与以下类似的命令:

kubectl replace --raw "/api/v1/namespaces/<terminating-namespace>/finalize" -f ./tempfile.json

4)验证是否已经删除了正在终止的命名空间:

kubectl get namespaces

对所有卡在 Terminating(正在终止)状态的其他命名空间重复这些步骤。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK