Skip to content

Instantly share code, notes, and snippets.

@IAmStoxe
Created June 26, 2020 16:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IAmStoxe/37f84f0898e10e1a5da23793aada3e30 to your computer and use it in GitHub Desktop.
Save IAmStoxe/37f84f0898e10e1a5da23793aada3e30 to your computer and use it in GitHub Desktop.
Delete all kubernetes pods by regex pattern with PowerShell
$NS="NameSpace"; $Pattern="amass"; & kubectl get pods -n $NS | % {"$_" -Split " "} | Select-String -Pattern $Pattern | %{ & kubectl delete -n $NS pod $_ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment