-
Notifications
You must be signed in to change notification settings - Fork 487
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
Adding GEP-995 for support for named route rules #2593
Conversation
Welcome @guicassolato! |
Hi @guicassolato. 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/test-infra repository. |
Can we please get some preliminary feedback on this (Goals/Non-goals, especially), so we can try moving on with the actual proposal? Maybe @youngnick and/or @robscott please? 🙏 (If you have the time for it. I know you're usually very busy.) |
@guicassolato, thanks for putting this together! I'm going to try to pay more attention to it, as we're finding a use case for this in Linkerd, too. One questions for you that's not in the draft GEP -- are you thinking that must names be unique? |
Good question, @kflynn! I think unique names make sense for selecting individual referents. For selecting more than one referent, the reference should list all the names. You definitely lose the possibility of using the field for grouping. On the other hand, any reference becomes unambiguous, which I think is a good thing. It's also neat for observability; if you log/trace a rule-related event by name, you know exactly which rule the event is related to. (For similar reason, I believe unique names also serves well to Istio's use case, which IIRC included possibly some 1:1 mapping to internal objects, today based strictly on index.) In contrast, an alternative could be something like labels. They also work for selecting and have the extra benefit of serving as well for grouping. However, they are likely not as neat as a simple and straightforward unique name for referencing, and tracing can get messy. Finally, among all these options (unique names, homonymous referents, and labels), I believe unique names is the more restrictive one and therefore the best start. It's easier to evolve from this to something more permissive in the future if needed, than the opposite. |
Is there any update on this PR? |
There was no objection regarding the goals/non-goals for a couple of weeks, so I've pushed the proposal for the API changes. Now, it needs review. |
@kflynn @robscott @howardjohn @hzxuzhonghu |
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.
Overall LGTM, thanks for writing this up @guicassolato! Minor notes, biggest being to explicit apply this change to all route types. I hope we can discuss this at the first Gateway API meeting in 2024 and get this merged soon!
One questions for you that's not in the draft GEP -- are you thinking that must names be unique?
I do think requiring unique names makes sense and would follow the UX pattern of other resources with a name
field such as Gateway Listener, Service ports.name and Volume name as the similar examples cited in this GEP.
EDIT: Added to the Gateway API meeting agenda for January 8th!
geps/gep-995.md
Outdated
* Implementations can be inconsistent because referencing may rely on the index of the referents within the lists for making the reference, as well as based on repetition in the reference (partially or totally) of values of the referent to match. | ||
|
||
* When repetition of values is employed, the complexity associated with the API of the referent itself is brought to the level of the reference, thus adding this other problem to the referencing system. If types and validation rules of the referent are re-used to implement the reference API, their associated complexity adds up to the complexity of validating also the reference values, even though due soly to the repetition across resources. | ||
|
||
* Referencing list elements without a unique identifier is also prone to execution errors, either when relying on how the elements are sorted in the list (i.e., based on the index) or on partial or total repetition of values of the referents. The order of elements within a list may change without necessarily any semantic reason. Complex elements can sometimes differ only subtly from each other, thus easily being overlooked when making the reference and resulting in a higher chance of typos and/or references that are possibly ambiguous or broken. In both cases, such references are fragile and can result in unexpected errors. |
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.
* Implementations can be inconsistent because referencing may rely on the index of the referents within the lists for making the reference, as well as based on repetition in the reference (partially or totally) of values of the referent to match. | |
* When repetition of values is employed, the complexity associated with the API of the referent itself is brought to the level of the reference, thus adding this other problem to the referencing system. If types and validation rules of the referent are re-used to implement the reference API, their associated complexity adds up to the complexity of validating also the reference values, even though due soly to the repetition across resources. | |
* Referencing list elements without a unique identifier is also prone to execution errors, either when relying on how the elements are sorted in the list (i.e., based on the index) or on partial or total repetition of values of the referents. The order of elements within a list may change without necessarily any semantic reason. Complex elements can sometimes differ only subtly from each other, thus easily being overlooked when making the reference and resulting in a higher chance of typos and/or references that are possibly ambiguous or broken. In both cases, such references are fragile and can result in unexpected errors. | |
Referencing list elements without a unique identifier is also prone to execution errors, either when relying on how the elements are sorted in the list (i.e., based on the index) or on partial or total repetition of values of the referents. The order of elements within a list may change without necessarily any semantic reason. Complex elements can sometimes differ only subtly from each other, thus easily being overlooked when making the reference and resulting in a higher chance of typos and/or references that are possibly ambiguous or broken. In both cases, such references are fragile and can result in unexpected errors. |
I think the notes about "repetition" here are a bit too abstract to be easily understood, and those sentences could probably be dropped without losing any important detail - this is covered more succictly and clearly in the Alternatives section. The relevant bits about index reference inconsistency are already covered well in the last paragraph. Removed list formatting.
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.
Just added a short bullet point to one of the alternatives, to cover the part of the meaning that I believe could otherwise be lost, and accepted the suggestion. Thanks!
geps/gep-995.md
Outdated
|
||
### Default value | ||
|
||
Implementations SHOULD not assume a default vaule for the `name` field for route rules when not specified by the end-user. |
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.
Implementations SHOULD not assume a default vaule for the `name` field for route rules when not specified by the end-user. | |
Implementations MUST NOT assume a default value for the `name` field for route rules when not specified by the end-user. |
geps/gep-995.md
Outdated
### Break down route objects into smaller ones (with less rules) | ||
- Could lead to an explosion of route objects containing no more than one rule each, thus defeating the purpose of supporting lists of rules within route objects in the first place |
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.
Probably worth citing #1696 (comment) here too - even though large routes with many rules should be discouraged, this is still useful with small routes with just a few rules.
Thanks for the suggestions @mikemorris! I'm officially back from holidays tomorrow and I'll make the changes to the PR. |
…route types, more concise intro, and other minor ones
status: Provisional | ||
authors: | ||
- guicassolato | ||
changelog: |
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.
@youngnick, add relationships to Policy Attachment here, maybe once finishing splitting GEP-713 into Direct and Inherited?
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.
Done it.
/ok-to-test |
Sorry we've taken so long to get to this @guicassolato! I think this has been very well written, and given our recent discussions at KubeCon about this, I think we're overdue to get this in. With that said, I think we're realistically a bit too late to hit the v1.1 cut, but hopefully this can be one of the first features included in v1.2. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: guicassolato, mikemorris, robscott, youngnick The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thanks for approving the PR, guys! 🙏 There's still a |
Since we've got approvals from a couple maintainers on this I think we're good to remove the hold. /hold cancel |
What type of PR is this?
/kind gep
/kind api-change
What this PR does / why we need it:
Proposal to add a new
name
field to the route rule types (GRPCRouteRule, HTTPRouteRule, TCPRouteRule, TLSRouteRule and UDPRouteRule) to support referencing individual rules by name.Which issue(s) this PR fixes:
Part of #995
Does this PR introduce a user-facing change?: