[zh-cn] sync images kubeadm_init_phase_addon_coredns

Signed-off-by: xin.li <xin.li@daocloud.io>
pull/46507/head
xin.li 2024-05-23 18:35:02 +08:00
parent cc701b3693
commit 5ade596a27
2 changed files with 80 additions and 27 deletions

View File

@ -53,10 +53,10 @@ Container images are usually given a name such as `pause`, `example/mycontainer`
Images can also include a registry hostname; for example: `fictional.registry.example/imagename`,
and possibly a port number as well; for example: `fictional.registry.example:10443/imagename`.
If you don't specify a registry hostname, Kubernetes assumes that you mean the Docker public registry.
If you don't specify a registry hostname, Kubernetes assumes that you mean the [Docker public registry](https://hub.docker.com/).
After the image name part you can add a _tag_ (in the same way you would when using with commands
like `docker` or `podman`). Tags let you identify different versions of the same series of images.
You can change this behaviour by setting default image registry in
[container runtime](/docs/setup/production-environment/container-runtimes/) configuration.
-->
## 镜像名称 {#image-names}
@ -64,22 +64,70 @@ like `docker` or `podman`). Tags let you identify different versions of the sam
镜像名称也可以包含所在仓库的主机名。例如:`fictional.registry.example/imagename`。
还可以包含仓库的端口号,例如:`fictional.registry.example:10443/imagename`。
如果你不指定仓库的主机名Kubernetes 认为你在使用 Docker 公共仓库。
如果你不指定仓库的主机名Kubernetes 认为你在使用 [Docker 公共仓库](https://hub.docker.com/)
在镜像名称之后,你可以添加一个**标签Tag**(与使用 `docker``podman` 等命令时的方式相同)。
你可以通过在[容器运行时](/zh-cn/docs/setup/production-environment/container-runtimes/)
配置中设置默认镜像仓库来更改此行为。
<!--
After the image name part you can add a _tag_ or _digest_ (in the same way you would when using with commands
like `docker` or `podman`). Tags let you identify different versions of the same series of images.
Digests are a unique identifier for a specific version of an image. Digests are hashes of the image's content,
and are immutable. Tags can be moved to point to different images, but digests are fixed.
-->
在镜像名称之后,你可以添加一个**标签Tag** 或 **摘要digest**
(与使用 `docker``podman` 等命令时的方式相同)。
使用标签能让你辨识同一镜像序列中的不同版本。
摘要是特定版本镜像的唯一标识符,是镜像内容的哈希值,不可变。
<!--
Image tags consist of lowercase and uppercase letters, digits, underscores (`_`),
periods (`.`), and dashes (`-`).
There are additional rules about where you can place the separator
characters (`_`, `-`, and `.`) inside an image tag.
periods (`.`), and dashes (`-`). It can be up to 128 characters long. And must follow the
next regex pattern: `[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}`
You can read more about and find validation regex in the
[OCI Distribution Specification](https://github.com/opencontainers/distribution-spec/blob/master/spec.md#workflow-categories).
If you don't specify a tag, Kubernetes assumes you mean the tag `latest`.
-->
镜像标签可以包含小写字母、大写字母、数字、下划线(`_`)、句点(`.`)和连字符(`-`)。
关于在镜像标签中何处可以使用分隔字符(`_`、`-` 和 `.`)还有一些额外的规则。
它的长度最多为 128 个字符,并且必须遵循正则表达式模式:`[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}`。
你可以在 [OCI 分发规范](https://github.com/opencontainers/distribution-spec/blob/master/spec.md#workflow-categories)
中阅读有关并找到验证正则表达式的更多信息。
如果你不指定标签Kubernetes 认为你想使用标签 `latest`
<!--
Image digests consists of a hash algorithm (such as `sha256`) and a hash value. For example:
`sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07`
You can find more information about digests format in the
[OCI Image Specification](https://github.com/opencontainers/image-spec/blob/master/descriptor.md#digests).
-->
图像摘要由哈希算法(例如 `sha256`)和哈希值组成,例如:
`sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07`
你可以在 [OCI 镜像规范](https://github.com/opencontainers/image-spec/blob/master/descriptor.md#digests)
中找到有关摘要格式的更多信息。
<!--
Some image name examples that Kubernetes can use are:
-->
Kubernetes 可以使用的一些镜像名称示例包括:
<!--
- `busybox` - Image name only, no tag or digest. Kubernetes will use Docker public registry and latest tag. (Same as `docker.io/library/busybox:latest`)
- `busybox:1.32.0` - Image name with tag. Kubernetes will use Docker public registry. (Same as `docker.io/library/busybox:1.32.0`)
- `registry.k8s.io/pause:latest` - Image name with a custom registry and latest tag.
- `registry.k8s.io/pause:3.5` - Image name with a custom registry and non-latest tag.
- `registry.k8s.io/pause@sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07` - Image name with digest.
- `registry.k8s.io/pause:3.5@sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07` - Image name with tag and digest. Only digest will be used for pulling.
-->
- `busybox` - 仅包含镜像名称没有标签或摘要Kubernetes 将使用 Docker 公共镜像仓库和 `latest` 标签。
(例如 `docker.io/library/busybox:latest`
- `busybox:1.32.0` - 带标签的镜像名称Kubernetes 将使用 Docker 公共镜像仓库。
(例如 `docker.io/library/busybox:1.32.0`
- `registry.k8s.io/pause:latest` - 带有自定义镜像仓库和 `latest` 标签的镜像名称。
- `registry.k8s.io/pause:3.5` - 带有自定义镜像仓库和非 `latest` 标签的镜像名称。
- `registry.k8s.io/pause@sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07` - 带摘要的镜像名称。
- `registry.k8s.io/pause:3.5@sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07` - 带有标签和摘要的镜像名称,镜像拉取仅参考摘要。
<!--
## Updating images
@ -143,7 +191,7 @@ these values have:
否则kubelet 就会使用解析后的摘要拉取镜像,并使用该镜像来启动容器。
`Never`
: Kubelet 不会尝试获取镜像。如果镜像已经以某种方式存在本地,
: kubelet 不会尝试获取镜像。如果镜像已经以某种方式存在本地,
kubelet 会尝试启动容器;否则,会启动失败。
更多细节见[提前拉取镜像](#pre-pulled-images)。
@ -176,7 +224,8 @@ replace `<image-name>:<tag>` with `<image-name>@<digest>`
(for example, `image@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2`).
-->
为了确保 Pod 总是使用相同版本的容器镜像,你可以指定镜像的摘要;
`<image-name>:<tag>` 替换为 `<image-name>@<digest>`,例如 `image@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2`
`<image-name>:<tag>` 替换为 `<image-name>@<digest>`,例如
`image@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2`
<!--
When using image tags, if the image registry were to change the code that the tag on that image
@ -241,11 +290,11 @@ For example, if you create a Deployment with an image whose tag is _not_
`imagePullPolicy` field will _not_ change to `Always`. You must manually change
the pull policy of any object after its initial creation.
-->
容器的 `imagePullPolicy` 的值总是在对象初次 _创建_ 时设置的,
容器的 `imagePullPolicy` 的值总是在对象初次**创建**时设置的,
如果后来镜像的标签或摘要发生变化,则不会更新。
例如,如果你用一个 **非** `:latest` 的镜像标签创建一个 Deployment
并在随后更新该 Deployment 的镜像标签为 `:latest`,则 `imagePullPolicy` 字段 **不会** 变成 `Always`
例如,如果你用一个**非** `:latest` 的镜像标签创建一个 Deployment
并在随后更新该 Deployment 的镜像标签为 `:latest`,则 `imagePullPolicy` 字段**不会**变成 `Always`
你必须手动更改已经创建的资源的拉取策略。
{{< /note >}}
@ -391,8 +440,8 @@ until at least one ongoing image pull is complete.
-->
`serializeImagePulls` 被设置为 false 时kubelet 默认对同时拉取的最大镜像数量没有限制。
如果你想限制并行镜像拉取的数量,可以在 kubelet 配置中设置字段 `maxParallelImagePulls`
`maxParallelImagePulls` 设置为 _n_ 时,只能同时拉取 _n_ 个镜像,
超过 _n_ 的任何镜像都必须等到至少一个正在进行拉取的镜像拉取完成后,才能拉取。
`maxParallelImagePulls` 设置为 **n** 时,只能同时拉取 **n** 个镜像,
超过 **n** 的任何镜像都必须等到至少一个正在进行拉取的镜像拉取完成后,才能拉取。
<!--
Limiting the number parallel image pulls would prevent image pulling from consuming

View File

@ -11,7 +11,8 @@ Install the CoreDNS addon to a Kubernetes cluster
<!--
Install the CoreDNS addon components via the API server. Please note that although the DNS server is deployed, it will not be scheduled until CNI is installed.
-->
通过 API 服务器安装 CoreDNS 附加组件。请注意,即使 DNS 服务器已部署,在安装 CNI 之前 DNS 服务器不会被调度执行。
通过 API 服务器安装 CoreDNS 附加组件。请注意,即使 DNS 服务器已部署,在安装 CNI
之前 DNS 服务器不会被调度执行。
```
kubeadm init phase addon coredns [flags]
@ -34,10 +35,10 @@ kubeadm init phase addon coredns [flags]
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.
-->
<p>
kubeadm 配置文件的路径。
</p>
</td>
@ -62,19 +63,21 @@ Don't apply any changes; just output what would be done.
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
A set of key=value pairs that describe feature gates for various features. Options are:<br/>
EtcdLearnerMode=true|false (ALPHA - default=false)<br/>
PublicKeysECDSA=true|false (ALPHA - default=false)<br/>
EtcdLearnerMode=true|false (BETA - default=true)<br/>
PublicKeysECDSA=true|false (DEPRECATED - default=false)<br/>
RootlessControlPlane=true|false (ALPHA - default=false)<br/>
UpgradeAddonsBeforeControlPlane=true|false (DEPRECATED - default=false)
UpgradeAddonsBeforeControlPlane=true|false (DEPRECATED - default=false)<br/>
WaitForAllControlPlaneComponents=true|false (ALPHA - default=false)
-->
<p>
一组用来描述各种特性门控的键值key=value对。选项是<br/>
EtcdLearnerMode=true|false (ALPHA - 默认值=false)<br/>
PublicKeysECDSA=true|false (ALPHA - 默认值=false)<br/>
一组用来描述各种特性门控的键值对key=value。选项是<br/>
EtcdLearnerMode=true|false (BETA - 默认值=true)<br/>
PublicKeysECDSA=true|false (DEPRECATED - 默认值=false)<br/>
RootlessControlPlane=true|false (ALPHA - 默认值=false)<br/>
UpgradeAddonsBeforeControlPlane=true|false (DEPRECATED - 默认值=false)
UpgradeAddonsBeforeControlPlane=true|false (DEPRECATED - 默认值=false)<br/>
WaitForAllControlPlaneComponents=true|false (ALPHA - 默认值=false)
</p>
</td>
</tr>
@ -126,7 +129,8 @@ Choose a container registry to pull control plane images from
The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.
-->
<p>
与集群通信时使用的 kubeconfig 文件。如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。
与集群通信时使用的 kubeconfig 文件。如果未设置该参数,则可以在一组标准位置中搜索现有的
kubeconfig 文件。
</p>
</td>
</tr>