Skip to content

Commit a02de94

Browse files
authored
Merge pull request #35035 from windsonsea/static
[zh-cn] updated /tasks/job/indexed-parallel-processing-static.md
2 parents 4215e72 + d4b8f59 commit a02de94

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

content/zh-cn/docs/tasks/job/indexed-parallel-processing-static.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ weight: 30
1515

1616
<!-- overview -->
1717

18-
1918
<!--
2019
In this example, you will run a Kubernetes Job that uses multiple parallel
2120
worker processes.
@@ -25,7 +24,7 @@ to identify which part of the overall task to work on.
2524
-->
2625
在此示例中,你将运行一个使用多个并行工作进程的 Kubernetes Job。
2726
每个 worker 都是在自己的 Pod 中运行的不同容器。
28-
Pod 具有控制平面自动设置的 _索引编号(index number)_
27+
Pod 具有控制平面自动设置的**索引编号(index number)**
2928
这些编号使得每个 Pod 能识别出要处理整个任务的哪个部分。
3029

3130
<!--
@@ -55,7 +54,7 @@ Here is an overview of the steps in this example:
5554
以下是此示例中步骤的概述:
5655

5756
1. **定义使用带索引完成信息的 Job 清单**
58-
Downward API 使你可以将 Pod 索引注释作为环境变量或文件传递给容器
57+
Downward API 使你可以将 Pod 索引注解作为环境变量或文件传递给容器
5958
2. **根据该清单启动一个带索引(`Indexed`)的 Job**
6059

6160
## {{% heading "prerequisites" %}}
@@ -111,7 +110,7 @@ rev data.txt
111110
You'll use the `rev` tool from the
112111
[`busybox`](https://hub.docker.com/_/busybox) container image.
113112
-->
114-
你将使用 [`busybox`](https://hub.docker.com/_/busybox) 容器映像中的 `rev` 工具。
113+
你将使用 [`busybox`](https://hub.docker.com/_/busybox) 容器镜像中的 `rev` 工具。
115114

116115
<!--
117116
As this is only an example, each Pod only does a tiny piece of work (reversing a short
@@ -123,9 +122,9 @@ frame of that video clip. Indexed completion would mean that each Pod in
123122
the Job knows which frame to render and publish, by counting frames from
124123
the start of the clip.
125124
-->
126-
由于这只是一个例子,每个 Pod 只做一小部分工作(反转一个短字符串)。
127-
例如,在实际工作负载中,你可能会创建一个表示基于场景数据制作 60 秒视频的任务的 Job 。
128-
视频渲染 Job 中的每个工作项都将渲染该视频剪辑的特定帧。
125+
由于这只是一个例子,每个 Pod 只做一小部分工作(反转一个短字符串)。
126+
例如,在实际工作负载中,你可能会创建一个表示基于场景数据制作 60 秒视频任务的 Job 。
127+
此视频渲染 Job 中的每个工作项都将渲染该视频剪辑的特定帧。
129128
索引完成意味着 Job 中的每个 Pod 都知道通过从剪辑开始计算帧数,来确定渲染和发布哪一帧,。
130129

131130
<!-- ## Define an Indexed Job -->
@@ -150,7 +149,7 @@ from a [ConfigMap as an environment variable or file](/docs/tasks/configure-pod-
150149
-->
151150
在上面的示例中,你使用 Job 控制器为所有容器设置的内置 `JOB_COMPLETION_INDEX` 环境变量。
152151
[Init 容器](/zh-cn/docs/concepts/workloads/pods/init-containers/)
153-
将索引映射到一个静态值,并将其写入一个文件,该文件通过
152+
将索引映射到一个静态值,并将其写入一个文件,该文件通过
154153
[emptyDir 卷](/zh-cn/docs/concepts/storage/volumes/#emptydir)
155154
与运行 worker 的容器共享。或者,你可以
156155
[通过 Downward API 定义自己的环境变量](/zh-cn/docs/tasks/inject-data-application/environment-variable-expose-pod-information/)
@@ -187,14 +186,14 @@ Because `.spec.parallelism` is less than `.spec.completions`, the control plane
187186
188187
Once you have created the Job, wait a moment then check on progress:
189188
-->
190-
当你创建此 Job 时,控制平面会创建一系列 Pod,每个索引都由你指定
191-
`.spec.parallelism` 的值决定了一次可以运行多少个,
189+
当你创建此 Job 时,控制平面会创建一系列 Pod,你指定的每个索引都会运行一个 Pod
190+
`.spec.parallelism` 的值决定了一次可以运行多少个 Pod
192191
`.spec.completions` 决定了 Job 总共创建了多少个 Pod。
193192

194193
因为 `.spec.parallelism` 小于 `.spec.completions`
195-
控制平面在启动更多 Pod 之前,等待部分第一批 Pod 完成。
194+
所以控制平面在启动更多 Pod 之前,将等待第一批的某些 Pod 完成。
196195

197-
创建 Job 后,稍等片刻,然后检查进度
196+
创建 Job 后,稍等片刻,就能检查进度
198197

199198
```shell
200199
kubectl describe jobs/indexed-job
@@ -274,4 +273,4 @@ kubectl logs indexed-job-fdhq5 # 更改它以匹配来自该 Job 的 Pod 的名
274273

275274
```
276275
xuq
277-
```
276+
```

0 commit comments

Comments
 (0)