Skip to content

Commit e69365a

Browse files
authored
Merge pull request #40641 from Zhuzhenghao/images
[zh] sync 1.27 images
2 parents 7484851 + ff72402 commit e69365a

File tree

1 file changed

+101
-11
lines changed
  • content/zh-cn/docs/concepts/containers

1 file changed

+101
-11
lines changed

content/zh-cn/docs/concepts/containers/images.md

Lines changed: 101 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This page provides an outline of the container image concept.
3838
<!--
3939
If you are looking for the container images for a Kubernetes
4040
release (such as v{{< skew latestVersion >}}, the latest minor release),
41-
visit [Download Kubernetes](https://kubernetes.io/releases/download/).
41+
visit [Download Kubernetes](https://kubernetes.io/releases/download/).
4242
-->
4343
如果你正在寻找 Kubernetes 某个发行版本(如最新次要版本 v{{< skew latestVersion >}})
4444
的容器镜像,请访问[下载 Kubernetes](/zh-cn/releases/download/)
@@ -55,8 +55,8 @@ and possibly a port number as well; for example: `fictional.registry.example:104
5555
5656
If you don't specify a registry hostname, Kubernetes assumes that you mean the Docker public registry.
5757
58-
After the image name part you can add a _tag_ (in the same way you would when using with commands like `docker` or `podman`).
59-
Tags let you identify different versions of the same series of images.
58+
After the image name part you can add a _tag_ (in the same way you would when using with commands
59+
like `docker` or `podman`). Tags let you identify different versions of the same series of images.
6060
-->
6161
## 镜像名称 {#image-names}
6262

@@ -71,9 +71,9 @@ Tags let you identify different versions of the same series of images.
7171

7272
<!--
7373
Image tags consist of lowercase and uppercase letters, digits, underscores (`_`),
74-
periods (`.`), and dashes (`-`).
74+
periods (`.`), and dashes (`-`).
7575
There are additional rules about where you can place the separator
76-
characters (`_`, `-`, and `.`) inside an image tag.
76+
characters (`_`, `-`, and `.`) inside an image tag.
7777
If you don't specify a tag, Kubernetes assumes you mean the tag `latest`.
7878
-->
7979
镜像标签可以包含小写字母、大写字母、数字、下划线(`_`)、句点(`.`)和连字符(`-`)。
@@ -199,7 +199,7 @@ running the same code no matter what tag changes happen at the registry.
199199
在创建 Pod(和 Pod 模板)时产生变更,这样运行的工作负载就是根据镜像摘要,而不是标签来定义的。
200200
无论镜像仓库上的标签发生什么变化,你都想确保你所有的工作负载都运行相同的代码,那么指定镜像摘要会很有用。
201201

202-
<!--
202+
<!--
203203
#### Default image pull policy {#imagepullpolicy-defaulting}
204204
205205
When you (or a controller) submit a new Pod to the API server, your cluster sets the
@@ -293,6 +293,91 @@ which is 300 seconds (5 minutes).
293293

294294
Kubernetes 会增加每次尝试之间的延迟,直到达到编译限制,即 300 秒(5 分钟)。
295295

296+
<!--
297+
## Serial and parallel image pulls
298+
-->
299+
## 串行和并行镜像拉取 {#serial-and-parallel-image-pulls}
300+
301+
<!--
302+
By default, kubelet pulls images serially. In other words, kubelet sends only
303+
one image pull request to the image service at a time. Other image pull requests
304+
have to wait until the one being processed is complete.
305+
-->
306+
默认情况下,kubelet 以串行方式拉取镜像。
307+
也就是说,kubelet 一次只向镜像服务发送一个镜像拉取请求。
308+
其他镜像拉取请求必须等待,直到正在处理的那个请求完成。
309+
310+
<!--
311+
Nodes make image pull decisions in isolation. Even when you use serialized image
312+
pulls, two different nodes can pull the same image in parallel.
313+
-->
314+
节点独立地做出镜像拉取的决策。即使你使用串行的镜像拉取,两个不同的节点也可以并行拉取相同的镜像。
315+
316+
<!--
317+
If you would like to enable parallel image pulls, you can set the field
318+
`serializeImagePulls` to false in the [kubelet configuration](/docs/reference/config-api/kubelet-config.v1beta1/).
319+
With `serializeImagePulls` set to false, image pull requests will be sent to the image service immediately,
320+
and multiple images will be pulled at the same time.
321+
-->
322+
如果你想启用并行镜像拉取,可以在 [kubelet 配置](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)
323+
中将字段 `serializeImagePulls` 设置为 false。
324+
325+
`serializeImagePulls` 设置为 false 时,kubelet 会立即向镜像服务发送镜像拉取请求,多个镜像将同时被拉动。
326+
327+
<!--
328+
When enabling parallel image pulls, please make sure the image service of your
329+
container runtime can handle parallel image pulls.
330+
-->
331+
启用并行镜像拉取时,请确保你的容器运行时的镜像服务可以处理并行镜像拉取。
332+
333+
<!--
334+
The kubelet never pulls multiple images in parallel on behalf of one Pod. For example,
335+
if you have a Pod that has an init container and an application container, the image
336+
pulls for the two containers will not be parallelized. However, if you have two
337+
Pods that use different images, the kubelet pulls the images in parallel on
338+
behalf of the two different Pods, when parallel image pulls is enabled.
339+
-->
340+
kubelet 从不代表一个 Pod 并行地拉取多个镜像。
341+
342+
例如,如果你有一个 Pod,它有一个初始容器和一个应用容器,那么这两个容器的镜像拉取将不会并行。
343+
但是,如果你有两个使用不同镜像的 Pod,当启用并行镜像拉取时,kubelet 会代表两个不同的 Pod 并行拉取镜像。
344+
345+
<!--
346+
### Maximum parallel image pulls
347+
-->
348+
### 最大并行镜像拉取数量 {#maximum-parallel-image-pulls}
349+
350+
{{< feature-state for_k8s_version="v1.27" state="alpha" >}}
351+
352+
<!--
353+
When `serializeImagePulls` is set to false, the kubelet defaults to no limit on the
354+
maximum number of images being pulled at the same time. If you would like to
355+
limit the number of parallel image pulls, you can set the field `maxParallelImagePulls`
356+
in kubelet configuration. With `maxParallelImagePulls` set to _n_, only _n_ images
357+
can be pulled at the same time, and any image pull beyond _n_ will have to wait
358+
until at least one ongoing image pull is complete.
359+
-->
360+
`serializeImagePulls` 被设置为 false 时,kubelet 默认对同时拉取的最大镜像数量没有限制。
361+
如果你想限制并行镜像拉取的数量,可以在 kubelet 配置中设置字段 `maxParallelImagePulls`
362+
`maxParallelImagePulls` 设置为 _n_ 时,只能同时拉取 _n_ 个镜像,
363+
超过 _n_ 的任何镜像都必须等到至少一个正在进行拉取的镜像拉取完成后,才能拉取。
364+
365+
<!--
366+
Limiting the number parallel image pulls would prevent image pulling from consuming
367+
too much network bandwidth or disk I/O, when parallel image pulling is enabled.
368+
-->
369+
当启用并行镜像拉取时,限制并行镜像拉取的数量可以防止镜像拉取消耗过多的网络带宽或磁盘 I/O。
370+
371+
<!--
372+
You can set `maxParallelImagePulls` to a positive number that is greater than or
373+
equal to 1. If you set `maxParallelImagePulls` to be greater than or equal to 2, you
374+
must set the `serializeImagePulls` to false. The kubelet will fail to start with invalid
375+
`maxParallelImagePulls` settings.
376+
-->
377+
你可以将 `maxParallelImagePulls` 设置为大于或等于 1 的正数。
378+
如果将 `maxParallelImagePulls` 设置为大于等于 2,则必须将 `serializeImagePulls` 设置为 false。
379+
kubelet 在无效的 `maxParallelImagePulls` 设置下会启动失败。
380+
296381
<!--
297382
## Multi-architecture images with image indexes
298383
@@ -327,7 +412,7 @@ YAML 文件也能兼容。
327412
<!--
328413
## Using a private registry
329414
330-
Private registries may require keys to read images from them.
415+
Private registries may require keys to read images from them.
331416
Credentials can be provided in several ways:
332417
-->
333418
## 使用私有仓库 {#using-a-private-registry}
@@ -340,7 +425,7 @@ Credentials can be provided in several ways:
340425
- all pods can read any configured private registries
341426
- requires node configuration by cluster administrator
342427
- Kubelet Credential Provider to dynamically fetch credentials for private registries
343-
- kubelet can be configured to use credential provider exec plugin
428+
- kubelet can be configured to use credential provider exec plugin
344429
for the respective private registry.
345430
- Pre-pulled Images
346431
- all pods can use any images cached on a node
@@ -376,7 +461,7 @@ These options are explained in more detail below.
376461
Specific instructions for setting credentials depends on the container runtime and registry you
377462
chose to use. You should refer to your solution's documentation for the most accurate information.
378463
-->
379-
### 配置 Node 对私有仓库认证 {#configuring-nodes-to-authenticate-to-a-private-registry}
464+
### 配置 Node 对私有仓库认证 {#configuring-nodes-to-authenticate-to-a-private-registry}
380465

381466
设置凭据的具体说明取决于你选择使用的容器运行时和仓库。
382467
你应该参考解决方案的文档来获取最准确的信息。
@@ -390,6 +475,11 @@ task. That example uses a private registry in Docker Hub.
390475
请参阅任务[从私有镜像库中拉取镜像](/zh-cn/docs/tasks/configure-pod-container/pull-image-private-registry)
391476
该示例使用 Docker Hub 中的私有镜像仓库。
392477

478+
<!--
479+
### Kubelet credential provider for authenticated image pulls {#kubelet-credential-provider}
480+
-->
481+
### 用于认证镜像拉取的 kubelet 凭据提供程序 {#kubelet-credential-provider}
482+
393483
{{< note >}}
394484
<!--
395485
This approach is especially suitable when kubelet needs to fetch registry credentials dynamically.
@@ -470,7 +560,7 @@ term:
470560
c 匹配字符 c (c 不为 '*', '?', '\\', '[')
471561
'\\' c 匹配字符 c
472562
473-
字符范围:
563+
字符范围:
474564
c 匹配字符 c (c 不为 '\\', '?', '-', ']')
475565
'\\' c 匹配字符 c
476566
lo '-' hi 匹配字符范围在 lo 到 hi 之间字符
@@ -600,7 +690,7 @@ kubectl create secret docker-registry <name> \
600690
<!--
601691
If you already have a Docker credentials file then, rather than using the above
602692
command, you can import the credentials file as a Kubernetes
603-
{{< glossary_tooltip text="Secrets" term_id="secret" >}}.
693+
{{< glossary_tooltip text="Secrets" term_id="secret" >}}.
604694
[Create a Secret based on existing Docker credentials](/docs/tasks/configure-pod-container/pull-image-private-registry/#registry-secret-existing-credentials)
605695
explains how to set this up.
606696
-->

0 commit comments

Comments
 (0)