diff --git a/README.md b/README.md index 808a0bb..4105048 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Kubernetes is an open‑source platform that automates the deployment, scaling, - [Create an pod](#create-an-pod) - [Get Pod](#get-pod) - [delete Pod](#delete-pod) + - [delete all pods with prefix](#delete-all-pods-with-prefix) - [OOMKilled](#oomkilled) - [Attach to an pod](#attach-to-an-pod) - [Run command on pod](#run-command-on-pod) @@ -247,6 +248,15 @@ echo $POD_NAME kubectl delete pod -n appNamespace -l app=myAppName ``` +### delete all pods with prefix + +``` bash +kubectl delete pod -n \ + $(kubectl get pods -n \ + -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' \ + | grep '^PREFIX') +``` + ### OOMKilled **list all OOMKilled:**