1

The standard Hello-World app as available on https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app does not work. There appears to be some pull access issue, despite the fact that things should work right off the box when working with Kubernetes on GCP in combination with the Google Cloud.

For instance reference: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod

which mentions:

"Using Google Container Registry Kubernetes has native support for the Google Container Registry (GCR), when running on Google Compute Engine (GCE). If you are running your cluster on GCE or Google Kubernetes Engine, simply use the full image name (e.g. gcr.io/my_project/image:tag). All pods in a cluster will have read access to images in this registry.

I double checked that I used the right image name (copy pasted it from container registry).

Error message:

C:\Users\rober>kubectl get pods
NAME                         READY     STATUS             RESTARTS   AGE
hello-web-694bc87958-rcdvg   0/1       ImagePullBackOff   0          7s

  Type     Reason          Age               From                                                   Message
  ----     ------          ----              ----                                                   -------
  Normal   Scheduled       7m                default-scheduler                                      Successfully assigned default/hello-web-694bc87958-rcdvg to gke-hello-cluster-default-pool-9cbfb505-588j
  Normal   SandboxChanged  7m (x3 over 7m)   kubelet, gke-hello-cluster-default-pool-9cbfb505-588j  Pod sandbox changed, it will be killed and re-created.
  Normal   BackOff         7m (x6 over 7m)   kubelet, gke-hello-cluster-default-pool-9cbfb505-588j  Back-off pulling image "gcr.io/data-platform-tst/hello-app:v1"
  Normal   Pulling         6m (x3 over 7m)   kubelet, gke-hello-cluster-default-pool-9cbfb505-588j  pulling image "gcr.io/data-platform-tst/hello-app:v1"
  Warning  Failed          6m (x3 over 7m)   kubelet, gke-hello-cluster-default-pool-9cbfb505-588j  Failed to pull image "gcr.io/data-platform-tst/hello-app:v1": rpc error: code = Unknown desc = Error response from daemon: repository gcr.io/data-platform-tst/hello-app not found: does not exist or no pull access
  Warning  Failed          6m (x3 over 7m)   kubelet, gke-hello-cluster-default-pool-9cbfb505-588j  Error: ErrImagePull
  Warning  Failed          2m (x24 over 7m)  kubelet, gke-hello-cluster-default-pool-9cbfb505-588j  Error: ImagePullBackOff
Crou
  • 714
  • 3
  • 9
  • 1
    Can you provide an output of `docker images`? – Crou Apr 18 '19 at 11:33
  • Did you ever get this to work? I'm facing the same problem. I can't pull private images, even when I manually upload a dockerconfigjson secret. – Caleb1994 Aug 10 '20 at 23:26

1 Answers1

1

Please make sure that you have the proper scopes set up within your cluster for the service account to pull the image. Please follow the Official Documentation that provides step-by-step instructions on how to grant users permission to pull an image from a Container Registry.

I understand that you are using Google Container Registry so in this case, GKE nodes already have access to the Google Container Registry images in the same Google Cloud Platform project as the cluster.

So please check the scope you have given to your cluster.

Follow the next steps or the Official Documentation:

  • Create a cluster
  • Build an image from the source code
  • Push it to Google Container Registry
  • Deploy to GKE.
Nibrass H
  • 146
  • 5