简体   繁体   English

为什么我的 GCP 映像无法部署到本地 kubernetes?

[英]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.

相关问题 如何在 gcp vm 中部署 docker 镜像 - how to deploy docker image in gcp vm GCP 将文件从我的本地机器复制到 GCP Vm - GCP Copying File from my local Machine to GCP Vm 无法在 App Engine 标准环境 (GCP) 中部署预构建映像 - Unable to deploy pre built image in app engine standard environment (GCP) 我怎样才能 SSH 到我的 GCP Kube.netes 集群? - How can I SSH to my GCP Kubernetes cluster? GCP 上部署的水平扩展 Kubernetes - Horizontal scaling of a deployment on GCP Kubernetes Jetbrain Space Automation 如何将图像部署到 AWS EKS (Kube.netes)? - Jetbrain Space Automation how to deploy an image to AWS EKS (Kubernetes)? GCP 部署云 function 失败 - GCP deploy cloud function failed GCP Cloud Run 部署 Docker 容器未启动,因为 nginx 图像无法找到 error.log - GCP Cloud Run deployed Docker container does not start because of nginx image is failing to find error.log GCP Kubernetes 所有日志都显示为错误日志 - GCP Kubernetes all logs apears as error logs 使用 python api 从 GCP 管理 Kubernetes 集群 - Managing Kubernetes cluster from GCP with python api
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM