如何在系统名称空间中删除Kubernetes Pod(和其他资源) [英] How to delete kubernetes pods (and other resources) in the system namespace
问题描述
我错误地在系统名称空间"kube-system"中添加了一个pod.然后我无法删除此吊舱.它似乎还创建了一个副本集.每次删除这些项目时,都会重新创建它们.
I have by mistake added a pod in the system namespace "kube-system". And then I am unable to remove this pod. It also seems to have created a replica set. Every time delete these items, they are recreated.
似乎找不到删除属于系统名称空间"kube-system"的Pod或副本集的方法
Can't seem to find a way to delete pods or replica sets belonging to the system namespace "kube-system"
推荐答案
如果使用kubectl run
创建了Pod,则需要删除部署(创建副本集,并创建Pod).否则,即使您尝试手动删除它们,更高级别的控制器也将继续确保它们负责保持运行的对象始终在系统中.尝试使用kubectl get deployment --namespace=kube-system
来查看是否在kube-system
名称空间中进行了部署.如果是这样,删除它还应该删除副本集和您创建的Pod.
If you created the pod using kubectl run
, then you will need to delete the deployment (which created the replica set, which created the pod). Otherwise, the higher level controllers will continue to ensure that the objects they are responsible for keeping running stay around in the system, even if you try to delete them manually. Try kubectl get deployment --namespace=kube-system
to see if you have a deployment in the kube-system
namespace. If so, deleting it should also delete the replica set and the pods that you created.
这篇关于如何在系统名称空间中删除Kubernetes Pod(和其他资源)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!