银川建设网站公司,邮箱如何注册企业邮箱,织梦网站如何做伪静态,wordpress 换域名插件背景#xff1a; 在日常paas平台运维工作中需要对rancher平台进行巡检的工作#xff0c;在巡检时发现在rancher管理界面无法删除异常的pod服务#xff0c; 处理#xff1a; 像这样的情况就是k8s集群的pod无法通过默认的方式去删除掉pod服务#xff0c;这时候只能是手工强制…背景 在日常paas平台运维工作中需要对rancher平台进行巡检的工作在巡检时发现在rancher管理界面无法删除异常的pod服务 处理 像这样的情况就是k8s集群的pod无法通过默认的方式去删除掉pod服务这时候只能是手工强制性去删除pod服务。 注rancher平台怎么切换到kubelet命名行界面指导 强制删除pod服务有两种方式
方式一 先查询出来需要强制删除掉pod服务然后再执行强制删除。 查询 kubectl get pods -n dit-sup | grep Terminating
dit-sup-upload-6fd555686c-zxz9h 1/1 Terminating 0 167d
强制删除 kubectl delete pod dit-sup-upload-6fd555686c-zxz9h --force --grace-period0 -n dit-sup
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
pod dit-sup-upload-6fd555686c-zxz9h force deleted
方式二 查询出来整个集群所有异常的pod服务然后一次性全部删除掉 查询 kubectl get pod -A |egrep -v Run|Completed|Crea|NAMESPACE|NAME |awk {print $1,$2}
ness-portal ness-portal-reservoir-7d8b49f6-h6xv4
default intake-project2-646df8d457-p7jlg
vwts cloud-platform-buiness-54b546577c-xlpwq
删除 kubectl get pod -A |egrep -v Run|Completed|Crea|NAMESPACE|NAME |awk {print $1,$2}|xargs -n2 kubectl delete pod --grace-period0 --force -n
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
pod ness-portal-reservoir-7d8b49f6-h6xv4 force deleted
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
pod intake-project2-646df8d457-p7jlg force deleted
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
pod cloud-platform-buiness-54b546577c-xlpwq force deleted 验证 kubectl get pod -A |egrep -v Run|Completed|Crea|NAMESPACE|NAME |awk {print $1,$2}
总结 在日常的paas平台运维工作会经常遇见大量的pod运行异常的情况也存在对pod服务进行强制删除的操作可以参考如上的。