-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(aws): add aws/alias-disable-a and aws/alias-disable-aaaa provider-specific options #5997
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
base: master
Are you sure you want to change the base?
Conversation
…r-specific options) Signed-off-by: u-kai <[email protected]>
|
[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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @u-kai. Thanks for your PR. I'm waiting for a github.com 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. 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. |
|
@u-kai thanks for this interesting PR. Wdyt of re-use existing annotation, It could be configurable like this :
|
|
@mloiseleur |
|
/ok-to-test |
Pull Request Test Coverage Report for Build 20000357394Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation with use cases for this properties is missing, and how it was tested on a real cluster
| return endpoints, nil | ||
| } | ||
|
|
||
| func aliasDisableARecord(ep *endpoint.Endpoint) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My opinion, we will benefit to have a generic,centralised method on Endpoint object for all annotations that contains booleans like true/false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like
func (ep *endpoint.Endpoint) GetProviderSpecificBool(key string bool) bool {
val, ok := ep.GetProviderSpecificProperty(key)
if !ok {
return false
}
// Normalize whitespace and case; accept common truthy values
v := strings.TrimSpace(strings.ToLower(val))
switch v {
case "1", "t", "true", "yes", "y":
return true
case "0", "f", "false", "no", "n":
return false
default:
return false
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does sound like a good idea.
However, in this change we’re going to use values other than just true/false, as @mloiseleur mentioned, and I’m a bit concerned that introducing a generic, centralized method here would make the scope of this PR too large.
I’d prefer to handle that refactor in a separate PR that can apply the change across the whole codebase. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
|
While creating comprehensive tests for supporting annotations like Should I include this fix in this PR, or would it be better to submit it as a separate PR? Discovered IssueWhen a ProviderSpecific property
Reproductionep := &endpoint.Endpoint{
RecordType: endpoint.RecordTypeMX,
RecordTTL: 600,
ProviderSpecific: endpoint.ProviderSpecific{
{Name: "alias", Value: "true"},
},
}
// Expected: TTL=600, ProviderSpecific=empty
// But result is: TTL=300, evaluateTargetHealth=false gets added
While this affects cases with incorrectly configured ProviderSpecific properties, I believe the behavior should be consistent. |
It's better as a separate PR. It's easier to review & test this way. |
|
I’ve submitted the fix in a separate PR here: #6017. |
|
Refactoring, bug fixes, new features - all should be in they own PRs. We are trying to de-resk releases. Way too many issues opened ;-) |
What does it do ?
Fixes: #5815
This PR adds support for selective control over A and AAAA alias record creation in the AWS Route53 provider through two new
ProviderSpecificannotations:aws/alias-disable-a: "true"- prevents creation of A alias recordsaws/alias-disable-aaaa: "true"- prevents creation of AAAA alias recordsWhen a CNAME endpoint creates alias records, external-dns automatically creates both A and AAAA alias records by default. These new annotations allow users to disable specific record types on a per-endpoint basis, providing granular control without affecting other DNS records.
Motivation
Issue #5815 requested the ability to selectively disable AAAA alias records for specific use cases. Currently, the only option is the global
--exclude-record-types=AAAAflag, which affects all records across all providers.This feature is particularly important for same-zone alias records where CNAME endpoints point to other records within the same hosted zone. While AWS managed services (like ELBs, CloudFront) typically support both IPv4 and IPv6, custom applications and services within the same zone often have different connectivity requirements.
Unlike AWS managed resources which are generally dual-stack capable, user-managed records in the same zone frequently have single-stack limitations, making this granular control essential for proper DNS configuration.
This enhancement provides the targeted control needed for these scenarios while maintaining full backward compatibility.
More