Skip to content

Commit cec3c3f

Browse files
committed
KEP-3998: Apply Aldo's suggestons
Signed-off-by: Yuki Iwai <[email protected]>
1 parent 32fd60c commit cec3c3f

File tree

1 file changed

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

1 file changed

+19
-20
lines changed

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

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -560,31 +560,30 @@ You can only configure a success policy for an Indexed Job if you have the
560560
enabled in your cluster.
561561
{{< /note >}}
562562

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.
565565

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:
569568

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.
574573

575574
You can configure a success policy, in the `.spec.successPolicy` field,
576575
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.
585584
* 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.
588587

589588
Note that when you specify multiple rules in the `.spec.succeessPolicy.rules`,
590589
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
602601

603602
{{< note >}}
604603
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.
606605
{{< /note >}}
607606

608607
## Job termination and cleanup

0 commit comments

Comments
 (0)