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.14.5.20.3. 镜像 registry 存储配置
对于不提供默认存储的平台,Image Registry Operator 最初将不可用。安装后,您必须配置 registry 使用的存储,这样 Registry Operator 才可用。
示配置生产集群所需的持久性卷的说明。如果适用,显示有关将空目录配置为存储位置的说明,该位置只可用于非生产集群。
另外还提供了在升级过程中使用 Recreate rollout 策略来允许镜像 registry 使用块存储类型的说明。
14.5.20.3.1. 为 VMware vSphere 配置块 registry 存储 复制链接链接已复制到粘贴板!
在作为集群管理员升级时,要允许镜像 registry 使用块存储类型,如 vSphere Virtual Machine Disk(VMDK),您可以使用 Recreate rollout 策略。
支持块存储卷,但不建议将其用于生产环境中的镜像 registry。在块存储上配置 registry 的安装不具有高可用性,因为 registry 无法拥有多个副本。
流程
要将镜像 registry 存储设置为块存储类型,对 registry 进行补丁,使其使用
Recreaterollout 策略,且仅使用1个副本运行:oc patch config.imageregistry.operator.openshift.io/cluster --type=merge -p '{"spec":{"rolloutStrategy":"Recreate","replicas":1}}'$ oc patch config.imageregistry.operator.openshift.io/cluster --type=merge -p '{"spec":{"rolloutStrategy":"Recreate","replicas":1}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow 为块存储设备置备 PV,并为该卷创建 PVC。请求的块卷使用 ReadWriteOnce(RWO)访问模式。
创建包含以下内容的
pvc.yaml文件以定义 VMware vSpherePersistentVolumeClaim:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 从文件创建
PersistentVolumeClaim对象:oc create -f pvc.yaml -n openshift-image-registry
$ oc create -f pvc.yaml -n openshift-image-registryCopy to Clipboard Copied! Toggle word wrap Toggle overflow
编辑 registry 配置,使其可以正确引用 PVC:
oc edit config.imageregistry.operator.openshift.io -o yaml
$ oc edit config.imageregistry.operator.openshift.io -o yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
storage: pvc: claim:storage: pvc: claim:1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 通过创建自定义 PVC,您可以将
claim字段留空以用于默认自动创建image-registry-storagePVC。
有关配置 registry 存储以便引用正确的 PVC 的说明,请参阅为 vSphere 配置 registry。