[英]Why is my GCP image failing to deploy to local kubernetes?
I am getting "can't be pulled" when I use Cloud Code plugin in VS code to build and deploy an image to a local Kubernetes cluster.当我在 VS 代码中使用 Cloud Code 插件构建映像并将其部署到本地 Kubernetes 集群时,我得到“无法拉取”。 There are no errors being logged on GCP, but locally I'm getting the following:
GCP 上没有记录错误,但在本地我得到以下信息:
- deployment/<redacted> failed. Error: container <redacted> is waiting to start: gcr.io/<redacted>/<redacted>:latest@sha256:<redacted> can't be pulled.
If your GCR registry is a private registry then you need to configure your local Kubernetes cluster with an imagePullSecret
to use to authenticate to GCR.如果您的 GCR 注册表是私有注册表,那么您需要使用 imagePullSecret 配置本地
imagePullSecret
集群以用于对 GCR 进行身份验证。 The general process is to create a service account in your GCP project, and then configure the corresponding service account key file as the pull secret.一般的流程是在你的GCP项目中创建一个service account ,然后配置对应的service account key文件作为pull secret。
There are a variety of tutorials, and this one looks pretty good.教程有很多种, 这个看起来还不错。
Can you try gcloud auth list
and check if you are using the right account?您可以尝试
gcloud auth list
并检查您是否使用了正确的帐户? To switch account use gcloud auth login <account>
要切换帐户,请使用
gcloud auth login <account>
Also make sure you have the right permission:gcloud permission to pull GCP image还要确保您拥有正确的权限:gcloud permission to pull GCP image
Once these two things are in place then you should be able to pull the image for GCR.一旦这两件事都到位,那么您应该能够为 GCR 拉取图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.