-
Notifications
You must be signed in to change notification settings - Fork 532
trafficpolicy: hash polices for hashing load balancers #11583
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
base: main
Are you sure you want to change the base?
Conversation
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
This PR adds support for defining and applying HTTP route-level hash policies (for RingHash and Maglev load balancers) via the TrafficPolicy API, wiring them through the CRD, apply-configuration, translator plugins, and integration tests.
- Introduce
HashPolicies
in the TrafficPolicy CRD and apply-configuration types - Implement
hashPolicyForSpec
to translate CRD hash policies into EnvoyRouteAction_HashPolicy
IR and wire it in the translator and merge logic - Update test utilities and add unit/integration tests for route-level hash policy translation
Reviewed Changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
api/v1alpha1/traffic_policy_types.go | Add HashPolicies field to TrafficPolicySpec |
api/applyconfiguration/api/v1alpha1/trafficpolicyspec.go | Extend apply-configuration to include HashPolicies |
api/applyconfiguration/utils.go | Register apply-configuration kinds for Cookie, Header, HashPolicy, SourceIP |
internal/kgateway/extensions2/plugins/trafficpolicy/hash_policy.go | Implement hashPolicyForSpec to build Envoy hash IR |
internal/kgateway/extensions2/plugins/trafficpolicy/traffic_policy_plugin.go | Wire hash policies into route generation and merging |
internal/kgateway/extensions2/plugins/trafficpolicy/builder.go | Invoke hashPolicyForSpec in the builder |
internal/kgateway/translator/gateway/testutils/inputs/loadbalancer/route.yaml | Add sample input for route-level hash policies |
internal/kgateway/translator/gateway/testutils/outputs/loadbalancer/route.yaml | Add expected Envoy config with hash policies |
internal/kgateway/translator/gateway/gateway_translator_test.go | Add integration test entry for route-level hash policy |
internal/kgateway/extensions2/plugins/trafficpolicy/hash_policy_test.go | Unit tests for hashPolicyForSpec |
install/helm/kgateway-crds/templates/gateway.kgateway.dev_trafficpolicies.yaml | Extend CRD schema for hash policies |
internal/kgateway/extensions2/plugins/trafficpolicy/hash_policy.go
Outdated
Show resolved
Hide resolved
…shpolicy Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
Description
#11457
In order to support hashing load balancers (ring hash and maglev) in BackendConfigPolicy, it is necessary to define the hash policy on the route.
This PR adds options on the TrafficPolicy to configure hash policy on a route. Currently only HTTPRoute as targetRef is supported (Gateway is not supported).
Change Type
/kind new_feature
Changelog
Additional Notes