Kubernetes - delete all jobs in bulk

Overdrivr picture Overdrivr · Apr 28, 2017 · Viewed 21k times · Source

I can delete all jobs inside a custer running

kubectl delete jobs --all 

However, jobs are deleted one after another which is pretty slow (for ~200 jobs I had the time to write this question and it was not even done).

Is there a faster approach ?

Answer

jaydeland picture jaydeland · Jun 25, 2018

It's a little easier to setup an alias for this bash command:

kubectl delete jobs `kubectl get jobs -o custom-columns=:.metadata.name`