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

The AWS provider is creates NAPTR records using the CRD, but only when the record does not exist. #5003

Open
woltere opened this issue Jan 13, 2025 · 3 comments
Labels
area/provider/aws Issues or PRs related to aws provider help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.

Comments

@woltere
Copy link

woltere commented Jan 13, 2025

What happened:

  1. deployed external-dns on EKS
  2. added parameters --managed-record-types=NAPTR
  3. created a CRD with a record of type NAPTR

The NAPTR and TXT records are correctly created when they do not already exist.
On the next passes it again tries to create the records again and fails with the errors listed below.

time="2025-01-13T21:43:51Z" level=info msg="Desired change: CREATE REDACTED NAPTR" profile=default zoneID=/hostedzone/Z0XXXXXXXXXXXXXXXXXXX zoneName=xxxxxxxxx.xxx.
time="2025-01-13T21:43:51Z" level=info msg="Desired change: CREATE extdns-naptr-xxxxxxxxxxxxxxTXT" profile=default zoneID=/hostedzone/Z0XXXXXXXXXXXXXXXXXXX zoneName=xxxxxxxxxxxxxxx.
time="2025-01-13T21:43:51Z" level=error msg="Failure in zone xxxxxxxxxxxxxxx. when submitting change batch: InvalidChangeBatch: [Tried to create resource record set [name='xxxxxxxxxxxxxxx.', type='NAPTR'] but it already exists, Tried to create resource record set [name='extdns-naptr-xxxxxxxxxxxxxxx', type='TXT'] but it already exists]\n\tstatus code: 400, request id: xxxxxxxxxx-xxxxxx-xxxx-xxxx-xxxxxxxxxxxx" profile=default zoneID=/hostedzone/Z0XXXXXXXXXXXXXXXXXXX zoneName=xxxxxxxxxxxxxxxxx.

The created NAPTR record can't be removed by external-dns.

What you expected to happen:

Once the records exist they should not be created again.

How to reproduce it (as minimally and precisely as possible):

Enable NAPTR using the --managed-record-types argument and provider aws and add crd to sources
Create a CRD with a NAPTR record.

Anything else we need to know?:

Looking at the code of aws provider it seems that the NAPTR records are skipped because p.SupportedRecordType(r.Type) returns false when r.Type equals "NAPTR".
The provider will create the NAPTR record successfully if it not exists.
Because func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZone) ([]*endpoint.Endpoint, error) totally skips the NAPTR records they can't be updated or deleted by external-dns

Environment:

  • External-DNS version (use external-dns --version):

v20240904-v0.15.0

  • DNS provider:

aws

  • Others:
@woltere woltere added the kind/bug Categorizes issue or PR as related to a bug. label Jan 13, 2025
@ivankatliarchuk
Copy link
Contributor

/help
/area provider/aws

@k8s-ci-robot
Copy link
Contributor

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

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

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

In response to this:

/help
/area provider/aws

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added area/provider/aws Issues or PRs related to aws provider help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Feb 1, 2025
@woltere
Copy link
Author

woltere commented Feb 1, 2025

I have a patch and will create can PR once i've completed updating the unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/provider/aws Issues or PRs related to aws provider help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants