I have a Google Kubernetes Engine cluster which until recently was happily pulling private container images from a Google Container Registry bucket. I haven't changed anything, but now when I update my Kubernetes Deployments, it's unable to launch new pods, and I get the following events:
Normal Pulling 14s kubelet, <node-id> pulling image "gcr.io/cloudsql-docker/gce-proxy:latest"
Normal Pulling 14s kubelet, <node-id> pulling image "gcr.io/<project-id>/backend:62d634e"
Warning Failed 14s kubelet, <node-id> Failed to pull image "gcr.io/<project-id>/backend:62d634e": rpc error: code = Unknown desc = unauthorized: authentication required
Warning Failed 14s kubelet, <node-id> Error: ErrImagePull
Normal Pulled 13s kubelet, <node-id> Successfully pulled image "gcr.io/cloudsql-docker/gce-proxy:latest"
Normal Created 13s kubelet, <node-id> Created container
Normal Started 13s kubelet, <node-id> Started container
Normal BackOff 11s (x2 over 12s) kubelet, <node-id> Back-off pulling image "gcr.io/<project-id>/backend:62d634e"
Warning Failed 11s (x2 over 12s) kubelet, <node-id> Error: ImagePullBackOff
I've checked the following things, which all seem to be as they should:
- The containers and their tags actually exist, and are correct.
- The node pool / VM Instances for the GKE cluster have the
storage-ro
permission - The Google Container Registry bucket and GKE cluster are in the same project
I've also tried disabling and re-enabling the container.googleapis.com and containerregistry.googleapis.com services, but that doesn't help.
The Google documentation for the Container Registry states:
Kubernetes Engine clusters are automatically configured with access to pull private images from the Container Registry in the same project. You do not need to follow additional steps to configure authentication if the registry and the cluster are in the same Cloud project.
But this doesn't seem to be the case.
Can anyone shed additional light on what might be going on? Or additional steps to try?