user1843591
user1843591

Reputation: 1136

Kubernetes DNS lookup very slow, ndots:5

The ndots problem

I have a Kubernetes cluster (running on openstack) and a separate cluster of VMs running on the same openstack tenancy. I needed to be able to resolve services running in the VM cluster from the kubernetes cluster.

  1. I set up ipvs "loadbalancer"
  2. On this loadbalancer I connected eth1 to vm cluster, eth0 to kubernetes cluster
  3. set up static routes (on host VMs) to supply route to this LB, masquerade rules on LB, allowed ip addresses on LB via opensatck etc
  4. I then set my DNS server in the VM cluster as a StubDomain of kube-dns as per Kubernetes docs

nslookup of a service in the VM cluster now worked from kubernetes cluster but resolution was taking on avg 8 seconds. I tried alternating and combining StubDomain with UpstreamNameserver but the results were the same.

After much googling I discovered the ndots problem. Instead of modifying it I removed ndots:5 from the pod doing the lookup configuration and nslookup is now much quicker operating at acceptable speed.

My question is what is the side-effect/trade-off to removing the ndots configuration altogether? My application seems to be working well now and no obvious side-effects yet.

Thanks

Upvotes: 3

Views: 3586

Answers (1)

Malcom
Malcom

Reputation: 34

There are no side effects. You just make one DNS query for a FQDN with is set Ndots:0. The whole ndots is like a secret agent trying to mess up your requests.

Upvotes: 1

Related Questions