-
Notifications
You must be signed in to change notification settings - Fork 40k
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
kube-dns should be the only Nameserver for Pod with DnsPolicy=ClusterFirst #15592
Comments
@smarterclayton @sosiouxme Would this impact RH install since RH uses skydns in no-rec mode ? |
I think using SkyDNS in recursive mode is the better answer. I think it has the best overall behavior. If the cluster DNS is down, the cluster is in trouble, falling back to a DNS server that only has partial answers (no in-cluster names) is wrong. Additionally, asking for a name like
I proved it with tcpdump
|
The behavior you saw tried FQDN first, followed by relative path-suffixed tries |
If SkyDNS is the only nameserver in /etc/resolv.conf for ClusterFirst pods, and I want SkyDNS to recurse, where will the reference to the other nameserver come from? Sorry if I missed this somewhere. |
skydns gets the reference for other nameservers from the host's /etc/resolv.conf |
I agree recursion is the best option, but falling back is not "wrong". Ideally, for the Mesos cases, kube-DNS is always available and handles recursion to Mesos-DNS and host cluster DNS, but don't forget the bootstrapping and failure conditions. You want to be able to deploy all addons simultaneously, not wait for kube-DNS to be ready before deploying the rest. Other pods also still need to be able to failover to access the rest of the Internet when kube-DNS is either down or not up yet. So the other DNS have to be in /etc/resolv.conf anyway. |
If this is for 1.1, it needs to be P0 at this point. Should it be? |
I am still trying to convince myself that this is a safe change... |
We are going to punt this to v1.2 |
Some of these changes are also moot if we serve DNS from the node-proxy as On Oct 15, 2015, at 7:35 PM, Abhi Shah notifications@github.com wrote: We are going to punt this to v1.2 — |
closed via #18089 |
@smarterclayton we're picking this up in a rebase now... I'm not super-happy about letting skydns be an open resolver... were you ok with this change? |
I've lost track of what the conclusion has been here, but I rely on skydns calling on other nameservers in resolv.conf to resolve a name skydns cannot natively resolve. iow, skydns acts like a recursive nameserver, providing answers for which it is authoritative when it can, and otherwise querying the other nameservers in resolv.conf when it cannot. Is that changing? |
Which resolv.conf? If I understand #18089 correctly, the resolv.conf on the nodes is now ignored, and it assumes skydns is running in open resolver mode. |
The "which resolv.conf" is the resolv.conf in the container, which up to now-ish been including not only the skydns IP but also nameservers in resolv.conf from the node. I have apps I'm deploying into Kubernetes that conventionally do lookups on dependencies with names like a.b.example.com. skydns does not know how to solve those names, but the node nameservers do. My experience is that I cannot create a Kubernetes Service to intercept these with names that contain dots. Also, by "open resolver" you mean if skydns fails to resolve a name internally, it will start traversing the root nameservers for an answer? |
Right, I think #18089 removed the node's nameservers from the container's resolv.conf. Opened #20090 to fix the issue.
Yes, it attempts to answer for all domains by contacting other nameservers for domains it doesn't know about. |
An open resolver is any DNS server on the internet that returns answers for On Mon, Jan 25, 2016 at 10:10 AM, Mark Petrovic notifications@github.com
|
#15303 (comment)
With more than one NS on cluster-first pods, the problems are:
If skydns were to fail, clients on a pod (with clusterDnsPolicy) will start getting NXDOMAIN for *cluster.local lookups instead of SERVFAIL(which could have signaled clients to retry), from the second NS
If skydns were to fail, clients on a pod (with clusterFirst DnsPolicy) might accidentally get the wrong IP.
Consider that a k8s user has created a service called "mail".
Assume that the search paths are "default.svc.cluster.local google.com"
Ideally, the Query should be resolved by skydns for mail.default.svc.cluster.local.
But since Skydns is down, the Query gets resolved by the fallback nameserver for mail.google.com
The Faulty Resolution Problem exists even if skydns is used in no-rec mode.
Otherwise ClusterFirst containers will be badly impacted with skydns being their only NS.
(skydns will be in recurse mode)
(And also because kubelet has a backoff policy if any pod restarts too many times in a certain time window)
The text was updated successfully, but these errors were encountered: