-
Notifications
You must be signed in to change notification settings - Fork 2.8k
*Route DNS entry uses longest matching suffix of all attached gateways #5271
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
*Route DNS entry uses longest matching suffix of all attached gateways #5271
Conversation
Basically this fixes a bug where if a single HTTPRoute is attached to two different Gateways whose hostname matches a hostname on the HTTPRoute but is a "longer match" whichever endpoint name that is sorted first gets selected in cases where multivalue is not available such as AWS alias record
Welcome @gganley! |
Hi @gganley. 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 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. |
[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 |
@gganley Would you please rename your PR following conventional commits ? cc @abursavich for a first review |
I understand your reasoning and agree that makes sense in most cases, but the user has explicitly attached the route to multiple gateways and listeners and we should respect that. I don't think what we decide is probably better in most cases should overrule what a user explicitly configured. That's a very high bar to clear. |
In general we should wait on gateway-api people before we change anything on this right now. |
Do you mean Conventional Commits? I was confused because I tried to read the contributing guide to the best of my abilities and didn't see anything referencing that but when I searched I found the issue you posted. Is this for automation reasons or just because it's something you/the team prefers? Would that be something like |
I think my logic changes can be updated to have the same IPs but in a different order based on the metrics I've laid out. In the specific case I use of k8s gateway API + AWS Route 53 (which creates alias) only the first entry in the multi answer is actually committed to DNS (I may have poor phrasing, sorry for that). I could understand not wanting to break behavior even if the change "would make more sense", so would it make more sense to put this "new behavior" behind a major version or a configuration flag? |
I've tried my best to read the gateway api spec and it doesn't seem like this is covered in the spec. The closest is the logic that decides between two HTTPRoutes, not the Gateways attached to a single HTTPRoute
|
Something like
|
Nope. We will follow what the user explicitly configured and the Gateway API spec. |
Would reordering the gateway addresses rather than removing addresses be acceptable to accept without running by the spec team since the spec mentions nothing about order. |
PR needs rebase. 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. |
If this kind of change is accepted on Gateway API, then we can support it. Feel free to re-open it or open a new one if you have a change accepted upstream, by Gateway API maintainers. |
@mloiseleur: Closed this PR. In response to this:
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. |
Description
Currently if an HTTPRoute is attached to multiple Gateways whose hostnames overlap with each of the hostnames in the HTTPRoute, but at different lengths, it returns a Multivalue of the sorted gateway addresses. In my opinion in cases like this where the DNS entries will be CNAMEs or Alias records where Multivalue doesn't make sense (AFAIA) if there is a "more correct" answer that one should be used. So in this case the gateway that has the longer overlap with a given httproute hostname is used as the value for the DNS record.
Checklist