Closed dkorittki closed 4 years ago
so to clarify, you can pull the image with docker pull but not if you apply through a yaml file? do you mind trying with create a kubernetes secret that has docker user name password?
as seen here https://gist.github.com/srounce/4a0338b26df815e966174228753ef61e
partial code:
kubectl create secret docker-registry $SECRET_NAME \
--docker-server "https://gcr.io" \
--docker-username _json_key \
--docker-email not@val.id \
--docker-password="`cat $CONFIG_PATH`" ${@:3}
Regardless if this solution helps, we need a bettter docuemnation of an example of using Private Registery in minikube on our website. I would be happy to review any pr with good examples of using different ways of minikube and private registery,
so to clarify, you can pull the image with docker pull but not if you apply through a yaml file?
Yes exactly. The idea is to authenticate the complete node (in this case the minikube vm) against the private registry, so you don't need to define imagePullSecrets
on pods. But after some more playing around and rereading this documentation I eventually got it to work.
The problem was that minikube ssh "docker login ...
places the resultingconfig.json
in /home/docker/.docker
, which is not read by kubelet when pulling images. Moving that file to one of the paths specified in mentioned documentation solved the problem.
do you mind trying with create a kubernetes secret that has docker user name password?
Tested this one too and it worked right out of the box, when referencing this secret via imagePullSecrets
on the pod.
I would be happy to review any pr with good examples of using different ways of minikube and private registery,
Would you think an article on site/content/en/docs/Tutorials
would be sufficient? If so, I would gladly help out there.
@dkorittki I'm glad this is working for you now! Since pulling from private registries is a pretty important and common use case, I think an article in Core Tasks titled "Pulling Images from Private Registries" would be great. Thank you for your help!
Hello, do you think this is enough or more details needed about how to use imagePullSecrets
? If so I would be happy to help :)
Hey @serhatcetinkaya thanks for pointing me to the docs! They actually look pretty comprehensive to me, so I'll go ahead and close this issue.
However, we're working on fixing up our documentation this week. If you'd be interested in helping out, here's a list of issues we need help with that you can take a look at:
Moving that file to one of the paths specified in mentioned documentation solved the problem.
Now this document does not contain any paths,can refer to https://stackoverflow.com/questions/60661249/kubernetes-ignores-config-json-while-doing-docker-pull
minikube can't pull image from private repository despite a working docker config containing valid auth information. Reason: access denied. A
minikube ssh 'docker pull my-registry.foo.bar/my/private/image:latest'
works as expected.The exact command to reproduce the issue:
The full output of the command that failed:
The output of the
minikube logs
command:The operating system version: MacOS 10.15.1 minikube version: v1.6.2 running with hyperkit driver