Force delete a stuck pod

Removes a pod stuck in Terminating right away; use with care

kubectl delete pod <name> -n <ns> --grace-period=0 --force

tool
kubectl73 commands
tags
podsdebug

More kubectl commands

  • kubectl cp <ns>/<pod>:/remote/path ./local-path

    Copies a file from a running container to your machine

  • kubectl cordon <node>

    Marks the node as unschedulable, so no new pods start there

  • kubectl drain <node> --ignore-daemonsets --delete-emptydir-data

    Safely evicts all pods from the node before maintenance

  • kubectl edit deployment/<name> -n <ns>

    Opens the resource in $EDITOR and applies the changes when you save

  • kubectl auth can-i list pods --as=system:serviceaccount:<ns>:<sa> -n <ns>

    Checks if a ServiceAccount can list pods; change the verb and resource to check other actions

all 73 kubectl commands