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.12.3.17.2.2. 为 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。