I am looking for an option in kubernetes API by which I can delete the running pod forcefully. In short I am searching API for the below command-kubectl delete pod --grace-period=0 --force <pod_name>
.
I was referring kube API here- https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#delete-pod-v1-core
I run your command kubectl delete pod --grace-period=0 --force <pod_name> --v 10
and notice the output logs and found following
$ curl -k -v -XDELETE -H "Accept: application/json" -H "Content-Type: application/json" http://127.0.0.1:8001/api/v1/namespaces/default/pods/security-context-demo --data '{"gracePeriodSeconds":0,"propagationPolicy":"Background"}'