不允許集群從容器注冊表中拉取鏡像,收到 401 并且 pod 無法使用ImagePullBackOff. 集群和注冊中心都屬于同一個專案。
從檔案中:
默認情況下,當注冊表與您的節點位于同一 Google Cloud 專案中時,GKE 節點有權從 Container Registry 中提取映像。
所以我真的迷路了。看來我搞砸了一些權限。我怎樣才能解決這個問題?
$ kubectl describe pod <application>
[...]
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Pulling 17m (x43 over 3h33m) kubelet Pulling image "eu.gcr.io/<project>/<application>:d3...bc"
Normal BackOff 7m56s (x906 over 3h32m) kubelet Back-off pulling image "eu.gcr.io/<project>/<application>:d3...bc"
Warning Failed 2m57s (x928 over 3h32m) kubelet Error: ImagePullBackOff
Warning Failed 4m23s (x210 over 17h) kubelet Failed to pull image "eu.gcr.io/<project>/<application>:d3...bc": rpc error: code = Unknown desc = failed to pull and unpack image "eu.gcr.io/<project>/<application>:d3...bc": failed to resolve reference "eu.gcr.io/<project>/<application>:d3...bc": unexpected status code [manifests d3...bc]: 401 Unauthorized
uj5u.com熱心網友回復:
您的 SA 很可能已被洗掉。
以下鏈接將幫助您恢復
https://cloud.google.com/iam/docs/creating-managing-service-accounts#undeleting https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts/undelete
但是請記住,您無法恢復已洗掉超過 30 天的 SA。
uj5u.com熱心網友回復:
缺少訪問屬性,但可以手動添加所需的訪問權限,如使用 IAM 的訪問控制檔案所示。
這樣,它允許部署示例代碼。從 GKE 到 GCR 的自動訪問似乎不起作用。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/407247.html
標籤:
