@@ -76,6 +76,7 @@ SIG Architecture for cross-cutting KEPs).
76
76
- [ API changes] ( #api-changes )
77
77
- [ Algorithm] ( #algorithm )
78
78
- [ Deleted Pods] ( #deleted-pods )
79
+ - [ Deleted Jobs] ( #deleted-jobs )
79
80
- [ Pod adoption] ( #pod-adoption )
80
81
- [ Test Plan] ( #test-plan )
81
82
- [ Graduation Criteria] ( #graduation-criteria )
@@ -221,7 +222,7 @@ type JobStatus struct {
221
222
type UncountedTerminatedPods struct {
222
223
// Succeeded holds UIDs of succeeded Pods.
223
224
Succeeded []types.UID
224
- // Succeeded holds UIDs of failed Pods.
225
+ // Failed holds UIDs of failed Pods.
225
226
Failed []types.UID
226
227
}
227
228
```
@@ -240,7 +241,9 @@ cycle.
240
241
1 . The Job controller calculates the number of succeeded Pods as the sum of:
241
242
- ` .status.succeeded ` ,
242
243
- 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
+
244
247
This number informs the creation of missing Pods to reach ` .spec.completions ` .
245
248
The controller creates Pods for a Job with the finalizer
246
249
` batch.kubernetes.io/job-completion ` .
@@ -257,8 +260,8 @@ cycle.
257
260
- have no finalizer, or
258
261
- were removed from the system.
259
262
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.
262
265
263
266
Steps 2 to 4 might deal with a potentially big number of Pods. Thus, status
264
267
updates can potentially stress the kube-apiserver. For this reason, the Job
@@ -291,6 +294,12 @@ solve.
291
294
However, if the Job controller deletes the Pod (when parallelism is decreased,
292
295
for example), the controller removes the finalizer before deleting it. Thus,
293
296
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.
294
303
295
304
### Pod adoption
296
305
0 commit comments