15
15
- [ JobSpec API] ( #jobspec-api )
16
16
- [ Pod detail] ( #pod-detail )
17
17
- [ Job completion and restart policy] ( #job-completion-and-restart-policy )
18
+ - [ Track completed indexes in Job status] ( #track-completed-indexes-in-job-status )
18
19
- [ Job parallelism] ( #job-parallelism )
19
20
- [ Test Plan] ( #test-plan )
20
21
- [ Graduation Criteria] ( #graduation-criteria )
@@ -206,16 +207,28 @@ type JobSpec struct {
206
207
// `NonIndexed`.
207
208
CompletionMode CompletionMode
208
209
}
210
+
211
+ type JobStatus struct {
212
+ ...
213
+
214
+ // CompletedIndexes holds the completed indexes when .spec.completionMode =
215
+ // "Indexed" in a text format. The indexes are represented as decimal integers
216
+ // separated by commas. The numbers are listed in increasing order. Two or
217
+ // more consecutive numbers are compressed and represented by the first and
218
+ // last element of the series, separated by a hyphen.
219
+ // For example, if the completed indexes are 1, 3, 4, 5 and 7, they are
220
+ // represented as "1,3-5,7".
221
+ CompletedIndexes string
222
+ }
209
223
```
210
224
211
- As the comment describes, when ` .spec.completionMode = "Indexed" ` , the
212
- ` .spec.completions ` must be:
225
+ As the comment describes, when ` .spec.completionMode = "Indexed" ` :
213
226
214
- - a non-zero positive value. This is to trigger Job management strategy for
215
- * fixed completion count* . That is, ` Indexed ` mode cannot be used for work
216
- queue patterns.
217
- - less than or equal to ` 10^6 ` . This is to guarantee that we can keep track of
218
- completions per-index in the Job status in the future .
227
+ - ` .spec.completions ` must be a non-zero positive value. This is to trigger Job
228
+ management strategy for * fixed completion count* . That is, ` Indexed ` mode
229
+ cannot be used for work queue patterns.
230
+ - ` .spec.parallelism ` must be less than or equal to ` 10^5 ` . This is to guarantee
231
+ that we can keep track of completions per-index in the Job status.
219
232
220
233
### Pod detail
221
234
@@ -271,9 +284,7 @@ them.
271
284
The kubelet handles container restarts as usual, according to the
272
285
` spec.template.spec.restartPolicy` .
273
286
274
- <<[UNRESOLVED TBD Beta : Track completed indexes in Job status]>>
275
- Once [kubernetes/kubernetes#28486](https://github.com/kubernetes/kubernetes/issues/28486)
276
- is resolved :
287
+ # ### Track completed indexes in Job status
277
288
278
289
The Job controller keeps track of completed indexes in
279
290
` .status.completedIndexes` , a string that represents a list of numbers in a
@@ -287,9 +298,8 @@ CompletedIndexes: "2-4,6-7"
287
298
The `kubectl describe` command crops the list of indexes if it's too long :
288
299
289
300
` ` `
290
- Completed Indexes: [ 1-25,28,30-32,...]
301
+ Completed Indexes: 1-25,28,30-32,...
291
302
` ` `
292
- <<[/UNRESOLVED]>>
293
303
294
304
# ## Job parallelism
295
305
@@ -326,7 +336,13 @@ gate enabled and disabled.
326
336
# ### Alpha -> Beta Graduation
327
337
328
338
- Complete features :
329
- - Tracking completions by index in Job status
339
+ - Indexed Jobs when tracking completion without lingering Pods
340
+ [kubernetes/enhancements#2307](https://github.com/kubernetes/enhancements/issues/2307).
341
+
342
+ Keeping the size of .status.completedIndexes is desirable to reduce load
343
+ on watchers. We will evaluate holding of from counting completed Pods that
344
+ have an outlying index. That is, contiguous indexes would be counted first.
345
+ This allows to keep the size of the compressed list small.
330
346
- Gather feedback from end users and operators' developers. Open questions :
331
347
- Are stable Pod names necessary?
332
348
- Tests are in Testgrid and linked in KEP
@@ -498,7 +514,12 @@ the existing API objects?**
498
514
Yes.
499
515
500
516
- API type(s) : Job
501
- - Estimated increase in size : new field of about 30 bytes.
517
+ - Estimated increase in size :
518
+ - New field in Spec about 30 bytes.
519
+ - New field in Status. In the worst case scenario, completed indexes are
520
+ non-consecutive. Since the API limits parallelism to 10^5, we could have
521
+ up to 5*10^4 non-consecutive numbers, which can be represented in less
522
+ than 1MB.
502
523
503
524
- API type(s) : Pod, only when created with the new completion mode.
504
525
- Estimated increase in size : new annotation of about 50 bytes.
0 commit comments