To delete pods in Kubernetes, you can use the kubectl delete pod command followed by the name of the pod you want to delete. Here are a few examples:
-
Delete a specific pod:
kubectl delete pod <pod-name> -
Delete multiple pods:
kubectl delete pod <pod-name-1> <pod-name-2> -
Delete all pods with a specific label:
kubectl delete pods -l <label-key>=<label-value> -
Delete all pods in a namespace:
kubectl delete pods --all -n <namespace> -
Force delete a pod (if it is stuck in a terminating state):
kubectl delete pod <pod-name> --grace-period=0 --force
Make sure to replace <pod-name>, <label-key>, <label-value>, and <namespace> with the appropriate values for your use case.
