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.3.4.4. 为裸机和其他手动安装配置 registry 存储
作为集群管理员,在安装后需要配置 registry 来使用存储。
先决条件
- 集群管理员权限。
- 使用手动置备的 Red Hat Enterprise Linux CoreOS(RHCOS)节点(如裸机)的集群。
为集群置备的持久性存储,如 Red Hat OpenShift Container Storage。
重要当您只有一个副本时,OpenShift Container Platform 支持对镜像 registry 存储的
ReadWriteOnce
访问。要部署支持高可用性的镜像 registry,需要两个或多个副本,ReadWriteMany
访问。- 必须具有 100Gi 容量。
流程
要将 registry 配置为使用存储,请更改
configs
。.imageregistry/cluster 资源中的 spec.
storage.pvc注意使用共享存储时,请查看您的安全设置以防止外部访问。
验证您没有 registry pod:
oc get pod -n openshift-image-registry
$ oc get pod -n openshift-image-registry
Copy to Clipboard Copied! 注意如果存储类型为
emptyDIR
,则副本数不能大于1
。检查 registry 配置:
oc edit configs.imageregistry.operator.openshift.io
$ oc edit configs.imageregistry.operator.openshift.io
Copy to Clipboard Copied! 输出示例
storage: pvc: claim:
storage: pvc: claim:
Copy to Clipboard Copied! 将
claim
字段留空以允许自动创建image-registry-storage
PVC。检查
clusteroperator
状态:oc get clusteroperator image-registry
$ oc get clusteroperator image-registry
Copy to Clipboard Copied! 确保 registry 设置为 managed,以启用镜像的构建和推送。
运行:
oc edit configs.imageregistry/cluster
$ oc edit configs.imageregistry/cluster
Copy to Clipboard Copied! 然后,更改行
managementState: Removed
managementState: Removed
Copy to Clipboard Copied! 至
managementState: Managed
managementState: Managed
Copy to Clipboard Copied!