Skip to content

Commit 31eabc7

Browse files
authored
Merge pull request #31135 from shuaijinchao/zh/sync/configure-pod-container/pull-image-private-registry
[zh] synchronize translate pull-image-private-registry.md
2 parents 08ffbe8 + a6bc41f commit 31eabc7

File tree

1 file changed

+39
-27
lines changed

1 file changed

+39
-27
lines changed

content/zh/docs/tasks/configure-pod-container/pull-image-private-registry.md

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,26 @@ weight: 100
1313
<!-- overview -->
1414

1515
<!--
16-
This page shows how to create a Pod that uses a Secret to pull an image from a
17-
private Docker registry or repository.
16+
This page shows how to create a Pod that uses a
17+
{{< glossary_tooltip text="Secret" term_id="secret" >}} to pull an image from a
18+
private container image registry or repository.
1819
-->
19-
本文介绍如何使用 Secret 从私有的 Docker 镜像仓库或代码仓库拉取镜像来创建 Pod。
20+
本文介绍如何使用 {{< glossary_tooltip text="Secret" term_id="secret" >}}
21+
从私有的镜像仓库或代码仓库拉取镜像来创建 Pod。
22+
23+
{{% thirdparty-content single="true" %}}
2024

2125
## {{% heading "prerequisites" %}}
2226

23-
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
27+
* {{< include "task-tutorial-prereqs.md" >}}
2428

2529
<!--
26-
* To do this exercise, you need a
27-
[Docker ID](https://docs.docker.com/docker-id/) and password.
30+
* To do this exercise, you need the `docker` command line tool, and a
31+
[Docker ID](https://docs.docker.com/docker-id/) for which you know the password.
2832
-->
29-
你需要 [Docker ID](https://docs.docker.com/docker-id/) 和密码来进行本练习。
33+
34+
要进行此练习,你需要 `docker` 命令行工具和一个知道密码的
35+
[Docker ID](https://docs.docker.com/docker-id/)
3036

3137
<!-- steps -->
3238

@@ -44,15 +50,18 @@ docker login
4450
```
4551

4652
<!--
47-
When prompted, enter your Docker username and password.
53+
When prompted, enter your Docker ID, and then the credential you want to use (access token,
54+
or the password for your Docker ID).
4855
49-
The login process creates or updates a `config.json` file that holds an authorization token.
56+
The login process creates or updates a `config.json` file that holds an authorization token. Review [how Kubernetes interprets this file](/docs/concepts/containers/images#config-json).
5057
5158
View the `config.json` file:
5259
-->
53-
当出现提示时,输入 Docker 用户名和密码。
60+
当出现提示时,输入您的 Docker ID 和登录凭证(访问令牌、
61+
或 Docker ID 的密码)。
5462

5563
登录过程会创建或更新保存有授权令牌的 `config.json` 文件。
64+
查看 [Kubernetes 中如何解析这个文件](/zh/docs/concepts/containers/images#config-json)
5665

5766
查看 `config.json` 文件:
5867

@@ -125,7 +134,7 @@ You have successfully set your Docker credentials in the cluster as a Secret cal
125134
* `<your-pword>` 是你的 Docker 密码。
126135
* `<your-email>` 是你的 Docker 邮箱。
127136

128-
这样你就成功地将集群中的 Docker 凭据设置为名为 `regcred` 的 Secret。
137+
这样你就成功地将集群中的 Docker 凭证设置为名为 `regcred` 的 Secret。
129138

130139
<!--
131140
## Inspecting the Secret `regcred`
@@ -161,7 +170,7 @@ The value of the `.dockerconfigjson` field is a base64 representation of your Do
161170
To understand what is in the `.dockerconfigjson` field, convert the secret data to a
162171
readable format:
163172
-->
164-
`.dockerconfigjson` 字段的值是 Docker 凭据的 base64 表示。
173+
`.dockerconfigjson` 字段的值是 Docker 凭证的 base64 表示。
165174

166175
要了解 `dockerconfigjson` 字段中的内容,请将 Secret 数据转换为可读格式:
167176

@@ -201,24 +210,27 @@ You have successfully set your Docker credentials as a Secret called `regcred` i
201210
-->
202211
注意,Secret 数据包含与本地 `~/.docker/config.json` 文件类似的授权令牌。
203212

204-
这样你就已经成功地将 Docker 凭据设置为集群中的名为 `regcred` 的 Secret。
213+
这样你就已经成功地将 Docker 凭证设置为集群中的名为 `regcred` 的 Secret。
205214

206215
<!--
207216
## Create a Pod that uses your Secret
208217

209-
Here is a configuration file for a Pod that needs access to your Docker credentials in `regcred`:
218+
Here is a manifest for an example Pod that needs access to your Docker credentials in `regcred`:
210219
-->
211220
## 创建一个使用你的 Secret 的 Pod
212221

213-
下面是一个 Pod 配置文件,它需要访问 `regcred` 中的 Docker 凭据
222+
下面是一个 Pod 配置清单示例,该示例中 Pod 需要访问你的 Docker 凭证 `regcred`
214223

215224
{{< codenew file="pods/private-reg-pod.yaml" >}}
216225

217-
<!-- Download the above file: -->
218-
下载上述文件:
226+
<!--
227+
Download the above file onto your computer:
228+
-->
229+
230+
将上述文件下载到你的计算机中:
219231

220232
```shell
221-
wget -O my-private-reg-pod.yaml https://k8s.io/examples/pods/private-reg-pod.yaml
233+
curl -L -O my-private-reg-pod.yaml https://k8s.io/examples/pods/private-reg-pod.yaml
222234
```
223235

224236
<!--
@@ -250,17 +262,17 @@ kubectl get pod private-reg
250262
## {{% heading "whatsnext" %}}
251263

252264
<!--
253-
* Learn more about [Secrets](/docs/concepts/configuration/secret/).
265+
* Learn more about [Secrets](/docs/concepts/configuration/secret/)
266+
* or read the API reference for {{< api-reference page="config-and-storage-resources/secret-v1" >}}
254267
* Learn more about [using a private registry](/docs/concepts/containers/images/#using-a-private-registry).
268+
* Learn more about [adding image pull secrets to a service account](/docs/tasks/configure-pod-container/configure-service-account/#add-imagepullsecrets-to-a-service-account).
255269
* See [kubectl create secret docker-registry](/docs/reference/generated/kubectl/kubectl-commands/#-em-secret-docker-registry-em-).
256-
* See [Secret](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#secret-v1-core).
257-
* See the `imagePullSecrets` field of [PodSpec](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podspec-v1-core).
270+
* See the `imagePullSecrets` field within the [container definitions](/docs/reference/kubernetes-api/workload-resources/pod-v1/#containers) of a Pod
258271
-->
259272

260-
* 进一步了解 [Secret](/zh/docs/concepts/configuration/secret/)
273+
* 进一步了解 [Secrets](/zh/docs/concepts/configuration/secret/)
274+
* 或阅读 {{< api-reference page="config-and-storage-resources/secret-v1" >}} 的 API 参考
261275
* 进一步了解 [使用私有仓库](/zh/docs/concepts/containers/images/#using-a-private-registry)
262-
* 参考 [kubectl create secret docker-registry](/docs/reference/generated/kubectl/kubectl-commands/#-em-secret-docker-registry-em-)
263-
* 参考 [Secret](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#secret-v1-core)
264-
* 参考 [PodSpec](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podspec-v1-core) 中的 `imagePullSecrets` 字段
265-
266-
276+
* 进一步了解 [为服务账户添加拉取镜像凭证](/zh/docs/tasks/configure-pod-container/configure-service-account/#add-imagepullsecrets-to-a-service-account)
277+
* 查看 [kubectl 创建 docker-registry 凭证](/docs/reference/generated/kubectl/kubectl-commands/#-em-secret-docker-registry-em-)
278+
* 查看 Pod [容器定义](/docs/reference/kubernetes-api/workload-resources/pod-v1/#containers)中的 `imagePullSecrets` 字段。

0 commit comments

Comments
 (0)