Search code examples
kubernetesibm-cloudcontainer-registry

kubernetes can't pull certain images from ibm cloud registry


My pod does the following:

Warning Failed 21m (x4 over 23m) kubelet, 10.76.199.35 Failed to pull image "registryname/image:version1.2": rpc error: code = Unknown desc = Error response from daemon: unauthorized: authentication required

but other images will work. The output of

ibmcloud cr images

doesn't show anything different about the images that don't work. What could be going wrong here?


Solution

  • Given this is in kubenetes and you can see the image in ibmcloud cr images it most likely going to be a misconfiguration of your imagePullSecrets.

    If you do kubectl get pod <pod-name> -o yaml you will be able to see the what imagePullSecrets are in scope for the pod and check if it looks correct (could be worth comparing it to a pod that is working).

    It's worth noting that if your cluster is an instance in the IBM Cloud Kubernetes Service a default imagePullSecret for your account is added to the default namespace and therefore if you are running the pod in a different Kubenetes namespace you will need to do additional steps to make that work. This is a good place to start for information on this topic.

    https://console.bluemix.net/docs/containers/cs_images.html#other