Skip to content

Commit 3534f7b

Browse files
committed
[zh] sync api reference: job-v1.md
1 parent 67ca9f9 commit 3534f7b

File tree

1 file changed

+97
-4
lines changed
  • content/zh-cn/docs/reference/kubernetes-api/workload-resources

1 file changed

+97
-4
lines changed

content/zh-cn/docs/reference/kubernetes-api/workload-resources/job-v1.md

Lines changed: 97 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ JobSpec 描述了任务执行的情况。
214214
https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector
215215

216216
<!--
217-
### Alpha level
217+
### Beta level
218218
219219
- **podFailurePolicy** (PodFailurePolicy)
220220
221221
Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure.
222222
-->
223-
### Alpha 级别 {#alpha-level}
223+
### Beta 级别 {#beta-level}
224224

225225
- **podFailurePolicy** (PodFailurePolicy)
226226

@@ -229,13 +229,13 @@ JobSpec 描述了任务执行的情况。
229229
并针对 backoffLimit 进行检查。此字段不能与 restartPolicy=OnFailure 结合使用。
230230

231231
<!--
232-
This field is alpha-level. To use this field, you must enable the `JobPodFailurePolicy` feature gate (disabled by default).
232+
This field is beta-level. It can be used when the `JobPodFailurePolicy` feature gate is enabled (enabled by default).
233233
234234
<a name="PodFailurePolicy"></a>
235235
*PodFailurePolicy describes how failed pods influence the backoffLimit.*
236236
-->
237237

238-
此字段是 Alpha 级别。要使用此字段,你必须启用 `JobPodFailurePolicy` 特性门控(默认被禁用)
238+
此字段是 Beta 级别。 `JobPodFailurePolicy` 特性门控被启用时(默认被启用),可以使用此字段
239239

240240
<a name="PodFailurePolicy"></a>
241241
**PodFailurePolicy 描述失效的 Pod 如何影响 backoffLimit。**
@@ -269,15 +269,22 @@ JobSpec 描述了任务执行的情况。
269269
- **podFailurePolicy.rules.action** (string), required
270270
271271
Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:
272+
272273
- FailJob: indicates that the pod's job is marked as Failed and all
273274
running pods are terminated.
275+
- FailIndex: indicates that the pod's index is marked as Failed and will
276+
not be restarted.
277+
This value is alpha-level. It can be used when the
278+
`JobBackoffLimitPerIndex` feature gate is enabled (disabled by default).
274279
-->
275280

276281
- **podFailurePolicy.rules.action** (string),必需
277282

278283
指定当要求满足时对 Pod 失效采取的操作。可能的值是:
279284

280285
- FailJob:表示 Pod 的任务被标记为 Failed 且所有正在运行的 Pod 都被终止。
286+
- FailIndex:表示 Pod 对应的索引被标记为 Failed 且 Pod 不会被重新启动。
287+
此值是 Alpha 级别的。当 `JobBackoffLimitPerIndex` 特性门控被启用时(默认被禁用),可以使用此值。
281288

282289
<!--
283290
- Ignore: indicates that the counter towards the .backoffLimit is not
@@ -404,6 +411,60 @@ JobSpec 描述了任务执行的情况。
404411
将退出码的检查限制为具有指定名称的容器。当为 null 时,该规则适用于所有容器。
405412
当被指定时,它应与 Pod 模板中的容器名称或 initContainer 名称之一匹配。
406413

414+
<!--
415+
### Alpha level
416+
-->
417+
### Alpha 级别 {#alpha-level}
418+
419+
<!--
420+
- **backoffLimitPerIndex** (int32)
421+
422+
Specifies the limit for the number of retries within an index before marking this index as failed. When enabled the number of failures per index is kept in the pod's batch.kubernetes.io/job-index-failure-count annotation. It can only be set when Job's completionMode=Indexed, and the Pod's restart policy is Never. The field is immutable. This field is alpha-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (disabled by default).
423+
-->
424+
- **backoffLimitPerIndex**(int32)
425+
426+
指定在将特定索引的 Pod 标记为失败之前在对该 Pod 重试次数的限制。
427+
启用后,各索引的失败次数将保存在 Pod 的 `batch.kubernetes.io/job-index-failure-count` 注解中。
428+
仅当 Job 的 completionMode=Indexed 且 Pod 的重启策略为 Never 时才能设置此字段。
429+
此字段是不可变更的。此字段是 Alpha 级别的。
430+
`JobBackoffLimitPerIndex` 特性门控被启用时(默认被禁用),可以使用此字段。
431+
432+
<!--
433+
- **maxFailedIndexes** (int32)
434+
435+
Specifies the maximal number of failed indexes before marking the Job as failed, when backoffLimitPerIndex is set. Once the number of failed indexes exceeds this number the entire Job is marked as Failed and its execution is terminated. When left as null the job continues execution of all of its indexes and is marked with the `Complete` Job condition. It can only be specified when backoffLimitPerIndex is set. It can be null or up to completions. It is required and must be less than or equal to 10^4 when is completions greater than 10^5. This field is alpha-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (disabled by default).
436+
-->
437+
- **maxFailedIndexes**(int32)
438+
439+
指定在 backoffLimitPerIndex 被设置时、标记 Job 为失败之前所允许的最大失败索引数。
440+
一旦失败的索引数超过此数值,整个 Job 将被标记为 Failed 并终止执行。
441+
如果不设置此字段(对应为 null),则作业继续执行其所有索引,且 Job 会被标记 `Complete` 状况。
442+
此字段只能在设置 backoffLimitPerIndex 时指定。此字段值可以是 null 或完成次数之内的值。
443+
当完成次数大于 10^5 时,此字段是必需的且必须小于等于 10^4。
444+
此字段是 Alpha 级别的。当 `JobBackoffLimitPerIndex` 特性门控被启用时(默认禁用),可以使用此字段。
445+
446+
<!--
447+
- **podReplacementPolicy** (string)
448+
449+
podReplacementPolicy specifies when to create replacement Pods. Possible values are: - TerminatingOrFailed means that we recreate pods
450+
when they are terminating (has a metadata.deletionTimestamp) or failed.
451+
- Failed means to wait until a previously created Pod is fully terminated (has phase
452+
Failed or Succeeded) before creating a replacement Pod.
453+
-->
454+
- **podReplacementPolicy**(string)
455+
456+
podReplacementPolicy 指定何时创建替代的 Pod。可能的值包括:
457+
458+
- TerminatingOrFailed:表示当 Pod 处于终止中(具有 metadata.deletionTimestamp)或失败时,重新创建 Pod。
459+
- Failed:表示在创建替代的 Pod 之前,等待先前创建的 Pod 完全终止(处于 Failed 或 Succeeded 阶段)。
460+
461+
<!--
462+
When using podFailurePolicy, Failed is the the only allowed value. TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use. This is an alpha field. Enable JobPodReplacementPolicy to be able to use this field.
463+
-->
464+
当使用 podFailurePolicy 时,Failed 是唯一允许值。
465+
当不使用 podFailurePolicy 时,允许使用 TerminatingOrFailed 和 Failed。
466+
这是一个 Alpha 级别的字段。启用 JobPodReplacementPolicy 特性门控才能使用此字段。
467+
407468
## JobStatus {#JobStatus}
408469

409470
<!--
@@ -653,6 +714,38 @@ JobStatus 表示 Job 的当前状态。
653714

654715
此字段为 Beta 级别。当特性门控 JobReadyPods 启用(默认启用)时,任务控制器会填充该字段。
655716

717+
<!--
718+
### Alpha level
719+
-->
720+
### Alpha 级别
721+
722+
<!--
723+
- **failedIndexes** (string)
724+
725+
FailedIndexes holds the failed indexes when backoffLimitPerIndex=true. The indexes are represented in the text format analogous as for the `completedIndexes` field, ie. they are kept as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the failed indexes are 1, 3, 4, 5 and 7, they are represented as "1,3-5,7". This field is alpha-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (disabled by default).
726+
-->
727+
- **failedIndexes** (string)
728+
729+
当 backoffLimitPerIndex=true 时,failedIndexes 保存失败的索引。
730+
索引以文本格式表示,类似于 `completedIndexes` 字段,即这些索引是使用逗号分隔的十进制整数。
731+
这些数字按升序列出。三个或更多连续的数字会被压缩,整个序列表示为第一个数字、连字符和最后一个数字。
732+
例如,如果失败的索引是 1、3、4、5 和 7,则表示为 "1,3-5,7"。
733+
该字段是 Alpha 级别的。当 `JobBackoffLimitPerIndex` 特性门控被启用时(默认被禁用),可以使用此字段。
734+
735+
<!--
736+
- **terminating** (int32)
737+
738+
The number of pods which are terminating (in phase Pending or Running and have a deletionTimestamp).
739+
740+
This field is alpha-level. The job controller populates the field when the feature gate JobPodReplacementPolicy is enabled (disabled by default).
741+
-->
742+
- **terminating**(int32)
743+
744+
正在终止的 Pod 数量(处于 Pending 或 Running 阶段且具有 deletionTimestamp)。
745+
746+
此字段是 Alpha 级别的。当特性门控 JobPodReplacementPolicy 被启用时(默认被禁用),
747+
Job 控制器会填充该字段。
748+
656749
## JobList {#JobList}
657750

658751
<!--

0 commit comments

Comments
 (0)