Cert-manager: CloudDNS and Split DNS issue

Created on 19 Feb 2019  路  5Comments  路  Source: jetstack/cert-manager

I am trying to setup Google Cloud with Split Horizon DNS but txt records are created in private zone. I gave a try - --dns01-recursive-nameservers=208.67.222.222:53 and still dns records are created in private zone. I have read https://github.com/jetstack/cert-manager/issues/903 and there is some useful explanation about these cases:

This creates issues for cert-manager because when we perform a DNS query to find the DNS authority, the internal nameserver will respond with the private DNS zone root, consequently failing the self-check (as cert-manager will have updated the _public_ zone).

This is mitigated by allowing users to specify the --dns01-self-check-nameservers flag, which will alter the 'root' nameserver used to perform the initial query - the idea here being that by specifying e.g. 8.8.8.8, they will begin recursing the _public_ zone to find the authority that Let's Encrypt will see.

All my tries ended up in private namespace. Here is some logs from our servers:

```
I0219 09:34:29.137645 1 dns.go:101] Checking DNS propagation for "cemo.com" using name servers: [208.67.222.222:53]
I0219 09:34:29.338374 1 sync.go:173] propagation check failed: DNS record for "cemo.com" not yet propagated
I0219 09:34:29.338696 1 controller.go:211] challenges controller: Finished processing work item "cert-manager/cemo-com-2281260743-0"
I0219 09:34:39.338958 1 controller.go:205] challenges controller: syncing item 'cert-manager/cemo-com-2281260743-0'
I0219 09:34:39.339134 1 logger.go:103] Calling Discover
````

areacme areacmdns01 help wanted kinbug lifecyclstale prioritimportant-longterm

Most helpful comment

Interesting how I bumped into the same issue just 18 hours later.
It looks like clouddns provider is using v1 api which does not have Visibility field in ManagedZone, so when two zones are returned by Cloud DNS API it just blindly picks first one from array.
Need to bump API version and and always pick zone with visibility=public (even if just one zone returned)

https://github.com/jetstack/cert-manager/blob/master/pkg/issuer/acme/dns/clouddns/clouddns.go#L220

For now, the workaround is to host public zone in separate project from private.

All 5 comments

Interesting how I bumped into the same issue just 18 hours later.
It looks like clouddns provider is using v1 api which does not have Visibility field in ManagedZone, so when two zones are returned by Cloud DNS API it just blindly picks first one from array.
Need to bump API version and and always pick zone with visibility=public (even if just one zone returned)

https://github.com/jetstack/cert-manager/blob/master/pkg/issuer/acme/dns/clouddns/clouddns.go#L220

For now, the workaround is to host public zone in separate project from private.

Thanks for digging in @ivan-gusev!

/help
/area acme/dns01
/area acme
/kind bug
/priority important-longterm

@munnerz:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

Thanks for digging in @ivan-gusev!

/help
/area acme/dns01
/area acme
/kind bug
/priority important-longterm

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.

I think most of the people's dns zone names are in the format of "xxx-private-zone" and "xxx-public-zone". It seems that API returns in alphabetical order. I had changed "xxx-public-zone" -> "xxx-pblic-zone" and public zone returns first. I am of course not sure but it may be another workaround for a while too.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to jetstack.
/lifecycle stale

Was this page helpful?
0 / 5 - 0 ratings