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.15.2.2. 为裸机和其他手动安装配置 registry 存储
作为集群管理员,在安装后需要配置 registry 来使用存储。
先决条件
- 具有 Cluster Administrator 权限
- 使用手动置备的 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 设置为 manage,以启用镜像的构建和推送。
运行:
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!