@@ -598,28 +598,39 @@ Pod 考虑在内,评估相关 Job 的 `.backoffLimit` 和 `.podFailurePolicy`
598598There are situations where you want to fail a Job after some amount of retries
599599due to a logical error in configuration etc.
600600To do so, set `.spec.backoffLimit` to specify the number of retries before
601- considering a Job as failed. The back-off limit is set by default to 6. Failed
602- Pods associated with the Job are recreated by the Job controller with an
603- exponential back-off delay (10s, 20s, 40s ...) capped at six minutes.
604-
605- The number of retries is calculated in two ways:
601+ considering a Job as failed.
606602
607- - The number of Pods with `.status.phase = "Failed"`.
608- - When using `restartPolicy = "OnFailure"`, the number of retries in all the
609- containers of Pods with `.status.phase` equal to `Pending` or `Running`.
603+ The `.spec.backoffLimit` is set by default to 6, unless the
604+ [backoff limit per index](#backoff-limit-per-index) (only Indexed Job) is specified.
605+ When `.spec.backoffLimitPerIndex` is specified, then `.spec.backoffLimit` defaults
606+ to 2147483647 (MaxInt32).
610607
611- If either of the calculations reaches the `.spec.backoffLimit`, the Job is
612- considered failed .
608+ Failed Pods associated with the Job are recreated by the Job controller with an
609+ exponential back-off delay (10s, 20s, 40s ...) capped at six minutes .
613610-->
614611### Pod 回退失效策略 {#pod-backoff-failure-policy}
615612
616613在有些情形下,你可能希望 Job 在经历若干次重试之后直接进入失败状态,
617614因为这很可能意味着遇到了配置错误。
618615为了实现这点,可以将 ` .spec.backoffLimit ` 设置为视 Job 为失败之前的重试次数。
619- 失效回退的限制值默认为 6。
616+ ` .spec.backoffLimit ` 的值默认为 6,
617+ 除非指定了[ 每个索引的退避限制] ( #backoff-limit-per-index ) (仅限带索引的 Job)。
618+ 当指定 ` .spec.backoffLimitPerIndex ` 时,` .spec.backoffLimit `
619+ 默认为 2147483647 (MaxInt32)。
620+
620621与 Job 相关的失效的 Pod 会被 Job 控制器重建,回退重试时间将会按指数增长
621622(从 10 秒、20 秒到 40 秒)最多至 6 分钟。
622623
624+ <!--
625+ The number of retries is calculated in two ways:
626+
627+ - The number of Pods with `.status.phase = "Failed"`.
628+ - When using `restartPolicy = "OnFailure"`, the number of retries in all the
629+ containers of Pods with `.status.phase` equal to `Pending` or `Running`.
630+
631+ If either of the calculations reaches the `.spec.backoffLimit`, the Job is
632+ considered failed.
633+ -->
623634计算重试次数有以下两种方法:
624635- 计算 ` .status.phase = "Failed" ` 的 Pod 数量。
625636- 当 Pod 的 ` restartPolicy = "OnFailure" ` 时,针对 ` .status.phase ` 等于 ` Pending ` 或
@@ -647,18 +658,7 @@ from failed Jobs is not lost inadvertently.
647658-->
648659### 逐索引的回退限制 {#backoff-limit-per-index}
649660
650- {{< feature-state for_k8s_version="v1.29" state="beta" >}}
651-
652- {{< note >}}
653- <!--
654- You can only configure the backoff limit per index for an [Indexed](#completion-mode) Job, if you
655- have the `JobBackoffLimitPerIndex` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
656- enabled in your cluster.
657- -->
658- 只有在集群中启用了 ` JobBackoffLimitPerIndex `
659- [ 特性门控] ( /zh-cn/docs/reference/command-line-tools-reference/feature-gates/ ) ,
660- 才能为 [ Indexed] ( #completion-mode ) Job 配置逐索引的回退限制。
661- {{< /note >}}
661+ {{< feature-state feature_gate_name="JobBackoffLimitPerIndex" >}}
662662
663663<!--
664664When you run an [indexed](#completion-mode) Job, you can choose to handle retries
@@ -964,19 +964,6 @@ For more details, see [Job termination and cleanup](#job-termination-and-cleanup
964964-->
965965# # 成功策略 {#success-policy}
966966
967- {{< feature-state feature_gate_name="JobSuccessPolicy" >}}
968-
969- {{< note >}}
970- <!--
971- You can only configure a success policy for an Indexed Job if you have the
972- ` JobSuccessPolicy` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
973- enabled in your cluster.
974- -->
975- 只有你在集群中启用了 `JobSuccessPolicy`
976- [特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)时,
977- 才可以为带索引的 Job 配置成功策略。
978- {{< /note >}}
979-
980967<!--
981968When creating an Indexed Job, you can define when a Job can be declared as succeeded using a `.spec.successPolicy`,
982969based on the pods that succeeded.
0 commit comments