Added frontend-nlb-status-only annotation to fix ExternalDNS record creation when using a frontend NLB#4849
Added frontend-nlb-status-only annotation to fix ExternalDNS record creation when using a frontend NLB#4849dominikhei wants to merge 4 commits into
Conversation
|
Hi @dominikhei. 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 Regular contributors should join the org to skip this step. 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dominikhei 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 |
|
/ok-to-test |
| By default, when a frontend NLB is enabled, both the ALB and NLB hostnames appear in the ingress status. When using [ExternalDNS](https://github.com/kubernetes-sigs/external-dns) on AWS, only a DNS record for the first entry is created (see [external-dns#5661](https://github.com/kubernetes-sigs/external-dns/issues/5661)), which means the NLB does not get a DNS record. Setting this annotation to `"true"` restricts the status to only the NLB hostname, so ExternalDNS creates a DNS record pointing at the NLB. | ||
|
|
||
| !!!note | ||
| This annotation has no effect if `alb.ingress.kubernetes.io/enable-frontend-nlb` is not set, or if the NLB has not yet been provisioned. In those cases the ALB hostname is written to status as normal. |
There was a problem hiding this comment.
I wonder if we just want to block setting any hostname if you have this flag set, until the nlb is provisioned? that way there is no weird host flip / flop when you're provisioning an nlb -> alb stack.
There was a problem hiding this comment.
The change would be pretty simple from a code perspective. I don't see any downside apart from the fact that if anything is waiting on ingress status to be populated before considering the ingress ready could be blocked for longer. But since the current behavior would populate it with the ALB hostname, they would be unblocking on the wrong address anyway...
Issue
#4805
The original issue was surfaced in external-dns#5661, where it was decided that the fix belongs in the AWS Load Balancer Controller rather than ExternalDNS
Description
When frontend NLB is configured via
alb.ingress.kubernetes.io/enable-frontend-nlb: "true", the controller writes both the ALB and NLB hostnames to status.loadBalancer.ingress. When using ExternalDNS on AWS, only a DNS record for the first entry is created, meaning the NLB, which is the actual external-facing endpoint, may not get a DNS record at all.The existing workaround (external-dns.alpha.kubernetes.io/target) requires a two-step deploy because the NLB hostname isn't known until after provisioning, which makes it impractical for automated workflows.
This PR adds a new boolean annotation:
alb.ingress.kubernetes.io/frontend-nlb-status-only: "true"When set, only the NLB hostname is written to status.loadBalancer.ingress, so ExternalDNS creates a record for the NLB only. The annotation is opt-in to avoid a breaking change. If the NLB DNS is not yet available, the controller falls back to the ALB hostname to avoid leaving status empty.
Validation:
Manually validated on EKS: ingress with the annotation shows 1 status entry (NLB only) and a control ingress without it shows 2 entries (ALB + NLB).
Checklist
README.md, or thedocsdirectory)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯