How to delete kubernetes pods (and other resources) in the system namespace

前端 未结 2 1335
无人共我
无人共我 2021-02-18 23:59

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 th

2条回答
  •  春和景丽
    2021-02-19 01:03

    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.

提交回复
热议问题