Ajoy Das
Ajoy Das

Reputation: 29

k8s minikube fails to pull image from dockerhub

Error : Failed to pull image "busybox": rpc error: code = Unknown desc = Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

To fix this I have added the login credentials

apiVersion: v1
  data:
    .dockerconfigjson: xxxx
   kind: Secret
   metadata:
     creationTimestamp: null
     name: pullsecretgeneric
   type: kubernetes.io/dockerconfigjson

and also added to the deployment yaml

template:
      metadata:
        labels:
          component: {{ .component }}
      spec:
        imagePullSecrets:
         - name: pullsecretgeneric
         - name: pullsecret

Then using helm install to do the installation But still I get this error Do I need to do add somewhere else

Config.json

{
    "auths": {
        "https://registry.hub.docker.com": {
            "auth": "xxxx"
        }
    }
}

Any pointers to fix this

Upvotes: 1

Views: 838

Answers (1)

Jyothi Kiranmayi
Jyothi Kiranmayi

Reputation: 2533

1 . On November 20, 2020, rate limits anonymous and free authenticated use of Docker Hub went into effect. Anonymous and Free Docker Hub users are limited to 100 and 200 container image pull requests per six hours. You can read here for more detailed information.

As stated in the documentation :

The rate limits of 100 container image requests per six hours for anonymous usage, and 200 container image requests per six hours for free Docker accounts are now in effect. Image requests exceeding these limits will be denied until the six hour window elapses.

So as a workaround you can either:

  • Reduce your pull rate.
  • Upgrade your membership.
  • Setup your own docker proxy to cache containers locally

To overcome docker hub pull rate limit refer to the documentation and also refer to the stackpost.

2 . Another workaround is to pull the image locally once, push it to your local docker repository and then update your image properties to point to your local repository.

You have to pull the images locally using your credentials and push it to your local (internally hosted) docker repository. Once pushed, update the deployment.yaml file with updated image link.

image: <LOCAL DOCKER REPO URL>/busybox.

3 . If there was no issue with Docker login and if you are able to download docker images with docker pull but getting error when creating a pod with the image then create a private docker registry.

  • Create and run a private docker registry
  • Download busybox image from public docker hub
  • Create a tag for busybox before pushing it to private registry
  • Push to registry
  • Now create a pod, it will be created successfully.

Refer to the stackpost for more information.

Upvotes: 1

Related Questions