Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ envoyProxyForGatewayClass:
address: 127.0.0.1
port_value: 19000
cluster_manager:
local_cluster_name: local_cluster
local_cluster_name: $(ENVOY_PROXY_INFRA_NAME)
node:
locality:
zone: $(ENVOY_SERVICE_ZONE)
Expand Down Expand Up @@ -97,7 +97,7 @@ envoyProxyForGatewayClass:
- connect_timeout: 10s
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local_cluster
cluster_name: $(ENVOY_PROXY_INFRA_NAME)
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -109,7 +109,7 @@ envoyProxyForGatewayClass:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: $(ENVOY_PROXY_INFRA_NAME)
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down Expand Up @@ -560,7 +560,7 @@ xds:
address: 127.0.0.1
portValue: 19000
clusterManager:
localClusterName: local_cluster
localClusterName: $(ENVOY_PROXY_INFRA_NAME)
dynamicResources:
adsConfig:
apiType: DELTA_GRPC
Expand Down Expand Up @@ -608,7 +608,7 @@ xds:
type: STATIC
- connectTimeout: 10s
loadAssignment:
clusterName: local_cluster
clusterName: $(ENVOY_PROXY_INFRA_NAME)
endpoints:
- lbEndpoints:
- endpoint:
Expand All @@ -620,7 +620,7 @@ xds:
loadBalancingWeight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: $(ENVOY_PROXY_INFRA_NAME)
type: STATIC
- connectTimeout: 10s
loadAssignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
},
"clusterManager": {
"localClusterName": "local_cluster"
"localClusterName": "$(ENVOY_PROXY_INFRA_NAME)"
},
"dynamicResources": {
"adsConfig": {
Expand Down Expand Up @@ -105,7 +105,7 @@
{
"connectTimeout": "10s",
"loadAssignment": {
"clusterName": "local_cluster",
"clusterName": "$(ENVOY_PROXY_INFRA_NAME)",
"endpoints": [
{
"lbEndpoints": [
Expand All @@ -128,7 +128,7 @@
}
]
},
"name": "local_cluster",
"name": "$(ENVOY_PROXY_INFRA_NAME)",
"type": "STATIC"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ xds:
address: 127.0.0.1
portValue: 19000
clusterManager:
localClusterName: local_cluster
localClusterName: $(ENVOY_PROXY_INFRA_NAME)
dynamicResources:
adsConfig:
apiType: DELTA_GRPC
Expand Down Expand Up @@ -62,7 +62,7 @@ xds:
type: STATIC
- connectTimeout: 10s
loadAssignment:
clusterName: local_cluster
clusterName: $(ENVOY_PROXY_INFRA_NAME)
endpoints:
- lbEndpoints:
- endpoint:
Expand All @@ -74,7 +74,7 @@ xds:
loadBalancingWeight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: $(ENVOY_PROXY_INFRA_NAME)
type: STATIC
- connectTimeout: 10s
loadAssignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ xds:
address: 127.0.0.1
portValue: 19000
clusterManager:
localClusterName: local_cluster
localClusterName: $(ENVOY_PROXY_INFRA_NAME)
dynamicResources:
adsConfig:
apiType: DELTA_GRPC
Expand Down Expand Up @@ -61,7 +61,7 @@ xds:
type: STATIC
- connectTimeout: 10s
loadAssignment:
clusterName: local_cluster
clusterName: $(ENVOY_PROXY_INFRA_NAME)
endpoints:
- lbEndpoints:
- endpoint:
Expand All @@ -73,7 +73,7 @@ xds:
loadBalancingWeight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: $(ENVOY_PROXY_INFRA_NAME)
type: STATIC
- connectTimeout: 10s
loadAssignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
},
"clusterManager": {
"localClusterName": "local_cluster"
"localClusterName": "$(ENVOY_PROXY_INFRA_NAME)"
},
"dynamicResources": {
"adsConfig": {
Expand Down Expand Up @@ -105,7 +105,7 @@
{
"connectTimeout": "10s",
"loadAssignment": {
"clusterName": "local_cluster",
"clusterName": "$(ENVOY_PROXY_INFRA_NAME)",
"endpoints": [
{
"lbEndpoints": [
Expand All @@ -128,7 +128,7 @@
}
]
},
"name": "local_cluster",
"name": "$(ENVOY_PROXY_INFRA_NAME)",
"type": "STATIC"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ xds:
address: 127.0.0.1
portValue: 19000
clusterManager:
localClusterName: local_cluster
localClusterName: $(ENVOY_PROXY_INFRA_NAME)
dynamicResources:
adsConfig:
apiType: DELTA_GRPC
Expand Down Expand Up @@ -62,7 +62,7 @@ xds:
type: STATIC
- connectTimeout: 10s
loadAssignment:
clusterName: local_cluster
clusterName: $(ENVOY_PROXY_INFRA_NAME)
endpoints:
- lbEndpoints:
- endpoint:
Expand All @@ -74,7 +74,7 @@ xds:
loadBalancingWeight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: $(ENVOY_PROXY_INFRA_NAME)
type: STATIC
- connectTimeout: 10s
loadAssignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ xds:
address: 127.0.0.1
portValue: 19000
clusterManager:
localClusterName: local_cluster
localClusterName: $(ENVOY_PROXY_INFRA_NAME)
dynamicResources:
adsConfig:
apiType: DELTA_GRPC
Expand Down Expand Up @@ -61,7 +61,7 @@ xds:
type: STATIC
- connectTimeout: 10s
loadAssignment:
clusterName: local_cluster
clusterName: $(ENVOY_PROXY_INFRA_NAME)
endpoints:
- lbEndpoints:
- endpoint:
Expand All @@ -73,7 +73,7 @@ xds:
loadBalancingWeight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: $(ENVOY_PROXY_INFRA_NAME)
type: STATIC
- connectTimeout: 10s
loadAssignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ xds:
address: 127.0.0.1
portValue: 19000
clusterManager:
localClusterName: local_cluster
localClusterName: $(ENVOY_PROXY_INFRA_NAME)
dynamicResources:
adsConfig:
apiType: DELTA_GRPC
Expand Down Expand Up @@ -62,7 +62,7 @@ xds:
type: STATIC
- connectTimeout: 10s
loadAssignment:
clusterName: local_cluster
clusterName: $(ENVOY_PROXY_INFRA_NAME)
endpoints:
- lbEndpoints:
- endpoint:
Expand All @@ -74,7 +74,7 @@ xds:
loadBalancingWeight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: $(ENVOY_PROXY_INFRA_NAME)
type: STATIC
- connectTimeout: 10s
loadAssignment:
Expand Down
12 changes: 9 additions & 3 deletions internal/infrastructure/kubernetes/proxy/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const (
envoyPodEnvVar = "ENVOY_POD_NAME"
// envoyZoneEnvVar is the Envoy pod locality zone name
envoyZoneEnvVar = "ENVOY_SERVICE_ZONE"
// envoyInfraNameEnvVar is the name of the envoy proxy infrastructure
envoyInfraNameEnvVar = "ENVOY_PROXY_INFRA_NAME"
)

// ExpectedResourceHashedName returns expected resource hashed name including up to the 48 characters of the original name.
Expand Down Expand Up @@ -128,7 +130,7 @@ func expectedProxyContainers(infra *ir.ProxyInfra,
ImagePullPolicy: corev1.PullIfNotPresent,
Command: []string{"envoy"},
Args: args,
Env: expectedContainerEnv(containerSpec),
Env: expectedContainerEnv(infra, containerSpec),
Resources: *containerSpec.Resources,
SecurityContext: expectedEnvoySecurityContext(containerSpec),
Ports: ports,
Expand Down Expand Up @@ -190,7 +192,7 @@ func expectedProxyContainers(infra *ir.ProxyInfra,
ImagePullPolicy: corev1.PullIfNotPresent,
Command: []string{"envoy-gateway"},
Args: expectedShutdownManagerArgs(shutdownConfig),
Env: expectedContainerEnv(nil),
Env: expectedContainerEnv(infra, nil),
Resources: *egv1a1.DefaultShutdownManagerContainerResourceRequirements(),
TerminationMessagePolicy: corev1.TerminationMessageReadFile,
TerminationMessagePath: "/dev/termination-log",
Expand Down Expand Up @@ -400,7 +402,7 @@ func sdsConfigMapItems(gatewayNamespaceMode bool) []corev1.KeyToPath {
}

// expectedContainerEnv returns expected proxy container envs.
func expectedContainerEnv(containerSpec *egv1a1.KubernetesContainerSpec) []corev1.EnvVar {
func expectedContainerEnv(infra *ir.ProxyInfra, containerSpec *egv1a1.KubernetesContainerSpec) []corev1.EnvVar {
env := []corev1.EnvVar{
{
Name: envoyNsEnvVar,
Expand Down Expand Up @@ -429,6 +431,10 @@ func expectedContainerEnv(containerSpec *egv1a1.KubernetesContainerSpec) []corev
},
},
},
{
Name: envoyInfraNameEnvVar,
Value: ExpectedResourceHashedName(infra.Name),
},
}

if containerSpec != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.annotations['topology.kubernetes.io/zone']
- name: ENVOY_PROXY_INFRA_NAME
value: envoy-default-37a8eec1
image: docker.io/envoyproxy/envoy:distroless-dev
imagePullPolicy: IfNotPresent
lifecycle:
Expand Down Expand Up @@ -153,6 +155,8 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.annotations['topology.kubernetes.io/zone']
- name: ENVOY_PROXY_INFRA_NAME
value: envoy-default-37a8eec1
image: docker.io/envoyproxy/gateway-dev:latest
imagePullPolicy: IfNotPresent
lifecycle:
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: $(ENVOY_PROXY_INFRA_NAME)
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: $(ENVOY_PROXY_INFRA_NAME)
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -144,7 +144,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: $(ENVOY_PROXY_INFRA_NAME)
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down Expand Up @@ -232,6 +232,8 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.annotations['topology.kubernetes.io/zone']
- name: ENVOY_PROXY_INFRA_NAME
value: envoy-default-37a8eec1
image: envoyproxy/envoy:v1.2.3
imagePullPolicy: IfNotPresent
lifecycle:
Expand Down Expand Up @@ -313,6 +315,8 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.annotations['topology.kubernetes.io/zone']
- name: ENVOY_PROXY_INFRA_NAME
value: envoy-default-37a8eec1
image: docker.io/envoyproxy/gateway-dev:latest
imagePullPolicy: IfNotPresent
lifecycle:
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: $(ENVOY_PROXY_INFRA_NAME)
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: $(ENVOY_PROXY_INFRA_NAME)
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -143,7 +143,7 @@ spec:
load_balancing_weight: 1
locality:
zone: $(ENVOY_SERVICE_ZONE)
name: local_cluster
name: $(ENVOY_PROXY_INFRA_NAME)
type: STATIC
- connect_timeout: 10s
load_assignment:
Expand Down Expand Up @@ -231,6 +231,8 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.annotations['topology.kubernetes.io/zone']
- name: ENVOY_PROXY_INFRA_NAME
value: envoy-default-37a8eec1
image: envoyproxy/envoy:v1.2.3
imagePullPolicy: IfNotPresent
lifecycle:
Expand Down Expand Up @@ -312,6 +314,8 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.annotations['topology.kubernetes.io/zone']
- name: ENVOY_PROXY_INFRA_NAME
value: envoy-default-37a8eec1
image: docker.io/envoyproxy/gateway-dev:latest
imagePullPolicy: IfNotPresent
lifecycle:
Expand Down
Loading