Created
June 26, 2020 16:36
-
-
Save IAmStoxe/37f84f0898e10e1a5da23793aada3e30 to your computer and use it in GitHub Desktop.
Delete all kubernetes pods by regex pattern with PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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