From 5799a8cd48707968e8a2e5e7cf12982b56656b18 Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Sat, 16 Oct 2021 13:22:28 +0100 Subject: [PATCH] Add immediate pod deletion to cheat sheet --- content/en/docs/reference/kubectl/cheatsheet.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/content/en/docs/reference/kubectl/cheatsheet.md b/content/en/docs/reference/kubectl/cheatsheet.md index 511d8c9c7d..5ea50e9ca6 100644 --- a/content/en/docs/reference/kubectl/cheatsheet.md +++ b/content/en/docs/reference/kubectl/cheatsheet.md @@ -289,10 +289,11 @@ kubectl scale --replicas=5 rc/foo rc/bar rc/baz # Scale multip ## Deleting resources ```bash -kubectl delete -f ./pod.json # Delete a pod using the type and name specified in pod.json -kubectl delete pod,service baz foo # Delete pods and services with same names "baz" and "foo" -kubectl delete pods,services -l name=myLabel # Delete pods and services with label name=myLabel -kubectl -n my-ns delete pod,svc --all # Delete all pods and services in namespace my-ns, +kubectl delete -f ./pod.json # Delete a pod using the type and name specified in pod.json +kubectl delete pod unwanted --now # Delete a pod with no grace period +kubectl delete pod,service baz foo # Delete pods and services with same names "baz" and "foo" +kubectl delete pods,services -l name=myLabel # Delete pods and services with label name=myLabel +kubectl -n my-ns delete pod,svc --all # Delete all pods and services in namespace my-ns, # Delete all pods matching the awk pattern1 or pattern2 kubectl get pods -n mynamespace --no-headers=true | awk '/pattern1|pattern2/{print $1}' | xargs kubectl delete -n mynamespace pod ```