我按照docs进行了配置,它显示成功:
创建了一个新集群
minikube start -p aged --kubernetes-version=v1.18.10然后设置GCR证书
minikube addons configure registry-creds -p aged
Do you want to enable AWS Elastic Container Registry? [y/n]: n
Do you want to enable Google Container Registry? [y/n]: y
-- Enter path to credentials (e.g. /home/user/.config/gcloud/application_default_credentials.json):/Users/meeee/.config/gcloud/application_default_credentials.json
-- Do you want to change the GCR URL (Default https://gcr.io)? [y/n]: n
Do you want to enable Docker Registry? [y/n]: n
Do you want to enable Azure Container Registry? [y/n]: n
✅ registry-creds was successfully configured
# enable
minikube addons enable registry-creds -p aged
▪ Using image upmcenterprises/registry-creds:1.10但是当我部署时,我得到了这个错误:
Failed to pull image "gcr.io/myproject/myimages/myimage:test": rpc error: code = Unknown desc = Error response from daemon: unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication虽然它没有提到对GCR进行身份验证,但我也配置了minikube addons enable gcp-auth。
发布于 2021-09-04 20:54:32
ADC文件是否存在?
/home/user/.config/gcloud/application_default_credentials.json):/Users/meeee/.config/gcloud/application_default_credentials.json如果不是,则需要事先使用gcloud auth application-default login。
而且,假设该机制在您的命名空间中创建了一个Secret,您仍然需要使用imagePullSecrets。
这种方法很老套,您最好创建一个专门用于GCR访问的服务帐户。
以这种方式使用您的用户帐户作为服务帐户,共享所有您的用户帐户的权限时,所有需要的是role/storage.admin从GCR拉取。此外,用户帐户可能绑定到多个项目,而帐户只需要访问特定的项目(更好的是存储桶)。
https://stackoverflow.com/questions/69058726
复制相似问题