Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
fa7ba85
Use non-staic local_cluster name
jukie Jul 10, 2025
0df4727
Merge branch 'main' into split-impl-zone-aware-routing-local-cluster
jukie Jul 10, 2025
0baefa2
Merge branch 'main' into split-impl-zone-aware-routing-local-cluster
jukie Jul 10, 2025
dcd69eb
Merge branch 'main' into split-impl-zone-aware-routing-local-cluster
jukie Jul 11, 2025
0f43491
Merge branch 'main' into split-impl-zone-aware-routing-local-cluster
jukie Jul 16, 2025
3d0990d
Merge branch 'main' into split-impl-zone-aware-routing-local-cluster
jukie Jul 16, 2025
1a92f94
Merge branch 'main' into split-impl-zone-aware-routing-local-cluster
jukie Jul 16, 2025
49f1c6c
Merge branch 'main' into split-impl-zone-aware-routing-local-cluster
jukie Jul 17, 2025
a762a88
Merge branch 'main' into split-impl-zone-aware-routing-local-cluster
jukie Jul 20, 2025
cd52842
Merge branch 'main' into split-impl-zone-aware-routing-local-cluster
jukie Jul 21, 2025
00bc2b7
Merge branch 'main' into split-impl-zone-aware-routing-local-cluster
jukie Jul 23, 2025
ee50fbd
Pass as bootstrap value
jukie Jul 24, 2025
c4aecc6
Merge branch 'main' into split-impl-zone-aware-routing-local-cluster
jukie Jul 24, 2025
4008678
Adjust field name
jukie Jul 24, 2025
47b80d3
lint
jukie Jul 24, 2025
4a2f6fa
Use ServiceClusterName
jukie Jul 24, 2025
1fe8679
lint
jukie Jul 24, 2025
783a81f
Merge branch 'main' into split-impl-zone-aware-routing-local-cluster
jukie Jul 24, 2025
f99c795
Merge branch 'main' into split-impl-zone-aware-routing-local-cluster
jukie Jul 25, 2025
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
23 changes: 15 additions & 8 deletions internal/infrastructure/common/proxy_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ package common
import (
"fmt"

"k8s.io/utils/ptr"

egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
"github.com/envoyproxy/gateway/internal/ir"
"github.com/envoyproxy/gateway/internal/xds/bootstrap"
Expand All @@ -29,9 +31,19 @@ func BuildProxyArgs(
serviceNode string,
gatewayNamespaceMode bool,
) ([]string, error) {
// If IPFamily is not set, try to determine it from the infrastructure.
if bootstrapConfigOptions != nil && bootstrapConfigOptions.IPFamily == nil {
bootstrapConfigOptions.IPFamily = getIPFamily(infra)
serviceCluster := infra.Name
if gatewayNamespaceMode {
serviceCluster = fmt.Sprintf("%s/%s", infra.Namespace, infra.Name)
}

if bootstrapConfigOptions != nil {
// Configure local Envoy ServiceCluster
bootstrapConfigOptions.ServiceClusterName = ptr.To(serviceCluster)

// If IPFamily is not set, try to determine it from the infrastructure.
if bootstrapConfigOptions.IPFamily == nil {
bootstrapConfigOptions.IPFamily = getIPFamily(infra)
}
}

bootstrapConfigOptions.GatewayNamespaceMode = gatewayNamespaceMode
Expand All @@ -51,11 +63,6 @@ func BuildProxyArgs(

logging := infra.Config.Spec.Logging

serviceCluster := infra.Name
if gatewayNamespaceMode {
serviceCluster = fmt.Sprintf("%s/%s", infra.Namespace, infra.Name)
}

args := []string{
fmt.Sprintf("--service-cluster %s", serviceCluster),
fmt.Sprintf("--service-node %s", serviceNode),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: default
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -132,7 +132,7 @@ spec:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: default
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -144,7 +144,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: default
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: default
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -131,7 +131,7 @@ spec:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: default
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -143,7 +143,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: default
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: default
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -131,7 +131,7 @@ spec:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: default
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -143,7 +143,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: default
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: default
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -80,7 +80,7 @@ spec:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: default
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -92,7 +92,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: default
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: default
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -131,7 +131,7 @@ spec:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: default
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -143,7 +143,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: default
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: ns1/gateway-1
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -134,7 +134,7 @@ spec:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: ns1/gateway-1
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -146,7 +146,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: ns1/gateway-1
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ spec:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: default
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -140,7 +140,7 @@ spec:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: default
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -152,7 +152,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: default
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: default
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -131,7 +131,7 @@ spec:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: default
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -143,7 +143,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: default
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: default
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -131,7 +131,7 @@ spec:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: default
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -143,7 +143,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: default
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: default
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -131,7 +131,7 @@ spec:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: default
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -143,7 +143,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: default
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: default
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -131,7 +131,7 @@ spec:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: default
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -143,7 +143,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: default
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: default
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -136,7 +136,7 @@ spec:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: default
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -148,7 +148,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: default
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: default
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -131,7 +131,7 @@ spec:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: default
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -143,7 +143,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: default
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down
Loading