近5年来,我在客户那部署OpenShift一直都使用了2个镜像仓库,一个Docker distribution Registry,一个harbor.
最近突然想在最新的OpenShift 4.19环境中实施采用单个harbor部署。其实2020年10月在某客户那也试过一次,openshift 4.5.x安装完成之后,再部署其他的operator时,那些operator需要手工创建harbor的项目,但是我也不清楚这些operator究竟要创建那些项目。最后放弃harbor重新安装了。
这次安装OpenShift 4.19也遇到了同样的问题,在采用oc mirror v2 将镜像mirror到harbor时遇到了同样的问题,需要手工创建很多harbor项目。
[root@bastion download]# oc mirror -c /work/olm/imageset-config-nfd.yaml --from file:///mirror2 docker://bastion.cpd.com:9443 --v2
2025/08/19 16:12:22 [INFO] : 👋 Hello, welcome to oc-mirror
2025/08/19 16:12:22 [INFO] : ⚙️ setting up the environment for you...
2025/08/19 16:12:22 [INFO] : 🔀 workflow mode: diskToMirror
2025/08/19 16:12:22 [INFO] : 📦 Extracting mirror archive(s)...
/mirror2/mirror_000001.tar (6.3 GiB / 6.3 GiB) [====================================================================================================================] 13s2025/08/19 16:12:36 [INFO] : 🕵 going to discover the necessary images...
2025/08/19 16:12:36 [INFO] : 🔍 collecting release images...
2025/08/19 16:12:36 [INFO] : 🔍 collecting operator images...
✓ () Collecting catalog registry.redhat.io/redhat/redhat-operator-index:v4.19
2025/08/19 16:12:36 [INFO] : 🔍 collecting additional images...
2025/08/19 16:12:36 [INFO] : 🔍 collecting helm images...
2025/08/19 16:12:36 [INFO] : 🚀 Start copying the images...
2025/08/19 16:12:36 [INFO] : 📌 images to copy 7
✗ (0s) ubi:latest ➡️ bastion.cpd.com:9443/ubi8/
2 / 7 (0s) [==========================================>------------------------------------------------------------------------------------------------------------] 29 % ✗ (0s) ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0 ➡️ bastion.cpd.com:9443/ubi9/
✗ (0s) graph-image:latest ➡️ bastion.cpd.com:9443/openshift/
✗ (0s) redhat-operator-index:v4.19 ➡️ bastion.cpd.com:9443/redhat/
✓ (2s) ose-cluster-nfd-operator-bundle@sha256:efd4e48ff3ebfaa448cafdd1a67930280f39244492dab3fafc147bbdcce38552 ➡️ bastion.cpd.com:9443/openshift4/
✓ (12s) ose-node-feature-discovery-rhel9@sha256:4b9e5efba5db3b95d8543eecd49018717ff10fa49ad7853d06a624e6f485b34d ➡️ bastion.cpd.com:9443/openshift4/
✓ (12s) ose-cluster-nfd-rhel9-operator@sha256:65ebdc54f5aa49d9e779e56d975b631a47a3e86211f2a6e7125c98316ce0b018 ➡️ bastion.cpd.com:9443/openshift4/
2025/08/19 16:12:49 [INFO] : === Results ===
2025/08/19 16:12:49 [INFO] : ✗ 0 / 1 release images mirrored: Some release images failed to be mirrored - please check the logs
2025/08/19 16:12:49 [INFO] : ✗ 0 / 4 operator images mirrored: Some operator images failed to be mirrored - please check the logs
2025/08/19 16:12:49 [INFO] : ✗ 0 / 2 additional images mirrored: Some additional images failed to be mirrored - please check the logs
2025/08/19 16:12:49 [ERROR] : [Worker] error mirroring image registry.redhat.io/ubi8/ubi:latest error: copying image 1/4 from manifest list: trying to reuse blob sha256:cb9b225cc1ceea3709d2d8caa017f3bedf7327fee8a8a377bed0208cbeca6c45 at destination: checking whether a blob sha256:cb9b225cc1ceea3709d2d8caa017f3bedf7327fee8a8a377bed0208cbeca6c45 exists in bastion.cpd.com:9443/ubi8/ubi: authentication required
2025/08/19 16:12:49 [ERROR] : [Worker] error mirroring image registry.redhat.io/ubi9/ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0 error: copying image 1/4 from manifest list: trying to reuse blob sha256:31aa511859523410c08f48a15c0c0d84b738c8c9e46d980549917b822e7449fa at destination: checking whether a blob sha256:31aa511859523410c08f48a15c0c0d84b738c8c9e46d980549917b822e7449fa exists in bastion.cpd.com:9443/ubi9/ubi: authentication required
2025/08/19 16:12:49 [ERROR] : [Worker] error mirroring image docker://localhost:55000/openshift/graph-image:latest error: copying image 1/4 from manifest list: trying to reuse blob sha256:56dd0a75a416c35f133fffa426764f20298a1b7020dd80fd4636fd9ebd4ee4a2 at destination: checking whether a blob sha256:56dd0a75a416c35f133fffa426764f20298a1b7020dd80fd4636fd9ebd4ee4a2 exists in bastion.cpd.com:9443/openshift/graph-image: authentication required
2025/08/19 16:12:49 [INFO] : 📄 Nothing mirrored. Skipping IDMS and ITMS files generation.
2025/08/19 16:12:49 [INFO] : mirror time : 26.7093821s
2025/08/19 16:12:49 [INFO] : 👋 Goodbye, thank you for using oc-mirror
2025/08/19 16:12:49 [ERROR] : [Executor] [release collector] could not establish the destination for the release image
[root@bastion download]#
在手工创建harbor项目后,将镜像mirror到harbor时还遇到了另一个新的问题:
oc-mirror plugin v2 throws [release collector] could not establish the destination for the release image error
https://access.redhat.com/solutions/7077886
While building the image set configuration [isc] using the oc-mirror v2, could not establish the destination for the release image error is displayed.
2024/07/05 08:25:33 [INFO] : === Results ===
2024/07/05 08:25:33 [INFO] : All release images mirrored successfully 1 / 1
2024/07/05 08:25:33 [INFO] : All operator images mirrored successfully 6 / 6
2024/07/05 08:25:33 [INFO] : All additional images mirrored successfully 1 / 1
2024/07/05 08:25:33 [INFO] : Generating IDMS file...
2024/07/05 08:25:33 [INFO] : mirror-v2-data/working-dir/cluster-resources/idms-oc-mirror.yaml file created
2024/07/05 08:25:33 [INFO] : Generating ITMS file...
2024/07/05 08:25:33 [INFO] : mirror-v2-data/working-dir/cluster-resources/itms-oc-mirror.yaml file created
2024/07/05 08:25:33 [INFO] : Generating CatalogSource file...
2024/07/05 08:25:33 [INFO] : mirror-v2-data/working-dir/cluster-resources/cs-redhat-operator-index-v4-16.yaml file created
2024/07/05 08:25:33 [INFO] : Goodbye, thank you for using oc-mirror
2024/07/05 08:25:33 [ERROR] : [release collector] could not establish the destination for the release image
因为没有客户账户,这个新问题还没有解决。也不清楚我遇到的这个问题和红帽官方出的这个知识库是否完全一样。
如果要部署Openshift AI和IBM Cloud Pak for Data/Watsonx这样的重型软件,处理镜像是一个非常重要的工作。如果采用OpenShift 4.19和Harbor估计会遇到很多问题。OpenShift 4.18 的oc mirror 就必须采用V2,不能采用老的命令及image set configuration了。oc mirror V2的image set configuration和之前的差别比较大。配置起来有点困难,文件中的参数不清楚如何获取。下面是官方文档中的案例配置文件。
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v2alpha1
mirror:
platform:
channels:
- name: stable-4.19
minVersion: 4.19.2
maxVersion: 4.19.2
graph: true
operators:
- catalog: registry.redhat.io/redhat/redhat-operator-index:v4.19
packages:
- name: aws-load-balancer-operator
- name: 3scale-operator
- name: node-observability-operator
additionalImages:
- name: registry.redhat.io/ubi8/ubi:latest
- name: registry.redhat.io/ubi9/ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0
上面的案例文件有几个关键问题,我还没有弄清楚:
_1、additionalImages下的2行是从哪儿获取的。
_2、如何保持多个package 使用相同的name(channels下的)
_3、如何配置minVersion和maxVersion
_4、如何保持多个package 使用相同的minVersion和maxVersion(channels下的)
所以对于我这个没有客户账户的人来说,现在部署Openshift AI和IBM Cloud Pak for Data/Watsonx这样的重型软件只能采用OpenShift 4.17了。