為何叢集無法在建立期間從 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'.

在叢集建立期間,會為叢集建立服務 ID,並為該 ID 指派對 IBM Cloud Container Registry 的讀者服務存取原則。

然後,會產生此服務 ID 的 API 金鑰,並將其儲存在映像檔取回密碼中,以授權叢集從 IBM Cloud Container Registry 取回映像檔。

若要在叢集建立期間為服務 ID 順利指派讀者服務存取原則,您必須具有對 IBM Cloud Container Registry 的管理者平台存取原則。

步驟:

  1. 確保帳戶擁有者授予您 IBM Cloud Container Registry 的管理者角色。
    ibmcloud iam user-policy-create <your_user_email> --service-name container-registry --roles Administrator
    
  2. 請使用 ibmcloud oc cluster pull-secret apply 指令, 以適當的註冊表憑證重新建立映像拉取密鑰。