Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

middleware/kubernetes: Preemptive search path lookups #747

Closed
chrisohaver opened this issue Jun 21, 2017 · 5 comments
Closed

middleware/kubernetes: Preemptive search path lookups #747

chrisohaver opened this issue Jun 21, 2017 · 5 comments
Assignees
Milestone

Comments

@chrisohaver
Copy link
Member

Problem:

A known issue with kube-dns and how K8s works is the long DNS search path and high ”ndots” in /etc/resolv.conf. kubernetes/kubernetes#33554

For example, search path in a pod as dictated by the pod's dns policy is:

namespace.svc.cluster.local
svc.cluster.local
cluster.local
mydomain.com

If you try to lookup ”google.com” you will end up with queries:

google.com.namespace.svc.cluster.local.
google.com.svc.cluster.local.
google.com.cluster.local.
google.com.mydomain.com.
google.com.

This means that for every query of a host outside the cluster, the client has to make 5 queries.

Proposed Solution:

For queries from pods in the cluster, iterate on the search path in coredns, returning the first successful lookup back to the client. This allows the client to get the answer in one query, instead of five.

The condition for doing the preemptive lookups on an incoming question would have to meet all of the following...

  • the incoming question would otherwise result in an NXDOMAIN (e.g. it doesn't match a service)
  • the source is a pod in the kubernetes cluster
  • the question ends with namespace.svc.cluster.local. where namespace is the namespace of the pod, and cluster.local is the zone

If these conditions are met, then the kubernetes middleware would strip the search path from the question, and try the remaining search paths until an answer is found.

@miekg
Copy link
Member

miekg commented Jun 21, 2017 via email

@johnbelamaric
Copy link
Member

It needs the pod watch that we put in for pods verified so it's probably not ideal to do that. It definitely though can be optionally enabled.

@johnbelamaric
Copy link
Member

Or are you saying so that it can be used in non-k8s cases?

@miekg
Copy link
Member

miekg commented Jun 21, 2017 via email

@miekg
Copy link
Member

miekg commented Jun 27, 2017

Should we call it autopath (like the name, but it is a bit non descriptive) or maybe serverpath? serversearch, autosearch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants