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

Implement GRPCRoute (GEP 1016) #1115

Merged
merged 1 commit into from Aug 2, 2022

Conversation

gnossen
Copy link
Contributor

@gnossen gnossen commented Apr 14, 2022

What type of PR is this?
/kind feature
/kind api-change

What this PR does / why we need it:

Fixes #1016

Does this PR introduce a user-facing change?:

Introduce GRPCRoute resource.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 14, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @gnossen. 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 the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 14, 2022
@gnossen gnossen changed the title Implement grpc route Implement GRPCRoute Apr 14, 2022
@robscott
Copy link
Member

/ok-to-test

@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. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 18, 2022
@robscott robscott added this to the v0.6.0 milestone May 23, 2022
Copy link
Contributor

@markmc markmc left a comment

Choose a reason for hiding this comment

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

One other comment - it would be good to squash the commits (it's all one logical change, unless you wanted to have the autogen stuff in a separate commit) and at least add to the commit message the GEP number you're implementing

Just trying to smooth the way to merging. HTH

apis/v1alpha2/grpcroute_types.go Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Outdated Show resolved Hide resolved
Service *string `json:"service,omitempty"`

// Value of the method to match against. If left empty or omitted, will
// match all services.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should empty/omitted match all only if Type=Exact?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. The behavior of our prototype implementation will match all regardless of the value of type.

However, I don't feel strongly about this, if you have a compelling reason to match all only when Type=Exact.

apis/v1alpha2/grpcroute_types.go Outdated Show resolved Hide resolved
// implementation must raise an 'Accepted' condition with a status of
// 'False' in the corresponding RouteParentStatus.
//
// Support: Core
Copy link
Contributor

Choose a reason for hiding this comment

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

Just thinking about what it means for GRPC specific stuff to be marked as Core if GRPCRoute itself is Extended

Referring to: https://gateway-api.sigs.k8s.io/concepts/guidelines/#overlapping-support-levels

Since these fields are never embedded in a struct with Core support level, then these fields can never be Core?

So ... it's just a nod to "when GRPCRoute becomes Core, some fields will be Core and some will be Extended" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the idea here is that this feature is Core to the GRPCRoute feature. Independent of that, GRPCRoute is extended relative to the Gateway API. There was previously a discussion on that topic here.

apis/v1alpha2/grpcroute_types.go Outdated Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Outdated Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Outdated Show resolved Hide resolved
hack/update-codegen.sh Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 8, 2022
@gnossen
Copy link
Contributor Author

gnossen commented Jun 13, 2022

@markmc Thanks for the review. Sorry for the turnaround time on the response.

As for squashing, that's going to be a little more difficult now that I've merged master in. Is it not possible to enable auto-squashing on the repo if that is the preferred commit history style?

@gnossen gnossen changed the title Implement GRPCRoute Implement GRPCRoute (GEP 1016) Jun 13, 2022
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 18, 2022
@gnossen gnossen force-pushed the implement_grpc_route branch 2 times, most recently from 63f956f to bf3d3e0 Compare July 18, 2022 22:15
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 18, 2022
Copy link
Contributor

@youngnick youngnick left a comment

Choose a reason for hiding this comment

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

Mostly looks LGTM, but I think we need to backport some of the changes we made to HTTPRoute for v0.5.0 about BackendRefs. I'm not one hundred percent sure the semantics are the same for GRPCRoute, but we need to review at least.

apis/v1alpha2/httproute_types.go Outdated Show resolved Hide resolved
apis/v1alpha2/shared_types.go Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Outdated Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Outdated Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Outdated Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Outdated Show resolved Hide resolved
Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks @gnossen! This mostly LGTM.

apis/v1alpha2/httproute_types.go Outdated Show resolved Hide resolved
apis/v1alpha2/httproute_types.go Outdated Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Outdated Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Outdated Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Outdated Show resolved Hide resolved
apis/v1alpha2/grpcroute_types.go Outdated Show resolved Hide resolved
@gnossen
Copy link
Contributor Author

gnossen commented Jul 25, 2022

Is there no leeway for implementations that don't support upgrades over plain text but do support HTTP/2?

@hbagdi I'm not sure why I'm not able to respond to this comment directly, so I'm responding here.

I'm thinking this must be a typo? The spec requires that implementations supporting GRPCRoute with the HTTP protocol type support HTTP/2 without an upgrade. An implementation as in your comment is absolutely conformant to the current spec as written.

I'm guessing you meant

Is there no leeway for implementations that only support HTTP/2 over plain text with an upgrade from HTTP/1 but do support HTTP/2?

If so, the answer is "not really." AFAIK, this would not be useful to any of the existing gRPC clients and servers in the wild. It would more or less be a broken implementation.

@gnossen gnossen force-pushed the implement_grpc_route branch 3 times, most recently from bf23c5d to c88e329 Compare July 26, 2022 00:25
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 26, 2022
@robscott
Copy link
Member

Hey @gnossen I think this is good to merge, do you mind running make generate again with go 1.19rc2? Kubernetes updated it's test infra a couple days ago which means we needed to update our codegen: #1288

@gnossen
Copy link
Contributor Author

gnossen commented Jul 29, 2022

Hey @gnossen I think this is good to merge, do you mind running make generate again with go 1.19rc2? Kubernetes updated it's test infra a couple days ago which means we needed to update our codegen: #1288

Done

@robscott
Copy link
Member

robscott commented Aug 1, 2022

@gnossen Actually one more step - it looks like this needs a rebase + make generate run to get presubmits to pass. (This is because of a conflict with #1276).

@robscott
Copy link
Member

robscott commented Aug 2, 2022

Thanks for all the work on this @gnossen! Discussed at community meeting today and there were no concerns about merging this in. Will plan to merge this at some point tomorrow unless else someone LGTMs before then (that's also welcome).

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gnossen, robscott

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 2, 2022
@shaneutt
Copy link
Member

shaneutt commented Aug 2, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 2, 2022
@k8s-ci-robot k8s-ci-robot merged commit 9a08f65 into kubernetes-sigs:main Aug 2, 2022
@gnossen gnossen deleted the implement_grpc_route branch August 2, 2022 17:09
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/feature Categorizes issue or PR as related to a new feature. 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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GEP: GRPCRoute
8 participants