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

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?


I’m having this issue as well. Unable to find a solution or documentation.

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hello, I would like to request an update of the documentation, and if it is possible to use a 3rd-party container registry.

The link in the answer is 404, the closest match I could find seemed to only offer the the DigitalOcean Container Registry, which I am not ready for.

Thank You, Scott Grodberg

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