Skip to content

Instantly share code, notes, and snippets.

@liangway
Last active April 16, 2020 03:40
Show Gist options
  • Save liangway/d59fa92c32aa9b927c348e140099915b to your computer and use it in GitHub Desktop.
Save liangway/d59fa92c32aa9b927c348e140099915b to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
for j in $(kubectl get jobs -o custom-columns=:.metadata.name)
do
if [[ $j == YOUR-JOB-PREFIX* ]] ; #Change the job prefix to delete other jobs
then
echo Delete job $j
kubectl delete jobs $j &
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment