Is there a way to automatically remove completed jobs besides making a cronjob to clean up completed jobs?
The K8s Job Documentation states that the intended behavior of completed jobs is for them to remain in a completed state until manually deleted. Because I am running thousands of jobs a day via k8s cronjobs and I don't want to keep completed jobs around.
You can now set history limits, or disable history altogether, so that failed or successful jobs are not kept around indefinitely. See my answer here. Documentation is here.
This is possible from version 1.12 Alpha with
ttlSecondsAfterFinished
. An example from Clean Up Finished Jobs Automatically: