fix(txt/endpoint/crd/coredns) Arbitrary TXT Record Bug Fixes and Support for CoreDNS#5740
fix(txt/endpoint/crd/coredns) Arbitrary TXT Record Bug Fixes and Support for CoreDNS#5740onelapahead wants to merge 13 commits intokubernetes-sigs:masterfrom
Conversation
Signed-off-by: hfuss <hayden.fuss@kaleido.io>
Signed-off-by: hfuss <hayden.fuss@kaleido.io>
Signed-off-by: hfuss <hayden.fuss@kaleido.io>
Signed-off-by: hfuss <hayden.fuss@kaleido.io>
Signed-off-by: hfuss <hayden.fuss@kaleido.io>
…the truncation on .'s Signed-off-by: hfuss <hayden.fuss@kaleido.io>
Signed-off-by: hfuss <hayden.fuss@kaleido.io>
Signed-off-by: hfuss <hayden.fuss@kaleido.io>
…nd works Signed-off-by: hfuss <hayden.fuss@kaleido.io>
Signed-off-by: hfuss <hayden.fuss@kaleido.io>
Signed-off-by: hfuss <hayden.fuss@kaleido.io>
…ing indexed prefixes Signed-off-by: hfuss <hayden.fuss@kaleido.io>
…n then preserve the ordering Signed-off-by: hfuss <hayden.fuss@kaleido.io>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @onelapahead! |
|
Hi @onelapahead. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
|
Recognize because of the fixes in both Should be fine to pull out the former into smaller PRs, and make this a more specific PR to just But could use the maintainers overall feedback on my motivations and to see how the fixes all relate - and if there were any flaws in my expectations around non-registry TXT records and the CRD source - before I go that additional effort. Thanks ! |
|
This PR is too large; fixes, refactoring, new fucntionality and etc. How would you recommend we break it down? Just a heads-up that changes to the TXT logic can be extremely slow to approve, as you can see from this past example, as it most likely will require owners approval: #5459. |
|
/ok-to-test |
|
Thanks @ivankatliarchuk - I agree. I have also started testing TXT records via I think a lot of the fixes outside of Additionally, I will open two |
What does it do ?
Allow for managing TXT records via
DNSEndpointswhen using thecorednsprovider. Specifically, achieves the properties I expected when using the CRD source with TXT records:DNSEndpointI made, all the TXT records would be cleaned up.and=targetsand all them be resolvedDNSEndpointsshould (eventually) result in changes in the managed DNS recordsDNSEndpoints, if the order of thetargetsdefined for TXT records can be preserved when resolving the TXT records, as their format might mean something in the context of a broader protocol (though I understand single strings with;separators are preferred due to the fact that ordering is not guaranteed by providers).To do so, this PR fixes several bugs observed:
.were considered "illegal" wrongfully, and if they weren't considered illegal, they had their trailing.truncated=were incorrectly parsed when building the{target}={hash}label value pairs within endpointstargetswas being lost due to sortings for comparisons withinSame(). While order of records is not guaranteed depending on the record type and the provider, it felt unnecessary for ExternalDNS to randomly order the declaratively definedtargetsfrom a user in the CRD case, and helped make sure the order of TXT targets was preserved.corednsspecifically:a. multiple
targetsfor a TXT record were not supported. Only a single etcdServicewithTextwas being synced. Ordered, hash prefixes are now used to create unique keys for eachServicecontaining the bit ofTextexpected.b. updating records (whether A or TXT) with
--policy=syncdid not work because theownerlabel was never being set. causing the provider to think the records were up-to-datec. cleaning up TXT records was not working (might address Delete orphaned owned TXT record #1503)
Motivation
I went to try our the CRD source for managing a mixture of A and TXT records, using the CoreDNS provider for my local development environment on KinD (with plans to begin testing main cloud providers like AWS shortly after).
I had not realized the docs stated only
digitaloceanwas currently supported, and after some trial and error noticed that for CoreDNS was partially working. Attached is the YAML manifests I used to create a local CoreDNS + etcd + ExternalDNS environment (extdns.yaml). But the following are the ExternalDNS args I used:I tested with a set of
DNSEndpointslike these:I found the bugs above as I created, updated, and deleted variations of these endpoints, and made the various fixes in the PR in order to get all of those edge cases working. Disclaimer: I used
claud-4-sonnetmodel of Cursor to assist me in my changes as I got more familiar with the code base and shared logs/results from my manual testing.More