-
Notifications
You must be signed in to change notification settings - Fork 484
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
DNS resolution uses resolv.conf nameserver even though upstreamNameserver is specified... #248
Comments
This is the short-name dns resolution process of k8s pods with the ClusterFirst policy. |
Thanks for the explanation there. Any potential insight on the upstreamNameservers issue? Just tested this in a brand new k8s cluster spun up in azure and still seeing external queries being sent to the MSFT nameserver instead of specified one. upstreamNameserver value doesn't seem to be respected. |
We can look at the flags for dnsmasq (responsible for routing incoming dns queries) to verify that they are configured correctly. You can see those in the kube-dns deployment. These are supposed to be automatically configured based on the kube-dns configmap settings. |
Looking at the dnsmasq container:
Looks like the flag (I assume you're looking for another
The only error I see is the We are using acs-engine and the config that showed up from I'm wondering if that seems to be overriding my values somehow but the logs seem to disprove that. |
Instead of I think ACS has a mis-configuration here: https://github.com/Azure/acs-engine/blob/5e62bbf26536cbda4b19b02a49469d881831df10/parts/k8s/addons/kubernetesmasteraddons-kube-dns-deployment.yaml#L132. Ref how this is configured upstream: https://github.com/kubernetes/kubernetes/blob/753632d85b7639ffadb05eed3e49dbfbbd5360b6/cluster/addons/dns/kube-dns/kube-dns.yaml.base#L170.
The dnsmasq nanny watches the kube-dns configmap and does a live restart on dnsmasq using updated flags. The deployment itself will not be updated. |
@MrHohn thanks for the clarification. I had an inkling that that was the problem and created an issue with ACS already. I will definitely link to this ticket here for reference as well. Follow up question on:
If the deployment itself is not updated, do subsequent scale ups of the DNS deployment contain stale data then? |
No, the new kube-dns replicas will read from kube-dns configmap upon startup hence will contain the latest configuration. |
Awesome, thank you for your help! |
What happened
We're planning to use consul as a DNS server for internal services and also as a forwarder for external domains.
Following this article it looks like all we need to do is specify the
upstreamNameservers
in the kube-dns config map with our consul box IP.After doing this and ssh-ing into a pod to do an
nslookup active.vault.service.<mydomain>.int
, I getDoing a tcpdump on the consul box yields intermittent activity:
Question here...why does my query have the kubernetes search domains appended to it?
Looking at the tcpdump on the dnsmasq container, if I try to nslookup the consul domain, it never forwards to the upstream:
If I look up an external DNS, I do see that it eventually forwards to the resolv.conf azure nameserver (168.63.129.16.53). Since I have upstreamNameservers specified, should it not that instead of what's in resolv.conf?
If I add a separate
stubDomain
just for the consul stuff, resolution works, but the article above seems to be worded in a way that indicates as long as your dnsPolicy is ClusterFirst and you're specifying an upstreamNameserver... if the domain isn't cluster.local, it should forward to your specified upstream. Is this not the case? Just need some clarity here...Env
Azure
Kubernetes 1.9.6
KubeDNS 1.14.8
dnsPolicy: ClusterFirst
The text was updated successfully, but these errors were encountered: