-
Notifications
You must be signed in to change notification settings - Fork 630
backendconfigpolicy: http2 protocol options #11455
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
Conversation
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
…http2 protocol options (this means http2 backend). otherwise it is possible to set http2 protocol opts erroneously (e.g. common http protocol opts configured) Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
we should never call MutateHttpOptions as a "no-op" because it will create an invalid cluster with empty HttpProtocolOptions. so just check the backend is HTTP2 app protocol. Signed-off-by: omar <[email protected]>
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.
Pull Request Overview
This PR enhances the backend configuration policy to support HTTP/2 protocol options by exposing new configuration fields and translating them appropriately for Envoy. The key changes include:
- Adding translation functions and apply logic for HTTP/2 protocol options.
- Updating tests to cover HTTP/2 and non-HTTP/2 backends.
- Extending CRD schemas and apply configuration to support the new HTTP/2 options.
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/kgateway/translator/gateway/testutils/outputs/backendconfigpolicy/http2.yaml | Added output definitions for clusters with HTTP/2 protocol options. |
| internal/kgateway/translator/gateway/testutils/inputs/backendconfigpolicy/http2.yaml | Added test inputs including HTTP/2 and non-HTTP/2 cases. |
| internal/kgateway/translator/gateway/gateway_translator_test.go | Introduced new test entry for HTTP/2 protocol options. |
| internal/kgateway/extensions2/plugins/backendconfigpolicy/protocoloptions.go | Implemented translation and application functions for HTTP/2 options. |
| internal/kgateway/extensions2/plugins/backendconfigpolicy/plugin_test.go | Expanded tests covering proper handling of HTTP/2 options on backends. |
| internal/kgateway/extensions2/plugins/backendconfigpolicy/plugin.go | Registered and applied HTTP/2 protocol options in the backend process. |
| install/helm/kgateway-crds/templates/gateway.kgateway.dev_backendconfigpolicies.yaml | Updated CRD validation schema to include HTTP/2 protocol options. |
| api/v1alpha1/backend_config_policy_types.go | Defined the Http2ProtocolOptions structure and added related documentation. |
| api/applyconfiguration/* | Added apply configuration support for HTTP/2 protocol options. |
Comments suppressed due to low confidence (2)
internal/kgateway/extensions2/plugins/backendconfigpolicy/protocoloptions.go:79
- [nitpick] Consider adding a clarifying comment that explains the use of MilliValue() for converting resource.Quantity to bytes, to aid future maintainability and clarity.
out.InitialStreamWindowSize = &wrapperspb.UInt32Value{Value: uint32(http2ProtocolOptions.InitialStreamWindowSize.MilliValue())}
api/v1alpha1/backend_config_policy_types.go:141
- [nitpick] The comments mention a default value of 268435456 for InitialStreamWindowSize but the translation function does not apply a default. Either document that the default is applied elsewhere or consider applying it here.
type Http2ProtocolOptions struct {
Signed-off-by: omar <[email protected]>
| return | ||
| } | ||
|
|
||
| if backend.AppProtocol != ir.HTTP2AppProtocol { |
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.
relying on the backend AppProtocol to determine whether to apply the config.
this was simpler than inspecting the out cluster.
Also note that we can't use MutateHttpOptions to inspect the cluster because it will modify the cluster when called
| backend: &ir.BackendObjectIR{}, | ||
| cluster: &clusterv3.Cluster{}, | ||
| want: &clusterv3.Cluster{}, | ||
| wantErr: false, |
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.
should there be an error in this case?
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.
processBackend doesn't return an error. Right now I only log a warning.
Signed-off-by: omar <[email protected]>
… options This is a follow-up to the kgateway-dev#11455 PR which introduced support for HTTP2 protocol options on the BCP API. Update the CEL validation used to enforce that http1 & http2 protocol options cannot be defined together via the new AtMostOneOf marker. Signed-off-by: timflannagan <[email protected]>
… options This is a follow-up to the kgateway-dev#11455 PR which introduced support for HTTP2 protocol options on the BCP API. Update the CEL validation used to enforce that http1 & http2 protocol options cannot be defined together via the new AtMostOneOf marker. Signed-off-by: timflannagan <[email protected]>
Description
As part of #11203, expose http2 protocol options.
This pr exposes:
This is implemented such that http2 protocol options will only be applied to "http2" backends. For non-http2 backends, a warning is logging when the backend is processed.
Change Type
/kind new_feature
Changelog
Additional Notes