-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Escaped double quotes of target prevents creation of TXT, NAPTR and CAA records with DNSEndpoint #3979
Comments
Hey @ffledgling @jhoch-palantir @ottoyiu @tariq1890 @Raffo @anandsinghkunwar @matusf |
Heyo @jstudler I no longer have access to @ffledgling (Github 2FAC lockout) and I haven't actively used this setup in over 4 years, so I'm not really the best person to fix this anymore. You might want to find someone who still uses this setup, I think @jhoch-palantir no longer does, @anandsinghkunwar might? That said, if my memory serves correctly, this just looks like a serialization/deserialization issue along the long chain from YAML -> Materialized Spec -> Kubernetes Scheduler -> external-dns -> powerdns-provider -> powerDNS. I feel like I ran into this issue with CNAME records as well. Getting it right is somewhat tricky and fixing it for just one family of records might break it for the rest unless handled with care. If you feel up to it, please submit a code-fix and one of the maintainers of the parent external-dns repo can help get this merged. |
Hey @jstudler, I don't look into this setup anymore. As @anhadjaisingh pointed out perhaps one of the core maintainers of the repo can get your PR merged if you're up for it. |
Hey @anhadjaisingh & @anandsinghkunwar, |
Update: It seems that External DNS prevents trailing dots in a RR target (https://github.com/kubernetes-sigs/external-dns/blob/master/source/crd.go#L191-L201) while the NAPTR RFC requires it (https://datatracker.ietf.org/doc/html/rfc2915). So by removing the trailing dot in the CR (see issue description above), External DNS would not refuse the endpoint anymore but then it would also not be RFC compliant anymore. #4212 fixes the issue |
Just to confirm: CAA record creation for AWS was not implemented? (I see no PRs with CAA creation) and no const for CAA in external-dns/endpoint/endpoint.go Line 30 in 1ceaf79
From what I can tell:
|
Yes, I think CAA records should work – at least in the context of the PR you referenced. The description of this issue here is not accurate because some of the PowerDNS/ExternalDNS log messages led to a false conclusion that the quotes would be the issue. The problem for this issue was actually that ExternalDNS prevented a trailing dot for all records which is a must for NAPTR. So if CAA record creation does not work, it's likely a different underlying problem. |
What happened: It is not possible to create NAPTR, TXT or CAA records using DNSEndpoint custom resource on both AWS and PowerDNS because double quotes are sent escaped to AWS/PowerDNS. While the API responses in the examples below are based on AWS, the same problem applies to PowerDNS.
What you expected to happen: It should be possible to create NAPTR, TXT or CAA records using the DNSEndpoint CR.
How to reproduce it (as minimally and precisely as possible):
With quotes AWS will return an error because the NAPTR record is not in a RFC 2915 compliant and external dns escaped the quotes.
Error:
Without quotes AWS will return an error because the NAPTR record is not in a RFC 2915 compliant.
Error:
Single quotes are as well not RFC 2915 compliant and don't work with AWS.
Error:
The same applies to all NAPTR, CAA and TXT records on both AWS and PowerDNS providers. Potentially, other providers are affected as well.
With TXT records, it is probably a different topic since the entire content should be enclosed in double quotes and not only certain fields.
Anything else we need to know?:
Problem: Some records – NAPTR, CAA and TXT – require double quotes for some of the fields. The Kubernetes API JSON returns spec.endpoints.targets as string where double quotes are escaped. The double quotes are sent escaped to the Provider APIs. However, some providers (e.g. PowerDNS or AWS) require RFC-compliant resource record data which means one must add the double quotes to these fields. The current behaviour does not allow creation of TXT, NAPTR or CAA records.
Affected record types:
For NAPTR, AWS returns 400 and the following error (without quotes, with single quotes, with double quotes):
For TXT, AWS returns 400 and the following error:
For CAA, AWS returns 400 and the following error:
Related issues:
Environment:
external-dns --version
): v0.13.6The text was updated successfully, but these errors were encountered: