Kubernetes Job: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 4: Line 4:


=Overview=
=Overview=
=Organizatorium=
=Clean up Finished Jobs Automatically=
==Clean up Finished Jobs Automatically==
{{External|https://kubernetes.io/docs/concepts/workloads/controllers/job/#clean-up-finished-jobs-automatically}}
{{External|https://kubernetes.io/docs/concepts/workloads/controllers/job/#clean-up-finished-jobs-automatically}}
Jobs that have finished, either "Complete" or "Failed" can be automatically be deleted by using the TTL mechanism provided by the [TTL Controller ]. Set the <code>.spec.ttlSecondsAfterFinished</code> field in the job manifest:
<syntaxhighlight lang='yaml'>
apiVersion: batch/v1
kind: Job
spec:
  ttlSecondsAfterFinished: 100
  ...
</syntaxhighlight>

Revision as of 03:26, 30 April 2022

Internal

Overview

Clean up Finished Jobs Automatically

https://kubernetes.io/docs/concepts/workloads/controllers/job/#clean-up-finished-jobs-automatically

Jobs that have finished, either "Complete" or "Failed" can be automatically be deleted by using the TTL mechanism provided by the [TTL Controller ]. Set the .spec.ttlSecondsAfterFinished field in the job manifest:

apiVersion: batch/v1
kind: Job
spec:
  ttlSecondsAfterFinished: 100
  ...