Skip to content

Commit aa7ef87

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

1 file changed

Lines changed: 41 additions & 59 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: 41 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ api_metadata:
66
content_type: "api_reference"
77
description: "Job 表示单个任务的配置。"
88
title: "Job"
9-
weight: 10
9+
weight: 11
1010
---
1111
<!--
1212
api_metadata:
@@ -16,7 +16,7 @@ kind: "Job"
1616
content_type: "api_reference"
1717
description: "Job represents the configuration of a single job."
1818
title: "Job"
19-
weight: 10
19+
weight: 11
2020
auto_generated: true
2121
-->
2222

@@ -146,19 +146,6 @@ JobSpec 描述了任务执行的情况。
146146

147147
将来可能添加更多的完成模式。如果 Job 控制器发现它无法识别的模式
148148
(这种情况在升级期间由于版本偏差可能发生),则控制器会跳过 Job 的更新。
149-
150-
<!--
151-
Possible enum values:
152-
- `"Indexed"` is a Job completion mode. In this mode, the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1). The Job is considered complete when a Pod completes for each completion index.
153-
- `"NonIndexed"` is a Job completion mode. In this mode, the Job is considered complete when there have been .spec.completions successfully completed Pods. Pod completions are homologous to each other.
154-
-->
155-
156-
可能的枚举值:
157-
- `"Indexed"` 是一种 Job 完成模式。在此模式下,Job 的 Pod 会获得一个从 0 到
158-
`.spec.completions - 1` 的关联完成索引值。当每个完成索引值都有一个 Pod 完成时,
159-
Job 就被视为已完成。
160-
- `"NonIndexed"` 是一种 Job 完成模式。在此模式下,当有 `.spec.completions`
161-
Pod 成功完成时,Job 就被视为已完成。Pod 的完成情况彼此同源。
162149

163150
<!--
164151
- **backoffLimit** (int32)
@@ -203,6 +190,21 @@ JobSpec 描述了任务执行的情况。
203190
如果 Job 在创建后被挂起(即标志从 false 变为 true),则 Job 控制器将删除与该 Job 关联的所有活动 Pod。
204191
用户必须设计他们的工作负载来优雅地处理这个问题。暂停 Job 将重置 Job 的 `startTime` 字段,
205192
也会重置 ActiveDeadlineSeconds 计时器。默认为 false。
193+
194+
<!--
195+
- **podReplacementPolicy** (string)
196+
197+
podReplacementPolicy specifies when to create replacement Pods. Possible values are: - TerminatingOrFailed means that we recreate pods
198+
when they are terminating (has a metadata.deletionTimestamp) or failed.
199+
- Failed means to wait until a previously created Pod is fully terminated (has phase
200+
Failed or Succeeded) before creating a replacement Pod.
201+
-->
202+
- **podReplacementPolicy**(string)
203+
204+
`podReplacementPolicy` 指定何时创建替代的 Pod。可能的值包括:
205+
206+
- `TerminatingOrFailed`:表示当 Pod 处于终止中(具有 `metadata.deletionTimestamp`)或失败时,重新创建 Pod。
207+
- `Failed`:表示在创建替代的 Pod 之前,等待先前创建的 Pod 完全终止(处于 `Failed``Succeeded` 阶段)。
206208

207209
### Selector
208210

@@ -316,26 +318,6 @@ JobSpec 描述了任务执行的情况。
316318
- **podFailurePolicy.rules.onPodConditions.type** (string),必需
317319

318320
指定必需的 Pod 状况类型。要匹配一个 Pod 状况,指定的类型必须等于该 Pod 状况类型。
319-
320-
<!--
321-
Possible enum values:
322-
- `"Count"` This is an action which might be taken on a pod failure - the pod failure is handled in the default way - the counter towards .backoffLimit, represented by the job's .status.failed field, is incremented.
323-
- `"FailIndex"` This is an action which might be taken on a pod failure - mark the Job's index as failed to avoid restarts within this index. This action can only be used when backoffLimitPerIndex is set.
324-
- `"FailJob"` This is an action which might be taken on a pod failure - mark the pod's job as Failed and terminate all running pods.
325-
- `"Ignore"` This is an action which might be taken on a pod failure - the counter towards .backoffLimit, represented by the job's .status.failed field, is not incremented and a replacement pod is created.
326-
-->
327-
328-
可能的枚举值:
329-
- `"Count"` 这是在 Pod 失败时可能会采取的措施
330-
- Pod 失败的默认处理方式
331-
- Job 的 `.status.failed` 字段表示的 `.backoffLimit` 计数器递增。
332-
- `"FailIndex"` 这是在 Pod 失败时可能会采取的措施 —— 将
333-
Job 的索引标记为失败以避免在此索引内重启。此操作仅当设置了 `backoffLimitPerIndex` 时可用。
334-
- `"FailJob"` 这是在 Pod 失败时可能会采取的措施 —— 将 Pod 的 Job 标记为 Failed
335-
并终止所有正在运行的 Pod。
336-
- `"Ignore"` 这是在 Pod 失败时可能会采取的措施 —— 指向 `.backoffLimit`
337-
的计数器(由 Job 的 `.status.failed` 字段表示)不递增,
338-
并创建一个替代 Pod。
339321

340322
<!--
341323
- **podFailurePolicy.rules.onExitCodes** (PodFailurePolicyOnExitCodesRequirement)
@@ -381,15 +363,6 @@ JobSpec 描述了任务执行的情况。
381363

382364
后续会考虑增加其他值。客户端应通过假设不满足要求来对未知操作符做出反应。
383365

384-
<!--
385-
Possible enum values:
386-
- `"In"`
387-
- `"NotIn"`
388-
-->
389-
可能的枚举值:
390-
- `"In"`
391-
- `"NotIn"`
392-
393366
<!--
394367
- **podFailurePolicy.rules.onExitCodes.values** ([]int32), required
395368
@@ -563,21 +536,6 @@ JobSpec 描述了任务执行的情况。
563536
此字段只能在设置 `backoffLimitPerIndex` 时指定。此字段值可以是 `null` 或完成次数之内的值。
564537
当完成次数大于 10^5 时,此字段是必需的且必须小于等于 10^4。
565538

566-
<!--
567-
- **podReplacementPolicy** (string)
568-
569-
podReplacementPolicy specifies when to create replacement Pods. Possible values are: - TerminatingOrFailed means that we recreate pods
570-
when they are terminating (has a metadata.deletionTimestamp) or failed.
571-
- Failed means to wait until a previously created Pod is fully terminated (has phase
572-
Failed or Succeeded) before creating a replacement Pod.
573-
-->
574-
- **podReplacementPolicy**(string)
575-
576-
`podReplacementPolicy` 指定何时创建替代的 Pod。可能的值包括:
577-
578-
- `TerminatingOrFailed`:表示当 Pod 处于终止中(具有 `metadata.deletionTimestamp`)或失败时,重新创建 Pod。
579-
- `Failed`:表示在创建替代的 Pod 之前,等待先前创建的 Pod 完全终止(处于 `Failed``Succeeded` 阶段)。
580-
581539
<!--
582540
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.
583541
-->
@@ -1121,6 +1079,10 @@ GET /apis/batch/v1/namespaces/{namespace}/jobs
11211079
11221080
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
11231081
1082+
- **shardSelector** (*in query*): string
1083+
1084+
<a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>
1085+
11241086
- **timeoutSeconds** (*in query*): integer
11251087
11261088
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
@@ -1133,6 +1095,10 @@ GET /apis/batch/v1/namespaces/{namespace}/jobs
11331095

11341096
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
11351097

1098+
- **shardSelector** (**查询参数**): string
1099+
1100+
<a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>
1101+
11361102
- **timeoutSeconds** (**查询参数**): integer
11371103

11381104
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
@@ -1240,6 +1206,10 @@ GET /apis/batch/v1/jobs
12401206
12411207
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
12421208
1209+
- **shardSelector** (*in query*): string
1210+
1211+
<a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>
1212+
12431213
- **timeoutSeconds** (*in query*): integer
12441214
12451215
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
@@ -1252,6 +1222,10 @@ GET /apis/batch/v1/jobs
12521222

12531223
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
12541224

1225+
- **shardSelector** (**查询参数**): string
1226+
1227+
<a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>
1228+
12551229
- **timeoutSeconds** (**查询参数**): integer
12561230

12571231
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
@@ -1908,13 +1882,21 @@ DELETE /apis/batch/v1/namespaces/{namespace}/jobs
19081882
19091883
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
19101884
1885+
- **shardSelector** (*in query*): string
1886+
1887+
<a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>
1888+
19111889
- **timeoutSeconds** (*in query*): integer
19121890
19131891
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
19141892
-->
19151893
- **sendInitialEvents** (**查询参数**): boolean
19161894

19171895
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
1896+
1897+
- **shardSelector** (**查询参数**): string
1898+
1899+
<a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>
19181900

19191901
- **timeoutSeconds** (**查询参数**): integer
19201902

0 commit comments

Comments
 (0)