Skip to content

Commit 22c0708

Browse files
kinzhitengqm
andauthored
[zh]update content/zh/docs/concepts/workloads/controllers/job.md (#33157)
* [zh]update content/zh/docs/concepts/workloads/controllers/job.md * [zh]update content/zh/docs/concepts/workloads/controllers/job.md * Update content/zh/docs/concepts/workloads/controllers/job.md Co-authored-by: Qiming Teng <[email protected]> * Update content/zh/docs/concepts/workloads/controllers/job.md Co-authored-by: Qiming Teng <[email protected]> * Update content/zh/docs/concepts/workloads/controllers/job.md Co-authored-by: Qiming Teng <[email protected]> * Update content/zh/docs/concepts/workloads/controllers/job.md Co-authored-by: Qiming Teng <[email protected]> * Update content/zh/docs/concepts/workloads/controllers/job.md Co-authored-by: Qiming Teng <[email protected]> * Update content/zh/docs/concepts/workloads/controllers/job.md Co-authored-by: Qiming Teng <[email protected]> * [zh]update content/zh/docs/concepts/workloads/controllers/job.md Co-authored-by: Qiming Teng <[email protected]>
1 parent 353e867 commit 22c0708

File tree

1 file changed

+75
-13
lines changed
  • content/zh/docs/concepts/workloads/controllers

1 file changed

+75
-13
lines changed

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

Lines changed: 75 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ cleaned up by CronJobs based on the specified capacity-based cleanup policy.
561561

562562
### 已完成 Job 的 TTL 机制 {#ttl-mechanisms-for-finished-jobs}
563563

564-
{{< feature-state for_k8s_version="v1.21" state="beta" >}}
564+
{{< feature-state for_k8s_version="v1.23" state="stable" >}}
565565

566566
<!--
567567
Another way to clean up finished Jobs (either `Complete` or `Failed`)
@@ -733,15 +733,21 @@ version of Kubernetes you're using](/docs/home/supported-doc-versions/).
733733
When a Job is created, the Job controller will immediately begin creating Pods
734734
to satisfy the Job's requirements and will continue to do so until the Job is
735735
complete. However, you may want to temporarily suspend a Job's execution and
736-
resume it later. To suspend a Job, you can update the `.spec.suspend` field of
736+
resume it later, or start Jobs in suspended state and have a custom controller
737+
decide later when to start them.
738+
-->
739+
Job 被创建时,Job 控制器会马上开始执行 Pod 创建操作以满足 Job 的需求,
740+
并持续执行此操作直到 Job 完成为止。
741+
不过你可能想要暂时挂起 Job 执行,或启动处于挂起状态的job,
742+
并拥有一个自定义控制器以后再决定什么时候开始。
743+
744+
<!--
745+
To suspend a Job, you can update the `.spec.suspend` field of
737746
the Job to true; later, when you want to resume it again, update it to false.
738747
Creating a Job with `.spec.suspend` set to true will create it in the suspended
739748
state.
740749
-->
741-
Job 被创建时,Job 控制器会马上开始执行 Pod 创建操作以满足 Job 的需求,
742-
并持续执行此操作直到 Job 完成为止。
743-
不过你可能想要暂时挂起 Job 执行,之后再恢复其执行。
744-
要挂起一个 Job,你可以将 Job 的 `.spec.suspend` 字段更新为 true。
750+
要挂起一个 Job,你可以更新 `.spec.suspend` 字段为 true,
745751
之后,当你希望恢复其执行时,将其更新为 false。
746752
创建一个 `.spec.suspend` 被设置为 true 的 Job 本质上会将其创建为被挂起状态。
747753

@@ -858,6 +864,61 @@ as soon as the Job was resumed.
858864
字段值被改来改去造成的。在这两个事件之间,我们看到没有 Pod 被创建,不过当
859865
Job 被恢复执行时,Pod 创建操作立即被重启执行。
860866
867+
<!--
868+
### Mutable Scheduling Directives
869+
-->
870+
### 可变调度指令 {#mutable-scheduling-directives}
871+
872+
{{< feature-state for_k8s_version="v1.23" state="beta" >}}
873+
874+
<!--
875+
In order to use this behavior, you must enable the `JobMutableNodeSchedulingDirectives`
876+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
877+
on the [API server](/docs/reference/command-line-tools-reference/kube-apiserver/).
878+
It is enabled by default.
879+
-->
880+
{{< note >}}
881+
为了使用此功能,你必须在 [API 服务器](/zh/docs/reference/command-line-tools-reference/kube-apiserver/)上启用
882+
`JobMutableNodeSchedulingDirectives` [特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)。
883+
默认情况下启用。
884+
{{< /note >}}
885+
886+
<!--
887+
In most cases a parallel job will want the pods to run with constraints,
888+
like all in the same zone, or all either on GPU model x or y but not a mix of both.
889+
-->
890+
在大多数情况下,并行作业会希望 Pod 在一定约束条件下运行,
891+
比如所有的 Pod 都在同一个区域,或者所有的 Pod 都在 GPU 型号 x 或 y 上,而不是两者的混合。
892+
893+
<!--
894+
The [suspend](#suspending-a-job) field is the first step towards achieving those semantics. Suspend allows a
895+
custom queue controller to decide when a job should start; However, once a job is unsuspended,
896+
a custom queue controller has no influence on where the pods of a job will actually land.
897+
-->
898+
[suspend](#suspend-a-job) 字段是实现这些语义的第一步。
899+
suspend 允许自定义队列控制器,以决定工作何时开始;然而,一旦工作被取消暂停,
900+
自定义队列控制器对 Job 中 Pods 的实际放置位置没有影响。
901+
902+
<!--
903+
This feature allows updating a Job's scheduling directives before it starts, which gives custom queue
904+
controllers the ability to influence pod placement while at the same time offloading actual
905+
pod-to-node assignment to kube-scheduler. This is allowed only for suspended Jobs that have never
906+
been unsuspended before.
907+
-->
908+
此特性允许在 Job 开始之前更新调度指令,从而为定制队列提供影响 Pod
909+
放置的能力,同时将 Pod 与节点间的分配关系留给 kube-scheduler 决定。
910+
这一特性仅适用于之前从未被暂停过的、已暂停的 Job。
911+
控制器能够影响 Pod 放置,同时参考实际
912+
pod-to-node 分配给 kube-scheduler。这仅适用于从未暂停的 Jobs。
913+
914+
<!--
915+
The fields in a Job's pod template that can be updated are node affinity, node selector,
916+
tolerations, labels and annotations.
917+
-->
918+
Job 的 Pod 模板中可以更新的字段是节点亲和性、节点选择器、容忍、标签和注解。
919+
920+
921+
861922
<!--
862923
### Specifying your own Pod selector {#specifying-your-own-pod-selector}
863924
@@ -964,7 +1025,7 @@ spec:
9641025

9651026
<!--
9661027
The new Job itself will have a different uid from `a8f3d00d-c6d2-11e5-9f87-42010af00002`. Setting
967-
`manualSelector: true` tells the system to that you know what you are doing and to allow this
1028+
`manualSelector: true` tells the system that you know what you are doing and to allow this
9681029
mismatch.
9691030
-->
9701031
新的 Job 自身会有一个不同于 `a8f3d00d-c6d2-11e5-9f87-42010af00002` 的唯一 ID。
@@ -978,24 +1039,25 @@ In order to use this behavior, you must enable the `JobTrackingWithFinalizers`
9781039
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
9791040
on the [API server](/docs/reference/command-line-tools-reference/kube-apiserver/)
9801041
and the [controller manager](/docs/reference/command-line-tools-reference/kube-controller-manager/).
981-
It is disabled by default.
1042+
It is enabled by default.
9821043
9831044
When enabled, the control plane tracks new Jobs using the behavior described
984-
below. Existing Jobs are unaffected. As a user, the only difference you would
985-
see is that the control plane tracking of Job completion is more accurate.
1045+
below. Jobs created before the feature was enabled are unaffected. As a user,
1046+
the only difference you would see is that the control plane tracking of Job
1047+
completion is more accurate.
9861048
-->
9871049
### 使用 Finalizer 追踪 Job {#job-tracking-with-finalizers}
9881050

989-
{{< feature-state for_k8s_version="v1.22" state="alpha" >}}
1051+
{{< feature-state for_k8s_version="v1.23" state="beta" >}}
9901052

9911053
{{< note >}}
9921054
要使用该行为,你必须为 [API 服务器](/zh/docs/reference/command-line-tools-reference/kube-apiserver/)
9931055
[控制器管理器](/zh/docs/reference/command-line-tools-reference/kube-controller-manager/)
9941056
启用 `JobTrackingWithFinalizers`
9951057
[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)
996-
默认是禁用的
1058+
默认是启用的
9971059

998-
启用后,控制面基于下述行为追踪新的 Job。现有 Job 不受影响。
1060+
启用后,控制面基于下述行为追踪新的 Job。在启用该特性之前创建的 Job 不受影响。
9991061
作为用户,你会看到的唯一区别是控制面对 Job 完成情况的跟踪更加准确。
10001062
{{< /note >}}
10011063

0 commit comments

Comments
 (0)