Monday, April 9, 2018

force delete a pod in openshift (kubernetes)

For kubernetes:

kubectl delete pod --grace-period=0 --force --namespace <NAMESPACE> <PODNAME>

and for openshift

oc delete pod --grace-period=0 --force --namespace <NAMESPACE> <PODNAME>

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.

This command may be use for deleting pods whose status is Unknown.
As the output says, the pod may still be running. 

No comments:

Post a Comment