You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using image tags, if the image registry were to change the code that the tag on that image represents, you might end up with a mix of Pods running the old and new code. An image digest uniquely identifies a specific version of the image, so Kubernetes runs the same code every time it starts a container with that image name and digest specified. Specifying an image fixes the code that you run so that a change at the registry cannot lead to that mix of versions.
170
+
When using image tags, if the image registry were to change the code that the tag on that image represents, you might end up with a mix of Pods running the old and new code. An image digest uniquely identifies a specific version of the image, so Kubernetes runs the same code every time it starts a container with that image name and digest specified. Specifying an image by digest fixes the code that you run so that a change at the registry cannot lead to that mix of versions.
173
171
174
172
There are third-party [admission controllers](/docs/reference/access-authn-authz/admission-controllers/)
175
173
that mutate Pods (and pod templates) when they are created, so that the
@@ -179,7 +177,7 @@ running the same code no matter what tag changes happen at the registry.
179
177
-->
180
178
当使用镜像标签时,如果镜像仓库修改了代码所对应的镜像标签,可能会出现新旧代码混杂在 Pod 中运行的情况。
在创建 Pod(和 Pod 模板)时产生变更,这样运行的工作负载就是根据镜像摘要,而不是标签来定义的。
@@ -346,17 +344,12 @@ These options are explained in more detail below.
346
344
<!--
347
345
### Configuring nodes to authenticate to a private registry
348
346
349
-
If you run Docker on your nodes, you can configure the Docker container
350
-
runtime to authenticate to a private container registry.
351
-
352
-
This approach is suitable if you can control node configuration.
347
+
Specific instructions for setting credentials depends on the container runtime and registry you chose to use. You should refer to your solution's documentation for the most accurate information.
353
348
-->
354
349
### 配置 Node 对私有仓库认证
355
350
356
-
如果你在节点上运行的是 Docker,你可以配置 Docker
357
-
容器运行时来向私有容器仓库认证身份。
358
-
359
-
此方法适用于能够对节点进行配置的场合。
351
+
设置凭据的具体说明取决于你选择使用的容器运行时和仓库。
352
+
你应该参考解决方案的文档来获取最准确的信息。
360
353
361
354
<!--
362
355
Default Kubernetes only supports the `auths` and `HttpHeaders` section in Docker configuration.
You may have to set `HOME=/root` explicitly in the environment of the kubelet process.
399
-
-->
400
-
{{< note >}}
401
-
你可能不得不为 `kubelet` 进程显式地设置 `HOME=/root` 环境变量。
402
-
{{< /note >}}
403
-
404
-
<!--
405
-
Here are the recommended steps to configuring your nodes to use a private registry. In this
406
-
example, run these on your desktop/laptop:
364
+
For an example of configuring a private container image registry, see the
365
+
[Pull an Image from a Private Registry](/docs/tasks/configure-pod-container/pull-image-private-registry)
366
+
task. That example uses a private registry in Docker Hub.
407
367
-->
408
-
推荐采用如下步骤来配置节点以便访问私有仓库。以下示例中,在 PC 或笔记本电脑中操作:
409
-
410
-
<!--
411
-
1. Run `docker login [server]` for each set of credentials you want to use. This updates `$HOME/.docker/config.json` on your PC.
412
-
1. View `$HOME/.docker/config.json` in an editor to ensure it contains only the credentials you want to use.
413
-
1. Get a list of your nodes; for example:
414
-
- if you want the names: `nodes=$( kubectl get nodes -o jsonpath='{range.items[*].metadata}{.name} {end}' )`
415
-
- if you want to get the IP addresses: `nodes=$( kubectl get nodes -o jsonpath='{range .items[*].status.addresses[?(@.type=="ExternalIP")]}{.address} {end}' )`
416
-
1. Copy your local `.docker/config.json` to one of the search paths list above.
417
-
- for example, to test this out: `for n in $nodes; do scp ~/.docker/config.json root@"$n":/var/lib/kubelet/config.json; done`
0 commit comments