Kubernetes cluster nodes do not use kube-dns
by default, and so won't resolve in-cluster service DNS names at the host-level. This repo provides a DaemonSet
that updates /etc/resolv.conf
on all of the hosts to use kube-dns
.
kubectl apply -f https://raw.githubusercontent.com/snormore/kube-node-dns/master/daemonset.yaml
This issue is often encountered when trying to set up the NFS example from https://github.com/kubernetes/examples/tree/master/staging/volumes/nfs, where the service name resolution fails because the cluster host does not use kube-dns
: kubernetes/kubernetes#44528