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

Add gprcroute support to inbound policy API #12785

Merged
merged 21 commits into from
Jul 4, 2024
Merged

Add gprcroute support to inbound policy API #12785

merged 21 commits into from
Jul 4, 2024

Conversation

adleong
Copy link
Member

@adleong adleong commented Jun 27, 2024

We add support for grpcroute in the inbound policy API. When a Server resource has the proxy protocol set to grpc, we will now serve grpc as the protocol in the inbound policy API along with any GrpcRoutes which have been defined and attached to the Server. If grpc is specified as the proxy protocol but no GrpcRoutes are attached, we return a default catch-all grpc route.

adleong added 18 commits June 12, 2024 22:21
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
@adleong adleong requested a review from a team as a code owner June 27, 2024 23:00
Copy link
Member

@mateiidavid mateiidavid left a comment

Choose a reason for hiding this comment

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

Looks good and pretty straight to the point. I haven't tested this, fwiw. I like how nicely this slots in with the existing logic we have in the index and it seems like most of the logic is non contentious (wiring up another resource).

I did have a question about gRPC probes but I figured that'd be a non-goal for this change anyway. Besides, gRPC probes are a k8s 1.27 feature 🤷🏻 it'd probably be trivial to add it in later when the time comes.

Comment on lines +1851 to +1852
.filter(|(_, route)| route.selects_server(server_name))
.filter(|(_, route)| route.accepted_by_server(server_name))
Copy link
Member

Choose a reason for hiding this comment

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

would it make sense to collapse these two in the same line?

.filter(|(_, route)| route.selects_server(server_name) && route.accepted_by_server(server_name))

Comment on lines 383 to 388
fn reset_grpc_route(
&mut self,
routes: Vec<k8s_gateway_api::GrpcRoute>,
deleted: HashMap<String, HashSet<String>>,
) {
let _span = info_span!("gprcroute reset").entered();
Copy link
Member

Choose a reason for hiding this comment

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

tioli

Suggested change
fn reset_grpc_route(
&mut self,
routes: Vec<k8s_gateway_api::GrpcRoute>,
deleted: HashMap<String, HashSet<String>>,
) {
let _span = info_span!("gprcroute reset").entered();
#[tracing::instrument(skip_all)]
fn reset_grpc_route(
&mut self,
routes: Vec<k8s_gateway_api::GrpcRoute>,
deleted: HashMap<String, HashSet<String>>,
) {

adleong added 2 commits July 4, 2024 01:16
@adleong adleong merged commit 2142e7b into main Jul 4, 2024
27 checks passed
@adleong adleong deleted the alex/grpc-inbound branch July 4, 2024 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants