Is there a way to pass the kube-dns server IP to the container so that services inside the container can resolve the names properly?
I am trying to run nginx and it needs a resolver
directive to be specified to resolve names against a DNS server.
I do not want to use public DNS servers; only the one provided by kube-dns.
Also, I need a dynamic way to pass the IP as the DNS server IP can change across various cloud platforms or bare-metal configurations. So, I cannot use a hardcoded 10.0.0.10
IP.
Alright, it seems quite simple. A few points I had missed.
kube-dns
runs as a Kubernetes Service in the kube-system
namespace.kube-dns.kube-system.svc.cluster.local
env
.EDIT:
It seems I was looking at the wrong place. It indeed uses the local resolver resolve. The problem is I hit a 'feature' in NGINX which caches the lookups for 300 secs and causes name resolution failure, and I was investigating k8s.