« Back to projectatomic.io
Ask Your Question

Authenticating Kubernetes for private images on Docker Hub

asked 2015-01-18 02:39:27 +0000

kennu gravatar image

I can't figure out how to configure Kubernetes to pull private images from Docker Hub.

I can successfully login to Docker Hub with "docker login" which creates the file /root/.dockercfg. This lets me pull the images manually with "docker pull".

But Kubernetes requires .dockercfg to be in the working directory of the kubelet process, which is / and seems to be read-only on Atomic. So I can't copy /root/.dockercfg to /.dockercfg, and I also can't change the working directory of the kubelet service.

Any advice? Is it a bug in Atomic?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-01-25 05:08:56 +0000

The following worked for me . Setting WorkingDirectory=/var/lib/kubelet in kubelet startup script/systemd service

If it is Fedora/RHEL7, do the following

  1. cp /usr/lib/systemd/system/kubelet.service /etc/systemd/system
  2. edit /etc/systemd/system/kubelet.service

    Under [Service] section add the below line WorkingDirectory=/var/lib/kubelet

  3. systemctl daemon-reload

    Place the .dockercfg file in /var/lib/kubelet/.dockercfg

4, systemctl restart kubelet

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower


Asked: 2015-01-18 02:39:27 +0000

Seen: 3,539 times

Last updated: Jan 25 '15