-
Notifications
You must be signed in to change notification settings - Fork 584
api: add BackendConfigPolicy api for configuring envoy clusters #11214
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]>
…ckendconfig Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
comments on api fields Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
…ckendconfig 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]>
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
Introduce the BackendConfigPolicy API to allow configuring Envoy clusters by porting Gloo’s connection config.
- Extend clientset, CRDs, RBAC, and applyconfiguration to support BackendConfigPolicy resources.
- Add sample testdata, translation logic, and plugin implementation for Envoy cluster generation.
- Include unit tests for translation and header-format handling.
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
pkg/client/clientset/versioned/typed/api/v1alpha1/api_client.go | Add BackendConfigPolicies getter to clientset |
internal/kgateway/wellknown/kgw.go | Register GVK/GVR for BackendConfigPolicy |
internal/kgateway/setup/testdata/standard/backendconfigpolicy.yaml | Add sample BackendConfigPolicy input YAML |
internal/kgateway/setup/testdata/standard/backendconfigpolicy-out.yaml | Expected Envoy config output for policy |
internal/kgateway/extensions2/registry/registry.go | Register BackendConfigPolicy plugin |
internal/kgateway/extensions2/plugins/backendconfigpolicy/plugin.go | Implement policy translation and processing |
internal/kgateway/extensions2/plugins/backendconfigpolicy/plugin_test.go | Add unit tests for BackendConfigPolicy plugin |
install/helm/kgateway/templates/role.yaml | Update RBAC rules for BackendConfigPolicy |
install/helm/kgateway-crds/templates/gateway.kgateway.dev_backendconfigpolicies.yaml | Add CRD for BackendConfigPolicy |
api/v1alpha1/zz_generated.register.go | Register BackendConfigPolicy types |
api/v1alpha1/zz_generated.deepcopy.go | Autogen deepcopy funcs for BackendConfigPolicy |
api/v1alpha1/backend_config_policy_types.go | Define BackendConfigPolicy spec and status types |
api/applyconfiguration/utils.go | Support applyconfiguration for BackendConfigPolicy and related types |
Comments suppressed due to low confidence (1)
internal/kgateway/extensions2/plugins/backendconfigpolicy/plugin_test.go:44
- Consider adding a test case for the DropHeadersWithUnderscores action in CommonHttpProtocolOptions to verify it maps to HttpProtocolOptions_DROP_HEADER correctly.
HeadersWithUnderscoresAction: ptr.To(v1alpha1.AllowHeadersWithUnderscores),
internal/kgateway/extensions2/plugins/backendconfigpolicy/plugin.go
Outdated
Show resolved
Hide resolved
internal/kgateway/extensions2/plugins/backendconfigpolicy/plugin.go
Outdated
Show resolved
Hide resolved
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
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.
just a few nits but overall this looks really solid!
did you do any manual testing?
I don't think these types of config options warrant an e2e test but would be good to know that functional behavior was confirmed with a running envoy
internal/kgateway/extensions2/plugins/backendconfigpolicy/plugin.go
Outdated
Show resolved
Hide resolved
internal/kgateway/extensions2/plugins/backendconfigpolicy/plugin.go
Outdated
Show resolved
Hide resolved
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
@lgadban I did some manual testing to ensure envoy picks up the config ![]() |
internal/kgateway/extensions2/plugins/backendconfigpolicy/plugin.go
Outdated
Show resolved
Hide resolved
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
…ckendconfig Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
…ckendconfig Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
all the e2e tests are failing for some reason, might need to merge latest main? |
…ckendconfig Signed-off-by: omar <[email protected]>
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.
LGTM!
Looking at this with fresh eyes, I think we should add a happy path e2e test.
Maybe we can tackle this in the follow-up work for targetSelector support or when adding additional config to this API?
Description
Introduce BackendConfigPolicy api to allow configuring envoy clusters. This PR ports the connection config from gloo. This is part of the "policy parity" effort, to have same functionality as Gloo apis.
#11167
#11203
Change Type
Changelog
Additional Notes