拉取镜像失败,未授权:需要认证

Failed to pull image, unauthorized: authentication required

尝试从 ICP 2101 部署 CAM 图表版本 2101。部署失败并出现错误:

Failed to pull image “mycluster.icp:8500/default/orpheus-iaas:2.1.0.1_121317”: rpc error: code = Unknown desc = Error response from daemon: Get https://mycluster.icp:8500/v2/default/orpheus-iaas/manifests/2.1.0.1_121317: unauthorized: authentication required

在将 CAM PPA 包加载到 ICP 时,我没有包含 --namespace services,如 CAM 安装主题中所示:https://www.ibm.com/support/knowledgecenter/SS2L37/cam_installing_cam.html

我能够使用将所有 CAM 图像范围更改为 global 的解决方法: https://www.ibm.com/support/knowledgecenter/en/SSBS6K_2.1.0/manage_images/change_scope.html

我删除了现有的 CAM 部署,然后再次尝试成功部署。

如 Scott 所述,将图像范围更新为全局是正确答案。这可以通过一个命令完成:

root@icp-master-1:~# kubectl get image -n=<namespace> -o yaml | sed 's/scope: namespace/scope: global/g' | kubectl replace -f -
image "cam-broker" replaced
image "cam-busybox" replaced
image "cam-mongo" replaced
image "cam-orchestration" replaced
image "cam-portal-api" replaced
image "cam-portal-ui" replaced
image "cam-redis" replaced
image "cam-service-composer-api" replaced
image "cam-service-composer-ui" replaced
image "orpheus-iaas" replaced
image "orpheus-proxy" replaced
image "orpheus-tenant-mgmt" replaced
image "orpheus-ui-basic" replaced
image "orpheus-ui-connections" replaced
image "orpheus-ui-instances" replaced
image "orpheus-ui-templates" replaced
image "provider-terraform-local" replaced