Skip to content

Commit a6bc416

Browse files
Add note for deleted job and nits
Signed-off-by: Aldo Culquicondor <[email protected]>
1 parent 0fe1d55 commit a6bc416

File tree

1 file changed

+13
-4
lines changed
  • keps/sig-apps/2307-job-tracking-wihout-lingering-pods

1 file changed

+13
-4
lines changed

keps/sig-apps/2307-job-tracking-wihout-lingering-pods/README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ SIG Architecture for cross-cutting KEPs).
7676
- [API changes](#api-changes)
7777
- [Algorithm](#algorithm)
7878
- [Deleted Pods](#deleted-pods)
79+
- [Deleted Jobs](#deleted-jobs)
7980
- [Pod adoption](#pod-adoption)
8081
- [Test Plan](#test-plan)
8182
- [Graduation Criteria](#graduation-criteria)
@@ -221,7 +222,7 @@ type JobStatus struct {
221222
type UncountedTerminatedPods struct {
222223
// Succeeded holds UIDs of succeeded Pods.
223224
Succeeded []types.UID
224-
// Succeeded holds UIDs of failed Pods.
225+
// Failed holds UIDs of failed Pods.
225226
Failed []types.UID
226227
}
227228
```
@@ -240,7 +241,9 @@ cycle.
240241
1. The Job controller calculates the number of succeeded Pods as the sum of:
241242
- `.status.succeeded`,
242243
- the size of `job.status.uncountedTerminatedPods.succeeded` and
243-
- the number of finished Pods that are not in `job.status.uncountedTerminatedPods.succeeded`.
244+
- the number of finished Pods that are not in `job.status.uncountedTerminatedPods.succeeded`
245+
and have a finalizer.
246+
244247
This number informs the creation of missing Pods to reach `.spec.completions`.
245248
The controller creates Pods for a Job with the finalizer
246249
`batch.kubernetes.io/job-completion`.
@@ -257,8 +260,8 @@ cycle.
257260
- have no finalizer, or
258261
- were removed from the system.
259262
The counts increment the `.status.failed` and `.status.succeeded` and clears
260-
counted Pods from `.status.uncountedPodsUIDs` lists. The controller sends a
261-
status update.
263+
counted Pods from `.status.uncountedTerminatedPods` lists. The controller
264+
sends a status update.
262265

263266
Steps 2 to 4 might deal with a potentially big number of Pods. Thus, status
264267
updates can potentially stress the kube-apiserver. For this reason, the Job
@@ -291,6 +294,12 @@ solve.
291294
However, if the Job controller deletes the Pod (when parallelism is decreased,
292295
for example), the controller removes the finalizer before deleting it. Thus,
293296
these deletions don't count towards the failures.
297+
298+
### Deleted Jobs
299+
300+
When a user or another controller deletes a Job, the job controller scans
301+
associated Pods and removes finalizers from them without updating any Job
302+
status.
294303

295304
### Pod adoption
296305

0 commit comments

Comments
 (0)