Skip to content
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

Allow configuring TXT registry to only generate the "new" format of TXT records #4636

Open
mjlshen opened this issue Jul 26, 2024 · 3 comments · May be fixed by #4946
Open

Allow configuring TXT registry to only generate the "new" format of TXT records #4636

mjlshen opened this issue Jul 26, 2024 · 3 comments · May be fixed by #4946
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@mjlshen
Copy link
Contributor

mjlshen commented Jul 26, 2024

What would you like to be added:
Currently when using the TXT registry, two TXT records (old + new format) are being created for every record the external-dns creates:

// generateTXTRecord generates both "old" and "new" TXT records.
// Once we decide to drop old format we need to drop toTXTName() and rename toNewTXTName
func (im *TXTRegistry) generateTXTRecord(r *endpoint.Endpoint) []*endpoint.Endpoint {
endpoints := make([]*endpoint.Endpoint, 0)
if !im.txtEncryptEnabled && !im.mapper.recordTypeInAffix() && r.RecordType != endpoint.RecordTypeAAAA {
// old TXT record format
txt := endpoint.NewEndpoint(im.mapper.toTXTName(r.DNSName), endpoint.RecordTypeTXT, r.Labels.Serialize(true, im.txtEncryptEnabled, im.txtEncryptAESKey))
if txt != nil {
txt.WithSetIdentifier(r.SetIdentifier)
txt.Labels[endpoint.OwnedRecordLabelKey] = r.DNSName
txt.ProviderSpecific = r.ProviderSpecific
endpoints = append(endpoints, txt)
}
}
// new TXT record format (containing record type)
recordType := r.RecordType
// AWS Alias records are encoded as type "cname"
if isAlias, found := r.GetProviderSpecificProperty("alias"); found && isAlias == "true" && recordType == endpoint.RecordTypeA {
recordType = endpoint.RecordTypeCNAME
}
txtNew := endpoint.NewEndpoint(im.mapper.toNewTXTName(r.DNSName, recordType), endpoint.RecordTypeTXT, r.Labels.Serialize(true, im.txtEncryptEnabled, im.txtEncryptAESKey))
if txtNew != nil {
txtNew.WithSetIdentifier(r.SetIdentifier)
txtNew.Labels[endpoint.OwnedRecordLabelKey] = r.DNSName
txtNew.ProviderSpecific = r.ProviderSpecific
endpoints = append(endpoints, txtNew)
}
return endpoints
}

I would like to propose a flag (or some other way) to configure the TXT registry to only use the new format.

Why is this needed:
I am trying to use external-dns to manage DNS records at scale and am running into cloud provider limits, e.g. by default Azure public DNS Zones allow for a maximum of 10,000 record sets. This quota can be increased, but if external-dns can be configured so that the TXT registry only creates one additional record, this would be a massive improvement for my use-case.

@mjlshen mjlshen added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 26, 2024
@mloiseleur
Copy link
Contributor

@mjlshen Maybe you will be interested in #4575.
Using CR as a registry could help overcome this kind of limitations, too.

@maxwell-gregory
Copy link

Having 3 records to sync with external-dns and my DNS provider is causing rate limiting. Any hopes on a fix for getting rid of this old txt record style?

@malpou malpou linked a pull request Dec 12, 2024 that will close this issue
2 tasks
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants