I have created ‘regcred’ secret with

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

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.

×
1 answer

Hi there!

Have you checked the steps listed here: https://www.digitalocean.com/docs/images/container-registry/how-to/use-registry-docker-kubernetes/#use-images-from-your-registry-in-your-cluster

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!

Regards,

John Kwiatkoski
Senior Developer Support Engineer - Kubernetes

Submit an Answer