origin icon indicating copy to clipboard operation
origin copied to clipboard

Wildcard DNS on default_subdomain breaks pod hostname resolution

Open mliker opened this issue 9 years ago • 7 comments

If I configure a wildcard DNS for default subdomain, apps subdomain, external host resolution from pods fails since every name resolution is caught by the wildcard

Version
oc v3.6.0+c4dd4cf
kubernetes v1.6.1+5115d708d7
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://x.x.com:8443
openshift v3.6.0+c4dd4cf
kubernetes v1.6.1+5115d708d7

However I have been experiencing this since about 1.3 or 1.4

Steps To Reproduce
  1. set a default subdomain during advanced installation with ansible openshift_master_default_subdomain=appsdomain.com
  2. configure a wildcard DNS record for appsdomain.com
\*	600	IN	A	X.X.X.X

where X.X.X.X is masters IP 3. start a build with github as source for instance

Current Result
Cloning "https://github.com/openshift/django-ex.git" ...
error: build error: fatal: unable to access 'https://github.com/openshift/django-ex.git/': Peer's certificate issuer has been marked as not trusted by the user.
Expected Result

Build succeeds

Additional Information

resolution from a node:

root@n2 ~ # ping github.com
PING github.com (192.30.253.112) 56(84) bytes of data

192.30.253.112 is the correct github.com address

resolution from a pod:

$ ping github.com                                                                                                                                  
PING github.com.appsdomain.com (X.X.X.X) 56(84) bytes of data. 

X.X.X.X is my masters IP address as declared above (* IN A X.X.X.X)

Once I remove the wildcard record from the DNS everything works as expected

I suspect this is due to the fact that pods resolv.conf looks like this:

bash-4.2$ cat /etc/resolv.conf                                                                                                                                                     
nameserver X.X.X.X
search default.svc.cluster.local svc.cluster.local cluster.local appsdomain.com
options ndots:5

since github.com contains only one dot the resolver will try appending the search domains (since we have ndots:5) and it will succeed once it appends .appsdomain.com since this domain has a wildcard record and will resolve.

mliker avatar Oct 21 '17 08:10 mliker

I see this too.

Been seeing this for a while as well, but I was able to correct it by removing that search entry. But now it seems that it no longer has any effect - the resolv.conf in the containers is coming from somewhere else.

djdevin avatar Nov 08 '17 17:11 djdevin

Should be generated from /etc/dnsmasq.d/origin-dns.conf on master?

I had the same problem. The search domain in the node container (/etc/resolve.conf) in combination with a wildcard on my domain caused issues.

Removing the wildcard in dns (*.mydomain.io) while keeping *.apps.mydomain.io and console.mydomain.io) solved the issue.

rliessum avatar Nov 27 '17 20:11 rliessum

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar Feb 26 '18 11:02 openshift-bot

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

openshift-bot avatar Mar 28 '18 22:03 openshift-bot

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

openshift-bot avatar Apr 27 '18 23:04 openshift-bot

/reopen

This still happens with OKD 4.x. Maybe this issue could be moved to https://github.com/openshift/okd or another apropriate project.

rassie avatar Sep 13 '22 13:09 rassie

@rassie: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to this:

/reopen

This still happens with OKD 4.x. Maybe this issue could be moved to https://github.com/openshift/okd or another apropriate project.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

openshift-ci[bot] avatar Sep 13 '22 13:09 openshift-ci[bot]