Errors when using Google Container Engine (GKE) with Google Container Registry (GCR)

google-cloud-platformgoogle-kubernetes-enginekubernetes

In setting up our company infrastructure on Google Container Engine, I'm attempting to place our Docker images in Google Container Registry. When I attempt to start a Deployment using the images hosted on GCR, I'm getting the following errors on the pod in kubernetes.

Failed to pull image "gcr.io//portal:latest": rpc error:
code = 2 desc = Error: Status 405 trying to pull repository
/portal: "v1 Registry API is disabled. If you are not
explicitly using the v1 Registry API, it is possible your v2 image
could not be found. Verify that your image is available, or retry with
dockerd --disable-legacy-registry. See
https://cloud.google.com/container-registry/docs/support/deprecation-notices"

Error syncing pod, skipping: failed to "StartContainer" for "portal"
with ErrImagePull: "rpc error: code = 2 desc = Error: Status 405
trying to pull repository /portal: \"v1 Registry API is
disabled. If you are not explicitly using the v1 Registry API, it is
possible your v2 image could not be found. Verify that your image is
available, or retry with dockerd --disable-legacy-registry. See
https://cloud.google.com/container-registry/docs/support/deprecation-notices\""

I've found some references to needing to add permissions to service accounts, and I've tried this, but nothing seems to be working even though the environment was working before I deleted it and recreated it.

I've also found some references to making sure you push the containers with the latest docker version. I've done all my image pushes using the latest download of Docker CE.

Would appreciate any suggestions on what can cause this error. Thanks!

Best Answer

So, I found the problem. In moving the project from my "experimental" environment to production, I changed the name of the app from <productName> to <productName>app. I had this buried in my container definitions so I was using the wrong URL for my images.

I put in a request with Google for a better error message.