11

I've been trying to run the Hello Node tutorial for a couple of days now and I finally figured out what was preventing me from seeing the app, but I'm not sure why this is happening.

I looked at the Kubernetes events tab and kept seeing this error.

Failed to pull image "gcr.io/simpleapp-1073/hello-node": Error: image simpleapp-1073/hello-node:latest not found

simpleapp-1073 is my PROJECT_ID

When I pushed the docker image to the public docker hub and pointed my image attribute to that, everything finally started working.

Is there some trick to getting the private container registry working?

Sandro
  • 4,761
  • 1
  • 34
  • 41
  • is your Kubernetes cluster running in the project "simpleapp-1073" as well? – mattmoor Nov 18 '15 at 06:21
  • The tutorial mentions the kubernetes master is run by Google Container Engine so I'm not sure how to answer that. The instance where the worker node is running is in simpleapp-1073 – Sandro Nov 18 '15 at 13:23
  • Did you delete your cluster? – Robert Bailey Nov 18 '15 at 15:26
  • Yes, I've been deleting and recreating the cluster to avoid charges since it's just a test app. How could that affect this? I only completed the "before you begin" section once, if that helps. https://cloud.google.com/container-engine/docs/before-you-begin – Sandro Nov 18 '15 at 15:28
  • There is one step on the before you begin section that asks you to run "gcloud container clusters get-credentials CLUSTER_NAME" I'm pretty sure I re-ran this after creating a new cluster, even though it was named the same thing, "hello-world". Could this effect the kubernetes node pulling the image from gci.io? – Sandro Nov 18 '15 at 15:37
  • When you created your image did you also push a latest tag to gcr.io? – Robert Bailey Nov 18 '15 at 16:11
  • I've been trying a few things with the image, changing the bound IP address of the server and listen port. Every time I updated the image I would build and push. I can't remember if I tagged it. – Sandro Nov 18 '15 at 16:25
  • Just tried this again today. Tagged and pushed the container and still get the same error message. Really odd. – Sandro Nov 19 '15 at 13:27
  • Tried setting up a new container cluster with `--scopes storage-full` but that didn't help either. FWIW, ssh'ing into the VM and trying `docker pull gcr.io/simpleapp-1073/hello-node` gives me the same error as above. – Sandro Nov 19 '15 at 14:46
  • I'm able to confirm this issue is fixed when I make the images in the `artifacts.simpleapp-1073.xxxxx` bucket, the node is then able to pull the image. Really weird that this is happening and essentially defeats the purpose of a private registry, no? – Sandro Nov 21 '15 at 04:24

3 Answers3

8

I had similar issue. Authentication of local docker with Google registry helped:

gcloud docker -a

and then

sudo docker pull gcr.io/simpleapp-1073/hello-node
rav
  • 3,579
  • 1
  • 18
  • 18
  • Thanks for your help. Unfortunately the only thing that worked was creating an entirely new project. – Sandro Nov 27 '15 at 23:18
0

I created an entirely new project and tried the steps in the Hello Node tutorial and everything worked. The simpleapp-1073 I was trying to use before was created a long time ago, probably about a year ago. Perhaps that had some affects on this issue. I'm happy with this solution since I was just trying to get the tutorial up and running.

Sandro
  • 4,761
  • 1
  • 34
  • 41
0

I had a similar issue where I was getting an ImagePullBackOff status on my Pod.

My fix was to re-create the kubernetes cluster and try to deploy again and everything worked.

I think something got messed up as the original-service account I used when creating the cluster got deleted and a new one was created with the same name, so perhaps there was a hidden ID attached to the old cluster still that was trying to use a service account that didn't exist anymore.

Scott Jungwirth
  • 6,105
  • 3
  • 38
  • 35