This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.5.3. 镜像拉取(pull)策略
Pod 中的每个容器均有容器镜像。您创建了镜像并将其推送(push)到 registry 后,即可在 Pod 中引用它。
5.3.1. 镜像拉取(pull)策略概述 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
OpenShift Container Platform 在创建容器时,会使用容器的 imagePullPolicy 来决定是否应在启动容器前拉取(pull)镜像。imagePullPolicy 有三个可能的值:
| 值 | 描述 |
|---|---|
|
| 始终拉取(pull)镜像。 |
|
| 仅拉取(pull)节点上不存在的镜像。 |
|
| 永不拉取(pull)镜像。 |
如果没有指定容器的 imagePullPolicy 参数,OpenShift Container Platform 会根据镜像标签来设置。
-
如果标签为
latest,OpenShift Container Platform 会将imagePullPolicy默认设置为Always。 -
否则,OpenShift Container Platform 会将
imagePullPolicy默认设置为IfNotPresent。