Skip to content

Commit b623584

Browse files
committed
[zh-cn]sync job-v1
Signed-off-by: xin.li <[email protected]>
1 parent e547417 commit b623584

1 file changed

Lines changed: 53 additions & 47 deletions

File tree

  • content/zh-cn/docs/reference/kubernetes-api/workload-resources

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

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ JobSpec 描述了任务执行的情况。
9191

9292
描述执行任务时将创建的 Pod。`template.spec.restartPolicy` 可以取的值只能是
9393
"Never" 或 "OnFailure"。更多信息:
94-
https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
94+
https://kubernetes.io/zh-cn/docs/concepts/workloads/controllers/jobs-run-to-completion/
9595

9696
- **parallelism** (int32)
9797

9898
指定任务应在任何给定时刻预期运行的 Pod 个数上限。
99-
当(.spec.completions - .status.successful) \< .spec.parallelism 时,
99+
`(.spec.completions - .status.successful) < .spec.parallelism` 时,
100100
即当剩余的工作小于最大并行度时,在稳定状态下运行的 Pod 的实际数量将小于此数量。
101101
更多信息:
102-
https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
102+
https://kubernetes.io/zh-cn/docs/concepts/workloads/controllers/jobs-run-to-completion/
103103

104104
### Lifecycle
105105

@@ -111,7 +111,8 @@ JobSpec 描述了任务执行的情况。
111111
- **completions** (int32)
112112

113113
指定任务应该运行并预期成功完成的 Pod 个数。设置为空意味着任何 Pod 的成功都标识着所有 Pod 的成功,
114-
并允许 `parallelism` 设置为任意正值。设置为 1 意味着并行性被限制为 1,并且该 Pod 的成功标志着任务的成功。更多信息:
114+
并允许 `parallelism` 设置为任意正值。设置为 1 意味着并行性被限制为 1,并且该 Pod 的成功标志着任务的成功。
115+
更多信息:
115116
https://kubernetes.io/zh-cn/docs/concepts/workloads/controllers/jobs-run-to-completion/
116117

117118
<!--
@@ -133,7 +134,7 @@ JobSpec 描述了任务执行的情况。
133134
-->
134135

135136
`Indexed` 意味着 Job 的各个 Pod 会获得对应的完成索引值,从 0 到(`.spec.completions - 1`),可在注解
136-
"batch.kubernetes.io/job-completion-index" 中找到。当每个索引都对应有一个成功完成的 Pod 时,
137+
`"batch.kubernetes.io/job-completion-index"` 中找到。当每个索引都对应有一个成功完成的 Pod 时,
137138
该任务被认为是完成的。
138139
当值为 `Indexed` 时,必须指定 `.spec.completions` 并且 `.spec.parallelism` 必须小于或等于 10^5。
139140
此外,Pod 名称采用 `$(job-name)-$(index)-$(random-string)` 的形式,Pod 主机名采用
@@ -171,7 +172,7 @@ JobSpec 描述了任务执行的情况。
171172
- **backoffLimit** (int32)
172173

173174
指定标记此任务失败之前的重试次数。默认值为 6,除非指定了 `backoffLimitPerIndex`(仅限 Indexed Job)。
174-
指定 backoffLimitPerIndex 时,backoffLimit 默认为 2147483647。
175+
指定 `backoffLimitPerIndex` 时,`backoffLimit` 默认为 2147483647。
175176

176177
- **activeDeadlineSeconds** (int64)
177178

@@ -200,7 +201,7 @@ JobSpec 描述了任务执行的情况。
200201

201202
`suspend` 指定 Job 控制器是否应该创建 Pod。如果创建 Job 时将 `suspend` 设置为 true,则 Job 控制器不会创建任何 Pod。
202203
如果 Job 在创建后被挂起(即标志从 false 变为 true),则 Job 控制器将删除与该 Job 关联的所有活动 Pod。
203-
用户必须设计他们的工作负载来优雅地处理这个问题。暂停 Job 将重置 Job 的 startTime 字段,
204+
用户必须设计他们的工作负载来优雅地处理这个问题。暂停 Job 将重置 Job 的 `startTime` 字段,
204205
也会重置 ActiveDeadlineSeconds 计时器。默认为 false。
205206

206207
### Selector
@@ -302,7 +303,7 @@ JobSpec 描述了任务执行的情况。
302303
Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.
303304
-->
304305

305-
- Ignore:表示 .backoffLimit 的计数器没有递增,并创建了一个替代 Pod。
306+
- Ignore:表示 `.backoffLimit` 的计数器没有递增,并创建了一个替代 Pod。
306307

307308
- Count:表示以默认方式处理该 Pod,计数器朝着 .backoffLimit 的方向递增。
308309

@@ -412,8 +413,8 @@ JobSpec 描述了任务执行的情况。
412413

413414
- **podFailurePolicy.rules.onExitCodes.containerName** (string)
414415

415-
将退出码的检查限制为具有指定名称的容器。当为 null 时,该规则适用于所有容器。
416-
当被指定时,它应与 Pod 模板中的容器名称或 initContainer 名称之一匹配。
416+
将退出码的检查限制为具有指定名称的容器。当为 `null` 时,该规则适用于所有容器。
417+
当被指定时,它应与 Pod 模板中的容器名称或 `initContainer` 名称之一匹配。
417418

418419
<!--
419420
- **podFailurePolicy.rules.onPodConditions** ([]PodFailurePolicyOnPodConditionsPattern), required
@@ -439,22 +440,23 @@ JobSpec 描述了任务执行的情况。
439440
**PodFailurePolicyOnPodConditionsPattern 描述与实际 Pod 状况类型匹配的模式。**
440441

441442
<!--
442-
- **podFailurePolicy.rules.onPodConditions.status** (string), required
443-
444-
Specifies the required Pod condition status. To match a pod condition it is required that the specified status equals the pod condition status. Defaults to True.
445-
446443
- **podFailurePolicy.rules.onPodConditions.type** (string), required
447444
448445
Specifies the required Pod condition type. To match a pod condition it is required that specified type equals the pod condition type.
449-
-->
450-
- **podFailurePolicy.rules.onPodConditions.status** (string),必需
451446
452-
指定必需的 Pod 状况状态。要匹配一个 Pod 状况,指定的状态必须等于该 Pod 状况状态。默认为 True。
447+
- **podFailurePolicy.rules.onPodConditions.status** (string), required
448+
449+
Specifies the required Pod condition status. To match a pod condition it is required that the specified status equals the pod condition status. Defaults to True.
450+
-->
453451

454452
- **podFailurePolicy.rules.onPodConditions.type** (string),必需
455453

456454
指定必需的 Pod 状况类型。要匹配一个 Pod 状况,指定的类型必须等于该 Pod 状况类型。
457455

456+
- **podFailurePolicy.rules.onPodConditions.status** (string),必需
457+
458+
指定必需的 Pod 状况状态。要匹配一个 Pod 状况,指定的状态必须等于该 Pod 状况状态。默认为 True。
459+
458460
- **successPolicy** (SuccessPolicy)
459461
<!--
460462
successPolicy specifies the policy when the Job can be declared as succeeded. If empty, the default behavior applies - the Job is declared as succeeded only when the number of succeeded pods equals to the completions. When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated.
@@ -476,7 +478,7 @@ JobSpec 描述了任务执行的情况。
476478
rules represents the list of alternative rules for the declaring the Jobs as successful before `.status.succeeded >= .spec.completions`. Once any of the rules are met, the "SuccessCriteriaMet" condition is added, and the lingering pods are removed. The terminal state for such a Job has the "Complete" condition. Additionally, these rules are evaluated in order; Once the Job meets one of the rules, other rules are ignored. At most 20 elements are allowed.
477479
-->
478480

479-
**successPolicy 描述何时可以根据某些索引的成功将任务声明为成功。**
481+
**`successPolicy` 描述何时可以根据某些索引的成功将任务声明为成功。**
480482

481483
**successPolicy.rules** ([]SuccessPolicyRule),必需
482484

@@ -492,7 +494,8 @@ JobSpec 描述了任务执行的情况。
492494
*SuccessPolicyRule describes rule for declaring a Job as succeeded. Each rule must have at least one of the "succeededIndexes" or "succeededCount" specified.*
493495
-->
494496

495-
**SuccessPolicyRule 描述了将任务声明为成功的规则。每条规则必须至少指定 `succeededIndexes``succeededCount` 之一。**
497+
**SuccessPolicyRule 描述了将任务声明为成功的规则。
498+
每条规则必须至少指定 `succeededIndexes``succeededCount` 之一。**
496499

497500
- **successPolicy.rules.succeededCount** (int32)
498501

@@ -502,8 +505,8 @@ JobSpec 描述了任务执行的情况。
502505

503506
`succeededCount` 指定任务成功索引集所需的最小规模。当 `succeededCount``succeededIndexes` 一起使用时,
504507
仅检查由 `succeededIndexes` 指定的索引集合。例如,假定 `succeededIndexes`
505-
"1-4",succeededCount 是 "3",而完成的索引是 "1"、"3" 和 "5",那么该任务不会被视为成功,
506-
因为在该规则下只考虑了 "1" 和 "3" 索引。当该字段为 null 时,不会被视为具有默认值,
508+
"1-4",`succeededCount` 是 "3",而完成的索引是 "1"、"3" 和 "5",那么该任务不会被视为成功,
509+
因为在该规则下只考虑了 "1" 和 "3" 索引。当该字段为 `null` 时,不会被视为具有默认值,
507510
并且在任何时候都不会进行评估。当该字段被设置时,所设置的值应是一个正整数。
508511

509512
- **successPolicy.rules.succeededIndexes** (string)
@@ -516,7 +519,7 @@ JobSpec 描述了任务执行的情况。
516519
之间,并且不能包含重复项。至少需要一个元素。索引表示为用逗号分隔的区间。
517520
区间可以是一个十进制整数或一对由破折号分隔的十进制整数。数字序列用区间的第一个和最后一个元素来表示,
518521
并用破折号分隔。例如,如果完成的索引是 1、3、4、5 和 7,则表示为 "1,3-5,7"。
519-
当该字段为 null 时,该字段不会默认为任何值,并且在任何时候都不会进行评估。
522+
当该字段为 `null` 时,该字段不会默认为任何值,并且在任何时候都不会进行评估。
520523

521524
<!--
522525
### Alpha level
@@ -532,15 +535,13 @@ JobSpec 描述了任务执行的情况。
532535

533536
指定在将特定索引的 Pod 标记为失败之前在对该 Pod 重试次数的限制。
534537
启用后,各索引的失败次数将保存在 Pod 的 `batch.kubernetes.io/job-index-failure-count` 注解中。
535-
仅当 Job 的 `completionMode=Indexed` 且 Pod 的重启策略为 Never 时才能设置此字段。
538+
仅当 Job 的 `completionMode=Indexed` 且 Pod 的重启策略为 `Never` 时才能设置此字段。
536539
此字段是不可变更的。
537540

538541
- **managedBy** (string)
539542

540543
<!--
541544
ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first "/" must be a valid subdomain as defined by RFC 1123. All characters trailing the first "/" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable.
542-
543-
This field is beta-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (enabled by default).
544545
-->
545546

546547
`managedBy` 字段标明管理任务的控制器。
@@ -549,8 +550,6 @@ JobSpec 描述了任务执行的情况。
549550
RFC 1123 定义的有效子域。第一个 / 后面的所有字符必须是 RFC 3986 定义的有效 HTTP 路径字符。
550551
字段值的长度不能超过 63 个字符。此字段是不可变的。
551552

552-
此字段处于 Beta 阶段。当启用 `JobManagedBy` 特性门控时(默认情况下启用),任务控制器接受设置此字段。
553-
554553
<!--
555554
- **maxFailedIndexes** (int32)
556555
@@ -559,9 +558,9 @@ JobSpec 描述了任务执行的情况。
559558
- **maxFailedIndexes**(int32)
560559

561560
指定在 `backoffLimitPerIndex` 被设置时、标记 Job 为失败之前所允许的最大失败索引数。
562-
一旦失败的索引数超过此数值,整个 Job 将被标记为 Failed 并终止执行。
563-
如果不设置此字段(对应为 null),则作业继续执行其所有索引,且 Job 会被标记 `Complete` 状况。
564-
此字段只能在设置 `backoffLimitPerIndex` 时指定。此字段值可以是 null 或完成次数之内的值。
561+
一旦失败的索引数超过此数值,整个 Job 将被标记为 `Failed` 并终止执行。
562+
如果不设置此字段(对应为 `null`),则 Job 继续执行其所有索引,且 Job 会被标记 `Complete` 状况。
563+
此字段只能在设置 `backoffLimitPerIndex` 时指定。此字段值可以是 `null` 或完成次数之内的值。
565564
当完成次数大于 10^5 时,此字段是必需的且必须小于等于 10^4。
566565

567566
<!--
@@ -577,13 +576,13 @@ JobSpec 描述了任务执行的情况。
577576
`podReplacementPolicy` 指定何时创建替代的 Pod。可能的值包括:
578577

579578
- `TerminatingOrFailed`:表示当 Pod 处于终止中(具有 `metadata.deletionTimestamp`)或失败时,重新创建 Pod。
580-
- `Failed`:表示在创建替代的 Pod 之前,等待先前创建的 Pod 完全终止(处于 Failed 或 Succeeded 阶段)。
579+
- `Failed`:表示在创建替代的 Pod 之前,等待先前创建的 Pod 完全终止(处于 `Failed``Succeeded` 阶段)。
581580

582581
<!--
583582
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 beta field.
584583
-->
585-
当使用 podFailurePolicy 时,Failed 是唯一允许值。
586-
当不使用 podFailurePolicy 时,允许使用 TerminatingOrFailed 和 Failed。
584+
当使用 `podFailurePolicy` 时,`Failed` 是唯一允许值。
585+
当不使用 `podFailurePolicy` 时,允许使用 `TerminatingOrFailed``Failed`
587586
这是一个 Beta 级别的字段。
588587

589588
## JobStatus {#JobStatus}
@@ -613,7 +612,8 @@ JobStatus 表示 Job 的当前状态。
613612
一旦设置,仅当 Job 被挂起时才可移除该字段。Job 取消挂起或完成时,无法修改该字段。
614613

615614
<a name="Time"></a>
616-
**Time 是 time.Time 的包装器,支持正确编码为 YAML 和 JSON。time 包提供的许多工厂方法都提供了包装器。**
615+
**Time 是 `time.Time` 的包装器,支持正确编码为 YAML 和 JSON。
616+
`time` 包提供的许多工厂方法都提供了包装器。**
617617

618618
<!--
619619
- **completionTime** (Time)
@@ -626,10 +626,11 @@ JobStatus 表示 Job 的当前状态。
626626
- **completionTime** (Time)
627627

628628
表示 Job 完成的时间。不能保证对多个独立操作按发生的先后顺序设置。此字段表示为 RFC3339 格式的 UTC 时间。
629-
完成时间在且仅在 Job 成功完成时设置。该值无法更新或删除。该值表示与 startTime 字段相同或更晚的时间点。
629+
完成时间在且仅在 Job 成功完成时设置。该值无法更新或删除。该值表示与 `startTime` 字段相同或更晚的时间点。
630630

631631
<a name="Time"></a>
632-
**Time 是 time.Time 的包装器,支持正确编码为 YAML 和 JSON。time 包提供的许多工厂方法都提供了包装器。**
632+
**Time 是 `time.Time` 的包装器,支持正确编码为 YAML 和 JSON。
633+
`time` 包提供的许多工厂方法都提供了包装器。**
633634

634635
<!--
635636
- **active** (int32)
@@ -646,7 +647,8 @@ JobStatus 表示 Job 的当前状态。
646647
-->
647648
- **active** (int32)
648649

649-
未处于终止进程中(未设置 `deletionTimestamp`)的待处理和正在运行的 Pod 数量。对于已完成的 Job,该值为零。
650+
未处于终止进程中(未设置 `deletionTimestamp`)的待处理和正在运行的 Pod 数量。
651+
对于已完成的 Job,该值为零。
650652

651653
- **failed** (int32)
652654

@@ -656,14 +658,15 @@ JobStatus 表示 Job 的当前状态。
656658

657659
进入 Succeeded 阶段的 Pod 数量。对于给定的规范,该值会单调增加。
658660
但是,由于弹性索引任务的缩减,该值可能会减少。
661+
659662
<!--
660663
- **completedIndexes** (string)
661664
662665
completedIndexes holds the completed indexes when .spec.completionMode = "Indexed" in a text format. The indexes are represented 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 completed indexes are 1, 3, 4, 5 and 7, they are represented as "1,3-5,7".
663666
-->
664667
- **completedIndexes** (string)
665668

666-
completedIndexes 以文本格式保存 `.spec.completionMode` 设置为 `"Indexed"` 的 Pod 已完成的索引。
669+
`completedIndexes` 以文本格式保存 `.spec.completionMode` 设置为 `"Indexed"` 的 Pod 已完成的索引。
667670
索引用十进制整数表示,用逗号分隔。数字是按递增的顺序排列的。三个或更多的连续数字被压缩,
668671
用系列的第一个和最后一个元素表示,用连字符分开。例如,如果完成的索引是 1、3、4、5 和 7,则表示为 "1、3-5、7"。
669672

@@ -696,7 +699,8 @@ JobStatus 表示 Job 的当前状态。
696699
当任务处于最终状态(即 "Complete" 或 "Failed")时,即视为任务已完成。任务不能同时处于 "Complete" 和 "Failed" 状态。
697700
此外,任务也不能处于 "Complete" 和 "FailureTarget" 状态。"Complete"、"Failed" 和 "FailureTarget" 状态不能被禁用。
698701

699-
更多信息:https://kubernetes.io/zh-cn/docs/concepts/workloads/controllers/jobs-run-to-completion/
702+
更多信息:
703+
https://kubernetes.io/zh-cn/docs/concepts/workloads/controllers/jobs-run-to-completion/
700704

701705
<a name="JobCondition"></a>
702706
**JobCondition 描述任务的当前状况。**
@@ -733,7 +737,8 @@ JobStatus 表示 Job 的当前状态。
733737
-->
734738

735739
<a name="Time"></a>
736-
**Time 是对 time.Time 的封装,支持正确编码为 YAML 和 JSON。我们为 time 包提供的许多工厂方法提供了封装器。**
740+
**Time 是对 `time.Time` 的封装,支持正确编码为 YAML 和 JSON。
741+
我们为 `time` 包提供的许多工厂方法提供了封装器。**
737742

738743
<!--
739744
- **conditions.lastTransitionTime** (Time)
@@ -751,7 +756,8 @@ JobStatus 表示 Job 的当前状态。
751756
-->
752757

753758
<a name="Time"></a>
754-
**Time 是 time.Time 的包装器,支持正确编码为 YAML 和 JSON。time 包提供的许多工厂方法都提供了包装器。**
759+
**Time 是 `time.Time` 的包装器,支持正确编码为 YAML 和 JSON。
760+
`time` 包提供的许多工厂方法都提供了包装器。**
755761

756762
<!--
757763
- **conditions.message** (string)
@@ -814,7 +820,7 @@ JobStatus 表示 Job 的当前状态。
814820

815821
**集合:合并期间保留唯一值**
816822

817-
failed 字段包含已失败 Pod 的 UID。
823+
`failed` 字段包含已失败 Pod 的 UID。
818824

819825
<!--
820826
- **uncountedTerminatedPods.succeeded** ([]string)
@@ -828,7 +834,7 @@ JobStatus 表示 Job 的当前状态。
828834

829835
**集合:合并期间保留唯一值**
830836

831-
succeeded 包含已成功的 Pod 的 UID。
837+
`succeeded` 包含已成功的 Pod 的 UID。
832838

833839
<!--
834840
### Beta level
@@ -856,7 +862,7 @@ JobStatus 表示 Job 的当前状态。
856862
-->
857863
- **failedIndexes** (string)
858864

859-
当设置了 `spec.backoffLimitPerIndex` 时,failedIndexes 保存失败的索引。
865+
当设置了 `spec.backoffLimitPerIndex` 时,`failedIndexes` 保存失败的索引。
860866
索引以文本格式表示,类似于 `completedIndexes` 字段,即这些索引是使用逗号分隔的十进制整数。
861867
这些数字按升序列出。三个或更多连续的数字会被压缩,整个序列表示为第一个数字、连字符和最后一个数字。
862868
例如,如果失败的索引是 1、3、4、5 和 7,则表示为 "1,3-5,7"。
@@ -871,7 +877,7 @@ JobStatus 表示 Job 的当前状态。
871877
-->
872878
- **terminating**(int32)
873879

874-
正在终止的 Pod 数量(处于 Pending 或 Running 阶段且具有 deletionTimestamp)。
880+
正在终止的 Pod 数量(处于 Pending 或 Running 阶段且具有 `deletionTimestamp`)。
875881

876882
此字段是 Beta 级别的。当特性门控 JobPodReplacementPolicy 被启用时(默认被启用),
877883
Job 控制器会填充该字段。
@@ -904,9 +910,9 @@ JobList 是 Job 的集合。
904910
标准列表元数据。更多信息:
905911
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
906912

907-
- **items** ([]<a href="{{< ref "../workload-resources/job-v1#Job" >}}">Job</a>), required
913+
- **items** ([]<a href="{{< ref "../workload-resources/job-v1#Job" >}}">Job</a>),必需
908914

909-
items 是 Job 对象的列表。
915+
`items` 是 Job 对象的列表。
910916

911917
<!--
912918
## Operations {#Operations}

0 commit comments

Comments
 (0)