2

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!

  • Do you have container registry API enabled in your project ? – Faizan Aug 10 '17 at 18:51
  • @Faizan thanks for the response. I posted the solution below. – Patrick Narkinsky Aug 12 '17 at 17:16
3

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.

| improve this answer | |
  • Yeah, the main message "image could not be found" is kind of hidden between all those deprecation notices, which didn't apply in your case ..and mine. – Greg Dubicki Nov 20 '17 at 17:44
2

I had this problem, but it seems that the Kubernetes don't access to the registry. I needed to create a new service account and create a new secret registry.

https://container-solutions.com/using-google-container-registry-with-kubernetes/

| improve this answer | |
1

This Command worked for me for the Status 405 trying to pull repository /portal: "v1 Registry API is a disabled error.

gcloud docker -- pull gcr.io//portal:latest
| improve this answer | |
0

I've downloaded the image again with gcloud docker -- push gcr.io/example-org/example-image:latestand then tried again to use or build!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.