Skip to content

Instantly share code, notes, and snippets.

@ezhuravlev
Created October 31, 2020 20:12
Show Gist options
  • Save ezhuravlev/c1c30b60db2a7a577b8df98033b22671 to your computer and use it in GitHub Desktop.
Save ezhuravlev/c1c30b60db2a7a577b8df98033b22671 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo "Deleting all jobs (in parallel - it can trash CPU)"
kubectl get jobs --all-namespaces | sed '1d' | awk '{ print $2, "--namespace", $1 }' | while read line; do
echo "Running with: ${line}"
kubectl delete jobs ${line} &
sleep 0.05
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment