-
Notifications
You must be signed in to change notification settings - Fork 0
TXT Registry Behavior
Daniel Lamando edited this page Feb 26, 2022
·
3 revisions
The TXT Registry,
once configured as per Configuring a Registry,
adds extra text records to your DNS providers in order to keep track of DNS record ownership.
The registry concept is based on the external-dns project's registry, as mentioned on Comparison with external dns.
A TXT record used for ownership might look like this:
app.brand.tld. 120 IN TXT "heritage=external-dns,external-dns/owner=usc1f-int,external-dns/resource=ingress/brand/app-fe,record-type/A=managed,record-type/AAAA=managed"
The record data would be parsed into a structure like this:
heritage: external-dns
external-dns/owner: usc1f-ext
external-dns/resource: ingress/brand/app-fe
record-type/A: managed
record-type/AAAA: managedEach field has a meaning:
-
heritagemarks that theTXTrecord is used in anexternal-dnsregistry fashion. BecauseTXTrecords can be used for other purposes, theheritagefield works like a signature. -
external-dns/owneridentifies the "owner-id" of the installation managing this record. This value should be unique to each DNS sync daemon running in any Kubernetes cluster. I usually include the cloud provider region and also a short identifier for future proofing. -
external-dns/resourceidentifies the Kubernetes resource that wants this record to exist. If values from multiple Kubernetes resources are being combined, then this field is left out. Useful if you want to locate where a particular record is coming from. -
record-type/*fields provide a list of record types that are being managed by this owner. When this field is present, other record types are allowed to exist at the same DNS name, and the DNS sync daemon owning thisTXTrecord will leave them alone. If the field is missing then it is treated as managing every record type.
When kubernetes-dns-sync wants to manage a DNS record that it doesn't already have ownership over,
several things are checked:
- What other ownership
TXTs already exist? For each ownership record we understand:- If the ownership doesn't have any overlapping types (e.g.
TXTwhile we wantA), disregard it. - If the ownership overlaps, but it's an
ownervalue that we are willing to adopt, then we will continue with our changes and also rewrite the ownershipTXT. - If the ownership overlaps and isn't adoptable, we'll skip management of the FQDN entirely.
- If the ownership doesn't have any overlapping types (e.g.
- What DNS records types already exist at the FQDN?
- If there's any overlap in types (
Aexists and we wantA), we'll skip management of those types. - If the existing records are all of a different type (e.g.
TXT) then we won't skip our management.
- If there's any overlap in types (
- Do we already manage other types at the FQDN?
- We'll happily add new record types to our existing ownership record. This'll happen if you add IPv6 addresses to your existing ingress controller.