Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
f24d27b
ir: add BackendCluster and BackendClusterRef types
muwaqar Jun 12, 2026
b0a3b87
gatewayapi: populate BackendClusterRefs alongside Settings at all con…
muwaqar Jun 12, 2026
4710fe3
ir: move Has* methods to BackendCluster, update NeedsClusterPerSetting
muwaqar Jun 15, 2026
f741b67
xds: switch cluster building to use BackendCluster
muwaqar Jun 15, 2026
4a702d4
ir: add ToBackendWeights to BackendCluster, enforce multi-ref invaria…
muwaqar Jun 15, 2026
af3bdbc
xds: switch route action builder to use BackendClusters
muwaqar Jun 15, 2026
990a7ac
xds: switch ext service and auth/logging readers to use BackendClusters
muwaqar Jun 15, 2026
616668e
gatewayapi: switch remaining Settings readers to use BackendClusters
muwaqar Jun 15, 2026
afc6b85
ir/gatewayapi: eliminate remaining Settings-only usage, reuse Backend…
muwaqar Jun 16, 2026
3a68e32
ir: remove unused Xds.Backends field
muwaqar Jun 16, 2026
c199136
gatewayapi: dedupe route BackendClusters across all route types
muwaqar Jun 16, 2026
a169a8b
ir: add Xds.Backends registry and BackendClusterRef.Name (additive)
muwaqar Jul 9, 2026
2ffdc47
gatewayapi: register route-kind BackendClusters into Xds.Backends
muwaqar Jul 9, 2026
1de1f2d
gatewayapi: register remaining non-route BackendClusters into Xds.Bac…
muwaqar Jul 9, 2026
6785366
gatewayapi: resolve OIDC provider TLS from constructed cluster, not G…
muwaqar Jul 9, 2026
2a1f682
xds/translator: add name-keyed BackendCluster registry index
muwaqar Jul 9, 2026
b3b9aa2
xds/translator: resolve BackendClusters via registry index instead of…
muwaqar Jul 9, 2026
242bd41
ir: remove BackendCluster-embedding methods now that consumers resolv…
muwaqar Jul 9, 2026
3ee2979
ir: remove BackendClusterRef.Backend — routes now hold only a name in…
muwaqar Jul 9, 2026
0a7f98c
gatewayapi: drop always-nil weight/filters params from registerBacken…
muwaqar Jul 9, 2026
9d797b0
xds/translator: fix ext-service JWT/OIDC cluster guard defeated by Ge…
muwaqar Jul 9, 2026
f99b63a
gatewayapi: exclude route-level BackendTrafficPolicy cluster settings…
muwaqar Jul 9, 2026
d3c35df
gatewayapi: never merge dynamic-resolver or custom backends in MergeB…
muwaqar Jul 9, 2026
61bbc25
gatewayapi: exclude SessionPersistence multi-backend HTTP rules from …
muwaqar Jul 9, 2026
f3a90a3
api: expose MergeBackends via EnvoyProxy CRD
muwaqar Jul 9, 2026
79d9479
gatewayapi: scope route-scoped BackendClusterKey by gateway, verify X…
muwaqar Jul 9, 2026
0fc6adb
gatewayapi: remove stale Backends ignore from TestTranslateWithExtens…
muwaqar Jul 9, 2026
5bb98ec
ir: denormalize IsDynamicResolver and ResolvedMetricSink.Backends
muwaqar Jul 10, 2026
4f64d96
gatewayapi: regenerate golden files for IsDynamicResolver/Backends fi…
muwaqar Jul 10, 2026
8300ad5
ir: enable BackendClusterRefs json/yaml serialization
muwaqar Jul 10, 2026
9d224b5
xds/translator: check BackendClusterRefs instead of Settings in jwt/o…
muwaqar Jul 10, 2026
4191087
gatewayapi: dedupe BackendClusterRefs per rule, stop setting removed …
muwaqar Jul 10, 2026
9bce423
ir: remove RouteDestination.Settings, BackendClusterRefs is now the s…
muwaqar Jul 10, 2026
38fa146
gatewayapi: remove dead destSettings accumulation in TLS/UDP/TCP rout…
muwaqar Jul 10, 2026
7da7da7
gatewayapi,egctl: remove stale BackendClusterRefs comparison ignores
muwaqar Jul 10, 2026
88e4f0a
gatewayapi: fix stale yaml:"-" tag comment in merge_backend_test.go
muwaqar Jul 10, 2026
918206d
gatewayapi: scope route-level BackendClusterKey by parentRef listener
muwaqar Jul 10, 2026
95f2a48
gatewayapi: give malformed duplicate-named httproute test fixtures un…
muwaqar Jul 10, 2026
a930524
gatewayapi: move merge-backend tests to their function's test file
muwaqar Jul 10, 2026
1bc3933
testdata: regenerate golden files for BackendClusterRefs migration
muwaqar Jul 10, 2026
a25c760
testdata: migrate new post-rebase fixtures, regenerate golden files
muwaqar Jul 10, 2026
869a999
gatewayapi,ir,xds: trim over-detailed comments from the backend-clust…
muwaqar Jul 10, 2026
6329669
xds/translator: move cluster-per-setting/weight helpers out of backen…
muwaqar Jul 10, 2026
67773fc
docs,helm: regenerate API reference and CRD test fixtures for MergeBa…
muwaqar Jul 11, 2026
4b8a847
gatewayapi,infra,test: fix lint issues (hugeParam, unconvert, gofumpt…
muwaqar Jul 11, 2026
1942af3
docs: add release note for MergeBackends (#9477)
muwaqar Jul 11, 2026
bdfda86
gatewayapi: scope merged BackendClusterKey by resolved protocol
muwaqar Jul 11, 2026
c7bfcbf
gatewayapi: sync merged setting name and add cross-protocol test cove…
muwaqar Jul 11, 2026
c1e7fc6
gatewayapi: exclude ConsistentHash-routed multi-backend rules from Me…
muwaqar Jul 11, 2026
c71751a
gatewayapi: respect BTP precedence overrides in BTPLoadBalancerIndex
muwaqar Jul 11, 2026
52c5a00
gatewayapi: consolidate merge-eligibility and naming logic into shoul…
muwaqar Jul 11, 2026
8e80c16
gatewayapi: exclude fallback-backend rules from MergeBackends
muwaqar Jul 11, 2026
afaac2b
gatewayapi: extract per-rule mergeIncompatible computation into a sha…
muwaqar Jul 11, 2026
d64d1cf
gatewayapi: exclude CredentialInjection-filtered backendRefs from Mer…
muwaqar Jul 11, 2026
695ec13
gatewayapi: move merge-check functions together and clarify shouldMer…
muwaqar Jul 11, 2026
562059e
ci: add merge-backends conformance profile
muwaqar Jul 11, 2026
d27c556
gatewayapi: fix golangci-lint findings in route_test.go
muwaqar Jul 11, 2026
c98a455
gatewayapi: exclude UseClientProtocol-configured routes from MergeBac…
muwaqar Jul 11, 2026
ce581b7
ir,gatewayapi,xds/translator: stop leaking an arbitrary route's hostn…
muwaqar Jul 11, 2026
213c27f
xds/translator: reference the resolved cluster name in HTTP RouteActions
muwaqar Jul 12, 2026
e305e28
xds/translator,gatewayapi: fix TCP/UDP cluster names, guard TCP/UDP/T…
muwaqar Jul 12, 2026
d3ab553
gatewayapi,ir: exclude any per-backendRef Filters, not just Credentia…
muwaqar Jul 12, 2026
845c966
gatewayapi: add golden fixture for RoutingType-divergence demerge
muwaqar Jul 12, 2026
00c34da
ir,xds/translator: remove dead BackendWeights.Name field
muwaqar Jul 12, 2026
ae3b069
xds/translator,gatewayapi: add TLS/GRPC/weighted-path xds-layer cover…
muwaqar Jul 12, 2026
0d93ee0
gatewayapi,ir,xds/translator: naming and comment cleanup from code re…
muwaqar Jul 12, 2026
c6acc30
xds/translator: migrate http-route-https-mtls-allow-expired-cert fixt…
muwaqar Jul 13, 2026
a99c8f7
gatewayapi: add unit test coverage for IsMergeBackendsEnabled
muwaqar Jul 13, 2026
c0357f0
xds/translator: stop leaking a route's stat name into a merged cluster
muwaqar Jul 13, 2026
24095d3
gatewayapi: include AdmissionControl in cluster-scoped BTP field check
muwaqar Jul 13, 2026
fb31053
xds/translator: resolve weighted-route weight per-route for merged cl…
muwaqar Jul 13, 2026
367ac61
gatewayapi: key BTP cluster-settings/load-balancer indexes by target …
muwaqar Jul 13, 2026
eb0e668
gatewayapi: honor a Gateway-level EnvoyProxy's MergeBackends override
muwaqar Jul 13, 2026
4dbe1a7
test/e2e: add MergeBackends conformance test
muwaqar Jul 13, 2026
6b57b37
ir: fix staticcheck ST1016 receiver name mismatch on BackendWeights
muwaqar Jul 17, 2026
4660e84
api: drop MergeBackendsConfig.Mode from the initial MergeBackends API
muwaqar Jul 17, 2026
fce36fd
gatewayapi: explain why HasRouteLevelClusterSettings skips gateway level
muwaqar Jul 17, 2026
7360d1a
xds/translator: dedupe client-certificate secrets by name
muwaqar Jul 17, 2026
be7dd73
gatewayapi: use the backend's own identity for a merged cluster's Met…
muwaqar Jul 17, 2026
fad3198
xds/translator: restore dropped route metadata on geoip-authorization…
muwaqar Jul 18, 2026
a91c822
gatewayapi: simplify BTPLoadBalancerIndex to gateway-level only
muwaqar Jul 18, 2026
1942609
gatewayapi: extract multi-backendRef merge checks into a named method
muwaqar Jul 18, 2026
1f84761
gatewayapi: key merged backend clusters by the owning Gateway's own i…
muwaqar Jul 18, 2026
0cf3762
test/e2e: add MergeGatewaysBackends conformance test
muwaqar Jul 18, 2026
fff4d8f
testdata: regenerate golden fixtures for tests merged in from main
muwaqar Jul 19, 2026
4ac0e28
ir: restore RouteDestination.Settings, make BackendCluster.Setting si…
muwaqar-cflt Jul 21, 2026
fb70d52
gatewayapi: bifurcate HTTP and GRPC rule processing on merge eligibility
muwaqar-cflt Jul 21, 2026
a195cf6
gatewayapi: track weight validity for every backendRef, not just non-…
muwaqar-cflt Jul 21, 2026
162f6d8
gatewayapi: bifurcate TLS, UDP, and TCP rule processing on merge elig…
muwaqar-cflt Jul 21, 2026
37ba0bc
gatewayapi: revert RequestMirror filter to pre-PR (mirror backends ne…
muwaqar-cflt Jul 21, 2026
95bee06
gatewayapi: revert telemetry sink backends (access log, tracing, metr…
muwaqar-cflt Jul 21, 2026
ff5bf69
gatewayapi: revert ext-service and global-resources backends to pre-PR
muwaqar-cflt Jul 21, 2026
96de30d
gatewayapi: simplify BackendClusterKey, lazily init BackendClusterMap…
muwaqar-cflt Jul 21, 2026
b60db70
xds/translator: replace unified backend resolution with merge-only re…
muwaqar-cflt Jul 21, 2026
e31b664
xds/translator: revert cluster building to pre-PR signatures, add add…
muwaqar-cflt Jul 21, 2026
15c4b5b
xds/translator: revert weighted-route-action building to pre-PR, add …
muwaqar-cflt Jul 21, 2026
38df198
gatewayapi,xds/translator: fix tests for the merge/non-merge bifurcation
muwaqar-cflt Jul 21, 2026
f1a2bce
xds/translator: revert incomplete Settings/BackendClusterRefs reverts…
muwaqar-cflt Jul 21, 2026
07c2af3
xds/translator: restore applyTraffic for merged HTTP clusters, droppe…
muwaqar-cflt Jul 21, 2026
13a4026
testdata: regenerate golden fixtures for the merge/non-merge bifurcation
muwaqar-cflt Jul 21, 2026
fbf08dd
gatewayapi,xds/translator: remove dead parameters and functions left …
muwaqar-cflt Jul 21, 2026
c84063d
gatewayapi: move BackendClusterMap above the BTP*Index fields in Tran…
muwaqar-cflt Jul 21, 2026
df01723
gatewayapi: skip building merge-eligibility BTP indexes when MergeBac…
muwaqar-cflt Jul 21, 2026
97ecb6d
ir,gatewayapi: remove RouteDestination.IsDynamicResolver and BackendC…
muwaqar-cflt Jul 21, 2026
fb72f29
ir: restore RouteDestination.Settings validation test coverage
muwaqar-cflt Jul 21, 2026
2783ae6
xds/types,ir: remove dead ResourceVersionTable.GetBackendClusters/Bac…
muwaqar-cflt Jul 21, 2026
467b7c6
xds/runner: revert test fixtures to construct destinations via Settings
muwaqar-cflt Jul 21, 2026
113524b
xds/translator: revert cosmetic style deviations in cluster.go/cluste…
muwaqar-cflt Jul 21, 2026
e283119
xds/translator: build merged backend clusters once via xdsIR.Backends…
muwaqar-cflt Jul 21, 2026
b9ada81
xds/translator: stop threading *Translator through functions that onl…
muwaqar-cflt Jul 21, 2026
3f8ac16
xds/translator: minimize diff vs main and drop dead/unnecessary test …
muwaqar-cflt Jul 21, 2026
68375fa
xds/translator: simplify buildXdsRouteAction and drop merge/non-merge…
muwaqar-cflt Jul 21, 2026
389a094
gatewayapi: minor comment/style cleanup in non-route.go MergeBackends…
muwaqar-cflt Jul 21, 2026
e1f5eb0
gatewayapi: consolidate BTP index building, address PR perf/naming fe…
muwaqar-cflt Jul 21, 2026
1bd087a
gatewayapi: route.go cleanup pass - drop backendClusterRefBuilder, fi…
muwaqar-cflt Jul 21, 2026
06b3510
gatewayapi: collapse ResolvedBackendCluster, defer merge-eligibility …
muwaqar-cflt Jul 21, 2026
c43029c
gatewayapi: move misplaced udpRoute single-rule comment to its var block
muwaqar-cflt Jul 21, 2026
bf1372b
infrastructure: fix gocritic rangeValCopy lint finding in ConvertReso…
muwaqar-cflt Jul 21, 2026
a16123c
gatewayapi: fix TLSRoute multi-rule merge eligibility to consider all…
muwaqar-cflt Jul 22, 2026
be123c1
gatewayapi: add CTPClusterSettingsIndex tracking listener-level HTTP1…
muwaqar-cflt Jul 22, 2026
8ff4e90
gatewayapi: build CTPClusterSettingsIndex once per Translate() call
muwaqar-cflt Jul 22, 2026
355ef9d
testdata: add fixture reproducing the CTP HTTP1 MergeBackends leak
muwaqar-cflt Jul 22, 2026
45feeae
gatewayapi: disqualify merging when a listener has a ClientTrafficPol…
muwaqar-cflt Jul 22, 2026
10fe778
testdata: regenerate golden fixture confirming CTP HTTP1 demerge fix
muwaqar-cflt Jul 22, 2026
2ac31c2
gatewayapi: add reflection-based exhaustiveness guard for CTP/BTP mer…
muwaqar-cflt Jul 22, 2026
6722048
gatewayapi,test: remove MergeGateways+MergeBackends combination support
muwaqar-cflt Jul 22, 2026
7c0a69e
api: enforce mergeGateways and mergeBackends are mutually exclusive v…
muwaqar-cflt Jul 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ jobs:
ipFamily: ipv4
profile: watch-namespaces
gwapiChannel: experimental
- version: v1.36.1
ipFamily: ipv4
profile: merge-backends
gwapiChannel: experimental
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: ./tools/github-actions/setup-deps
Expand Down
26 changes: 26 additions & 0 deletions api/v1alpha1/envoyproxy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type EnvoyProxy struct {
}

// EnvoyProxySpec defines the desired state of EnvoyProxy.
// +kubebuilder:validation:XValidation:message="mergeGateways and mergeBackends cannot both be enabled",rule="!(has(self.mergeGateways) && self.mergeGateways && has(self.mergeBackends) && has(self.mergeBackends.enabled) && self.mergeBackends.enabled)"
type EnvoyProxySpec struct {
// Provider defines the desired resource provider and provider-specific configuration.
// If unspecified, the "Kubernetes" resource provider is used with default configuration
Expand Down Expand Up @@ -89,9 +90,22 @@ type EnvoyProxySpec struct {
// This means that the port, protocol and hostname tuple must be unique for every listener.
// If a duplicate listener is detected, the newer listener (based on timestamp) will be rejected and its status will be updated with a "Accepted=False" condition.
//
// Mutually exclusive with MergeBackends.
//
// +optional
MergeGateways *bool `json:"mergeGateways,omitempty"`

// MergeBackends configures cluster deduplication: routes that reference the same backend
// share a single Envoy cluster instead of Envoy Gateway generating one cluster per route
// rule. This reduces xDS size, active health-check traffic, and stats cardinality, and
// improves upstream connection pooling.
//
// This is an experimental optimization and is disabled when unset. Mutually exclusive with
// MergeGateways.
//
// +optional
MergeBackends *MergeBackendsConfig `json:"mergeBackends,omitempty"`

// Shutdown defines configuration for graceful envoy shutdown process.
//
// +optional
Expand Down Expand Up @@ -218,6 +232,18 @@ type EnvoyProxySpec struct {
MergeType *MergeType `json:"mergeType,omitempty"`
}

// MergeBackendsConfig configures backend cluster deduplication (MergeBackends).
type MergeBackendsConfig struct {
// Enabled toggles whether cluster deduplication is considered at all. Defaults to false.
//
// A backendRef is only merged into a shared cluster when safe to do so; otherwise it falls
// back to a dedicated per-route cluster.
//
// +optional
// +kubebuilder:default=false
Enabled *bool `json:"enabled,omitempty"`

@zhaohuabing zhaohuabing Jul 17, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We may want to default this to true eventually. The fallback approach won't break current user-facing routing behaviors, and it helps with the Envoy memory issue.

It may be too risky to turn this on by default in 1.9, as it does break EPPs and extension servers, but we could keep it opt-in for the first release and consider flipping the default in 1.10 after we have more coverage and user feedback.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

resolving because not seeing an action item for now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's keep it unresolved for now, so other reviewer can see and discuss on this. cc @arkodg @guydc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this flag needed ? mergeBackends: {} should imply we are turning on the feature

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah, not necessarily. A bool flag is more explicit than mergeBackends: {}, I'm fine with both.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i like an explicit flag, mergeBackends: {} looks odd

}

// EnvoyProxyGeoIP defines shared GeoIP provider settings for EnvoyProxy.
type EnvoyProxyGeoIP struct {
// Provider defines the GeoIP provider configuration used by GeoIP filter instances.
Expand Down
25 changes: 25 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -778,12 +778,33 @@ spec:
- InsecureSyntax
- Disabled
type: string
mergeBackends:
description: |-
MergeBackends configures cluster deduplication: routes that reference the same backend
share a single Envoy cluster instead of Envoy Gateway generating one cluster per route
rule. This reduces xDS size, active health-check traffic, and stats cardinality, and
improves upstream connection pooling.

This is an experimental optimization and is disabled when unset. Mutually exclusive with
MergeGateways.
properties:
enabled:
default: false
description: |-
Enabled toggles whether cluster deduplication is considered at all. Defaults to false.

A backendRef is only merged into a shared cluster when safe to do so; otherwise it falls
back to a dedicated per-route cluster.
type: boolean
type: object
mergeGateways:
description: |-
MergeGateways defines if Gateway resources should be merged onto the same Envoy Proxy Infrastructure.
Setting this field to true would merge all Gateway Listeners under the parent Gateway Class.
This means that the port, protocol and hostname tuple must be unique for every listener.
If a duplicate listener is detected, the newer listener (based on timestamp) will be rejected and its status will be updated with a "Accepted=False" condition.

Mutually exclusive with MergeBackends.
type: boolean
mergeType:
description: |-
Expand Down Expand Up @@ -18112,6 +18133,10 @@ spec:
rule: '!(has(self.samplingRate) && has(self.samplingFraction))'
type: object
type: object
x-kubernetes-validations:
- message: mergeGateways and mergeBackends cannot both be enabled
rule: '!(has(self.mergeGateways) && self.mergeGateways && has(self.mergeBackends)
&& has(self.mergeBackends.enabled) && self.mergeBackends.enabled)'
status:
description: EnvoyProxyStatus defines the actual state of EnvoyProxy.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,12 +777,33 @@ spec:
- InsecureSyntax
- Disabled
type: string
mergeBackends:
description: |-
MergeBackends configures cluster deduplication: routes that reference the same backend
share a single Envoy cluster instead of Envoy Gateway generating one cluster per route
rule. This reduces xDS size, active health-check traffic, and stats cardinality, and
improves upstream connection pooling.

This is an experimental optimization and is disabled when unset. Mutually exclusive with
MergeGateways.
properties:
enabled:
default: false
description: |-
Enabled toggles whether cluster deduplication is considered at all. Defaults to false.

A backendRef is only merged into a shared cluster when safe to do so; otherwise it falls
back to a dedicated per-route cluster.
type: boolean
type: object
mergeGateways:
description: |-
MergeGateways defines if Gateway resources should be merged onto the same Envoy Proxy Infrastructure.
Setting this field to true would merge all Gateway Listeners under the parent Gateway Class.
This means that the port, protocol and hostname tuple must be unique for every listener.
If a duplicate listener is detected, the newer listener (based on timestamp) will be rejected and its status will be updated with a "Accepted=False" condition.

Mutually exclusive with MergeBackends.
type: boolean
mergeType:
description: |-
Expand Down Expand Up @@ -18111,6 +18132,10 @@ spec:
rule: '!(has(self.samplingRate) && has(self.samplingFraction))'
type: object
type: object
x-kubernetes-validations:
- message: mergeGateways and mergeBackends cannot both be enabled
rule: '!(has(self.mergeGateways) && self.mergeGateways && has(self.mergeBackends)
&& has(self.mergeBackends.enabled) && self.mergeBackends.enabled)'
status:
description: EnvoyProxyStatus defines the actual state of EnvoyProxy.
properties:
Expand Down
Loading
Loading