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

Adding GEP-995 for support for named route rules #2593

Merged
merged 6 commits into from
Apr 6, 2024

Conversation

guicassolato
Copy link
Contributor

@guicassolato guicassolato commented Nov 17, 2023

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?:

Add a new `name` field to the route rule types GRPCRouteRule, HTTPRouteRule, TCPRouteRule, TLSRouteRule, and UDPRouteRule.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/gep PRs related to Gateway Enhancement Proposal(GEP) kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Nov 17, 2023
Copy link

linux-foundation-easycla bot commented Nov 17, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Welcome @guicassolato!

It looks like this is your first PR to kubernetes-sigs/gateway-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 17, 2023
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Nov 17, 2023
@guicassolato
Copy link
Contributor Author

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.)

@kflynn
Copy link
Contributor

kflynn commented Dec 1, 2023

@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?

@guicassolato
Copy link
Contributor Author

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.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 14, 2023
@spacewander
Copy link
Contributor

Is there any update on this PR?
IMHO, many people like us need the new name filed in the xRoute.

@guicassolato
Copy link
Contributor Author

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.

@spacewander
Copy link
Contributor

@kflynn @robscott @howardjohn @hzxuzhonghu
This GEP targets #995. Would you take a look at it? Thanks!

Copy link
Contributor

@mikemorris mikemorris left a 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 Show resolved Hide resolved
geps/gep-995.md Outdated Show resolved Hide resolved
geps/gep-995.md Outdated Show resolved Hide resolved
geps/gep-995.md Outdated
Comment on lines 30 to 34
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.

Copy link
Contributor Author

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 Show resolved Hide resolved
geps/gep-995.md Outdated Show resolved Hide resolved
geps/gep-995.md Outdated Show resolved Hide resolved
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 Show resolved Hide resolved
geps/gep-995.md Outdated
Comment on lines 97 to 98
### 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
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 22, 2023
@guicassolato
Copy link
Contributor Author

Thanks for the suggestions @mikemorris! I'm officially back from holidays tomorrow and I'll make the changes to the PR.

@k8s-ci-robot k8s-ci-robot removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 4, 2024
@k8s-ci-robot k8s-ci-robot requested a review from bowei January 4, 2024 13:44
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 6, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 8, 2024
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 8, 2024
status: Provisional
authors:
- guicassolato
changelog:
Copy link
Contributor Author

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done it.

@youngnick
Copy link
Contributor

/ok-to-test
/approve

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 5, 2024
@robscott
Copy link
Member

robscott commented Apr 5, 2024

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
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 5, 2024
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@guicassolato
Copy link
Contributor Author

Thanks for approving the PR, guys! 🙏 There's still a do-not-merge/hold label which needs to be removed I imagine, but happy to start working on the actual change myself as soon it happens... now targeting v1.2.

@robscott
Copy link
Member

robscott commented Apr 5, 2024

Since we've got approvals from a couple maintainers on this I think we're good to remove the hold.

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 5, 2024
@k8s-ci-robot k8s-ci-robot merged commit 3484e34 into kubernetes-sigs:main Apr 6, 2024
8 checks passed
@howardjohn howardjohn mentioned this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/gep PRs related to Gateway Enhancement Proposal(GEP) lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants