为什么在创建期间集群无法从 IBM Cloud Container Registry 中拉取映像?
在集群中从 IBM Cloud Container Registry 拉取镜像时,排查镜像拉取错误。
虚拟私有云 传统基础设施
在创建集群时,您收到了类似以下示例的错误消息。
Your cluster can't pull images from the 'icr.io' domains because an IAM access policy could not be created. Make sure that you have the IAM Administrator platform access role to. Then, create an image pull secret with IAM credentials to the registry by running 'ibmcloud ks cluster pull-secret apply'.
在集群创建期间,会为集群创建服务标识,并为该标识分配对 IBM Cloud Container Registry 的读取者服务访问策略。
然后,会生成此服务标识的 API 密钥,并将其存储在映像拉取私钥中,以授权集群从 IBM Cloud Container Registry 拉取映像。
要在集群创建期间为服务标识成功分配读取者服务访问策略,您必须具有对 IBM Cloud Container Registry 的管理员平台访问策略。
步骤:
- 确保帐户所有者为您授予对 IBM Cloud Container Registry 的管理员角色。
ibmcloud iam user-policy-create <your_user_email> --service-name container-registry --roles Administrator - 使用
ibmcloud oc cluster pull-secret apply命令,使用 相应的注册表凭据重新创建镜像拉取密钥。