Kubernetes pod gets recreated when deleted

后端 未结 17 1051
清酒与你
清酒与你 2020-12-12 10:25

I have started pods with command

$ kubectl run busybox --image=busybox --restart=Never --tty -i --generator=run-pod/v1

Something went wrong

17条回答
  •  不思量自难忘°
    2020-12-12 10:44

    You need to delete the deployment, which should in turn delete the pods and the replica sets https://github.com/kubernetes/kubernetes/issues/24137

    To list all deployments:

    kubectl get deployments --all-namespaces
    

    Then to delete the deployment:

    kubectl delete -n NAMESPACE deployment DEPLOYMENT
    

    Where NAMESPACE is the namespace it's in, and DEPLOYMENT is the name of the deployment.

    In some cases it could also be running due to a job or daemonset. Check the following and run their appropriate delete command.

    kubectl get jobs
    
    kubectl get daemonsets.app --all-namespaces
    
    kubectl get daemonsets.extensions --all-namespaces
    

提交回复
热议问题