Kubernetes on Digitalocean not able to pull from docker hub private repo

Posted July 4, 2020 4.8k views
DockerKubernetesDigitalOcean Managed Kubernetes

I have created ‘regcred’ secret with

kubectl create secret generic regcred --from-file=.dockerconfigjson=~/.docker/config.json

and patched serviceaccount

kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "regcred"}]}'

Also added imagePullSecrets with regcred in helm chart using the private repo

but it wont pull from the private repos

Failed to pull image "myuser/myrepo:latest": rpc error: code = Unknown desc = Error response from daemon: pull access denied for myuser/myrepo, repository does not exist or may require 'docker login'

I have tried recycle of the nodes
I have also tried switched between registry urls without success:

Is there something im missing or doing wrong?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there!

Have you checked the steps listed here:

Those are for DOCR but should apply to all private repos.

Are you sure you are patching the “default” serviceaccount in the same namespace your deployment is in?

Are you sure that your deploymnet is being run by the default serviceaccount?

Perhaps you could try setting it directly in the deployment using the instructions linked above?

Hope this helps!


John Kwiatkoski
Senior Developer Support Engineer - Kubernetes