@@ -560,31 +560,30 @@ You can only configure a success policy for an Indexed Job if you have the
560
560
enabled in your cluster.
561
561
{{< /note >}}
562
562
563
- When you run an indexed Job, a success policy defined with the ` spec.successPolicy` field ,
564
- allows you to define when a Job can be declared as succeeded based on the number of succeeded pods .
563
+ When creating an Indexed Job, you can define when a Job can be declared as succeeded using a `. spec.successPolicy`,
564
+ based on the pods that succeeded.
565
565
566
- In some situations, you may want to have a better control when handling Pod
567
- successes than the control provided by the `.spec.completins`.
568
- There are some examples of use cases :
566
+ By default, a Job succeeds when the number of succeeded Pods equals `.spec.completions`.
567
+ These are some situations where you might want additional control for declaring a Job succeeded :
569
568
570
- * To optimize costs of running workloads by avoiding unnecessary Pod running,
571
- you can terminate a Job as soon as one of its Pods succeeds .
572
- * To care only about a leader index in determining the success or failure of a Job
573
- in a batch workloads such as MPI and PyTorch etc.
569
+ * When running simulations with different parameters,
570
+ you might not need all the simulations to succeed for the overall Job to be successful .
571
+ * When following a leader-worker pattern, only the success of the leader determines the success or
572
+ failure of a Job. Examples of this are frameworks like MPI and PyTorch etc.
574
573
575
574
You can configure a success policy, in the `.spec.successPolicy` field,
576
575
to meet the above use cases. This policy can handle Job successes based on the
577
- number of succeeded pods. After the Job meet success policy, the lingering Pods
578
- are terminated by the Job controller.
579
-
580
- * When you specify the only `.spec.successPolicy.rules[*]. succeededIndexes`,
581
- once all indexes specified in the `succeededIndexes` succeeded, the Job is marked as succeeded.
582
- The `succeededIndexes` must be a list of intervals between 0 and `.spec.completions-1`.
583
- * When you specify the only `spec.successPolicy.rules[*]. succeededCount`,
584
- once the number of succeeded indexes reaches the `succeededCount`, the Job is marked as succeeded.
576
+ succeeded pods. After the Job meet success policy, the job controller terminates the lingering Pods.
577
+ A success policy is defined by rules. Each rule can take one of the following forms :
578
+
579
+ * When you specify the ` succeededIndexes` only ,
580
+ once all indexes specified in the `succeededIndexes` succeeded, the Job is marked as succeeded.
581
+ The `succeededIndexes` must be a list of intervals between 0 and `.spec.completions-1`.
582
+ * When you specify the ` succeededCount` only ,
583
+ once the number of succeeded indexes reaches the `succeededCount`, the Job is marked as succeeded.
585
584
* When you specify both `succeededIndexes` and `succeededCount`,
586
- once the number of succeeded indexes specified in the `succeededIndexes` reaches the `succeededCount`,
587
- the Job is marked as succeeded.
585
+ once the number of succeeded indexes specified in the `succeededIndexes` reaches the `succeededCount`,
586
+ the Job is marked as succeeded.
588
587
589
588
Note that when you specify multiple rules in the `.spec.succeessPolicy.rules`,
590
589
the rules are evaluated in order. Once the Job meets a rule, the remaining rules are ignored.
@@ -602,7 +601,7 @@ The number are listed in represented by the first and last element of the series
602
601
603
602
{{< note >}}
604
603
When you specify both a success policy and some terminating policies such as `.spec.backoffLimit` and `.spec.podFailurePolicy`,
605
- once the Job meets both policies , the terminating policies are respected and a success policy is ignored .
604
+ once the Job meets either policy , the job controller respects the terminating policy and ignores the success policy.
606
605
{{< /note >}}
607
606
608
607
# # Job termination and cleanup
0 commit comments