5

一键强制删除k8s集群中所有Delete状态的pv

 2 years ago
source link: https://www.oschina.net/question/2624181_2325021
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.
neoserver,ios ssh client

一键强制删除k8s集群中所有Delete状态的pv

fastjrun 发布于 01/27 16:23
阅读 117
kubectl get pv|grep Delete| awk '{print $1}'| xargs kubectl delete pv --force --grace-period=0

这个命令有可能还是删不掉,那就再来一个

kubectl get pv|grep Delete| awk '{print $1}'| xargs kubectl patch pv -p '{"metadata": {"finalizers": null}}'

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK