Home > OS >  Why is my GCP image failing to deploy to local kubernetes?
Why is my GCP image failing to deploy to local kubernetes?

Time:09-10

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. There are no errors being logged on GCP, but locally I'm getting the following:

 - deployment/<redacted> failed. Error: container <redacted> is waiting to start: gcr.io/<redacted>/<redacted>:latest@sha256:<redacted> can't be pulled.

CodePudding user response:

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. 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.

There are a variety of tutorials, and this one looks pretty good.

CodePudding user response:

Can you try gcloud auth list and check if you are using the right account? To switch account use gcloud auth login <account>

Also make sure you have the right permission : gcloud permission to pull GCP image

Once these two things are in place then you should be able to pull the image for GCR.

  • Related