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.11.2.12.2.3. 为 IBM Power 系统配置容器镜像仓库(registry)存储
作为集群管理员,在安装后需要配置 registry 来使用存储。
先决条件
- 具有 Cluster Administrator 权限
- IBM Power 系统上的 IBM Z. 集群。
为集群置备的持久性存储。
重要如果您只有一个副本,OpenShift Container Platform 支持对镜像 registry 存储的
ReadWriteOnce
访问。要部署支持高可用性的、带有两个或多个副本的镜像 registry,需要ReadWriteMany
访问设置。- 必须具有 100Gi 容量。
流程
为了配置 registry 使用存储,需要修改
configs.imageregistry/cluster
资源中的spec.storage.pvc
。注意使用共享存储时,请查看您的安全设置以防止被外部访问。
验证您没有 registry pod:
oc get pod -n openshift-image-registry -l docker-registry=default
$ oc get pod -n openshift-image-registry -l docker-registry=default
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
No resourses found in openshift-image-registry namespace
No resourses found in openshift-image-registry namespace
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意如果您的输出中有一个 registry pod,则不需要继续这个过程。
检查 registry 配置:
oc edit configs.imageregistry.operator.openshift.io
$ oc edit configs.imageregistry.operator.openshift.io
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
storage: pvc: claim:
storage: pvc: claim:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将
claim
字段留空以允许自动创建一个image-registry-storage
PVC。检查
clusteroperator
的状态:oc get clusteroperator image-registry
$ oc get clusteroperator image-registry
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
NAME VERSION AVAILABLE PROGRESSING DEGRADED SINCE MESSAGE image-registry 4.7 True False False 6h50m
NAME VERSION AVAILABLE PROGRESSING DEGRADED SINCE MESSAGE image-registry 4.7 True False False 6h50m
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 确保您的 registry 设置为 manage,以启用镜像的构建和推送。
运行:
oc edit configs.imageregistry/cluster
$ oc edit configs.imageregistry/cluster
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 然后将行改
managementState: Removed
managementState: Removed
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 为
managementState: Managed
managementState: Managed
Copy to Clipboard Copied! Toggle word wrap Toggle overflow