Skip to content

Commit 48a2a13

Browse files
authored
Merge pull request #29478 from ravisantoshgudimetla/patch-12
Recommend using TTL field in job
2 parents 2040c81 + 1afd786 commit 48a2a13

File tree

1 file changed

+19
-0
lines changed
  • content/en/docs/concepts/workloads/controllers

1 file changed

+19
-0
lines changed

content/en/docs/concepts/workloads/controllers/job.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,25 @@ If the field is set to `0`, the Job will be eligible to be automatically deleted
346346
immediately after it finishes. If the field is unset, this Job won't be cleaned
347347
up by the TTL controller after it finishes.
348348

349+
{{< note >}}
350+
It is recommended to set `ttlSecondsAfterFinished` field because unmanaged jobs
351+
(Jobs that you created directly, and not indirectly through other workload APIs
352+
such as CronJob) have a default deletion
353+
policy of `orphanDependents` causing Pods created by an unmanaged Job to be left around
354+
after that Job is fully deleted.
355+
Even though the {{< glossary_tooltip text="control plane" term_id="control-plane" >}} eventually
356+
[garbage collects](/docs/concepts/workloads/pods/pod-lifecycle/#pod-garbage-collection)
357+
the Pods from a deleted Job after they either fail or complete, sometimes those
358+
lingering pods may cause cluster performance degradation or in worst case cause the
359+
cluster to go offline due to this degradation.
360+
361+
You can use [LimitRanges](/docs/concepts/policy/limit-range/) and
362+
[ResourceQuotas](/docs/concepts/policy/resource-quotas/) to place a
363+
cap on the amount of resources that a particular namespace can
364+
consume.
365+
{{< /note >}}
366+
367+
349368
## Job patterns
350369

351370
The Job object can be used to support reliable parallel execution of Pods. The Job object is not

0 commit comments

Comments
 (0)