Resolving through kube-dns on managed Kubernetes nodes

Hi Digital Ocean,

I am trying to set up an internal Docker registry within a DO managed Kubernetes cluster. I have the registry up and running and can access the registry from the worker nodes by using the service cluster ip, but I can not pull images in deployments through the url provided for the internal Docker registry with kube-dns. I believe the problem is that the worker nodes themselves are not set up to use the kube-dns name server.

As the worker nodes are to be treated as ephemeral, I do not wish to manually set up resolv.conf, as it would probably be overwritten at cluster upgrades, recycles etc.

What can be done? Would it be possible to upgrade the default managed Kubernetes nodes to resolve through kube-dns first?

Thanks for your time and kind regards.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

I figured out that it was possible to create a privileged DaemonSet putting self-signed certificates into the host nodes’ Docker certificate stores and editing resolv.conf to include the kube-dns nameserver.

However, I ended up exposing the Docker registry on the internet through an HAProxy Ingress, secured with HTTPS and using Basic Auth credentials, as I deemed the registry as being secure enough to be exposed for now (It will be easier to maintain and more easily accessible for other developers/machines/clusters).

You could potentially set up ExternalDNS for your docker registry as discussed in I believe it would mean exposing your registry to the internet, so you’d need to secure it.

John Kwiatkoski
DigitalOcean Employee
DigitalOcean Employee badge
June 11, 2019

You’re correct. The nodes are not setup to use the clusters DNS to hit services. However, what your can do is use the registry services’ clusterIP to specify the internal registry.That IP will not change unless you recreate the service. This way you can use the IP in your deployments to reference the registry and the provide the repo and tag for your image.


John Kwiatkoski Senior Developer Support Engineer

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel