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.3. 为裸机配置registry存储
3.3.1. 为裸机配置registry存储 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
作为集群管理员,在安装后需要配置 registry 来使用存储。
先决条件
- 具有 Cluster Administrator 权限
- 在裸机上有一个集群。
- 为集群置备持久性存储,如 Red Hat OpenShift Container Storage。若要部署私有镜像 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! Toggle word wrap Toggle overflow 注意如果存储类型为
emptyDIR
,则副本数不能超过1
。如果存储类型为NFS
,并且希望通过设置replica>1
来扩展 registry Pod,则必须启用no_wdelay
挂载选项。例如:cat /etc/exports /mnt/data *(rw,sync,no_wdelay,no_root_squash,insecure,fsid=0) sh-4.3# exportfs -rv exporting *:/mnt/data
# cat /etc/exports /mnt/data *(rw,sync,no_wdelay,no_root_squash,insecure,fsid=0) sh-4.3# exportfs -rv exporting *:/mnt/data
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 检查 registry 配置:
oc edit configs.imageregistry.operator.openshift.io
$ oc edit configs.imageregistry.operator.openshift.io 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
3.3.2. 其它资源 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
有关为裸机配置 registry 存储的详情,请参考推荐的可配置存储技术。