Skip to content

Commit

Permalink
fix: tcp listener is rejected when no route attached (#4681)
Browse files Browse the repository at this point in the history
* fix: tcp listener is rejected when no route attached

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>

* change cluter name

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>

* fix listener connection limit test

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>

* fix listener connetcp keepalive  test

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>

* fix tcp endpoint stats test

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>

* fix tcp-route-enable-req-resp-sizes-stats

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>

* fix extensionpolicy-tcp-udp-http test

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>

* fix lint

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>

---------

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
  • Loading branch information
zhaohuabing authored Nov 20, 2024
1 parent 8a01dd6 commit f99c36c
Show file tree
Hide file tree
Showing 28 changed files with 506 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ http:
escapedSlashesAction: UnescapeAndRedirect
mergeSlashes: true
port: 10080
routes:
- name: "http-route"
hostname: "*"
destination:
name: "http-route-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
tcp:
- address: 0.0.0.0
extensionRefs:
Expand Down Expand Up @@ -66,6 +75,13 @@ tcp:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
name: envoy-gateway/gateway-1/tcp1
port: 10080
routes:
- destination:
name: "tcp-route-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
udp:
- address: 0.0.0.0
route:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,28 @@ tcp:
connection:
limit:
value: 3
tls:
passthrough:
snis:
- bar.com
destination:
name: "tls-route-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
routes:
- tls:
inspector:
snis:
- bar.com
destination:
name: "tls-route-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
- name: "fourth-listener"
address: "0.0.0.0"
connection:
limit:
value: 10
closeDelay: 3s
port: 10083
destination:
name: "tcp-route-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
routes:
- destination:
name: "tcp-route-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,26 @@ tcp:
address: "0.0.0.0"
port: 10082
tcpKeepalive: {}
tls:
inspector:
snis:
- bar.com
destination:
name: "tls-route-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
routes:
- tls:
inspector:
snis:
- bar.com
destination:
name: "tls-route-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
- name: "fourth-listener"
address: "0.0.0.0"
tcpKeepalive:
probes: 10
port: 10083
destination:
name: "tcp-route-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
routes:
- destination:
name: "tcp-route-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
tcp:
- address: 0.0.0.0
connection:
bufferLimit: 50000000
limit:
closeDelay: 10s
value: 3
enableProxyProtocol: true
name: envoy-gateway/gateway-1/tls-1
port: 10443
tcpKeepalive:
idleTime: 1200
interval: 60
probes: 3
timeout:
tcp:
idleTimeout: 20m0s
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ tcp:
- name: "tcp-route-enable-endpoint-stats"
address: "0.0.0.0"
port: 10080
destination:
name: "tcp-route-simple-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
- host: "5.6.7.8"
port: 50001
routes:
- destination:
name: "tcp-route-simple-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
- host: "5.6.7.8"
port: 50001
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ tcp:
- name: "tcp-route-enable-req-resp-sizes-stats"
address: "0.0.0.0"
port: 10080
destination:
name: "tcp-route-simple-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
- host: "5.6.7.8"
port: 50001
routes:
- destination:
name: "tcp-route-simple-dest"
settings:
- endpoints:
- host: "1.2.3.4"
port: 50000
- host: "5.6.7.8"
port: 50001
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
- circuitBreakers:
thresholds:
- maxRetries: 1024
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
resourceApiVersion: V3
serviceName: http-route-dest
ignoreHealthOnHostRemoval: true
lbPolicy: LEAST_REQUEST
name: http-route-dest
outlierDetection: {}
perConnectionBufferLimitBytes: 32768
type: EDS
- circuitBreakers:
thresholds:
- maxRetries: 1024
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
resourceApiVersion: V3
serviceName: tcp-route-dest
ignoreHealthOnHostRemoval: true
lbPolicy: LEAST_REQUEST
name: tcp-route-dest
outlierDetection: {}
perConnectionBufferLimitBytes: 32768
type: EDS
- circuitBreakers:
thresholds:
- maxRetries: 1024
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
- clusterName: http-route-dest
endpoints:
- lbEndpoints:
- endpoint:
address:
socketAddress:
address: 1.2.3.4
portValue: 50000
loadBalancingWeight: 1
loadBalancingWeight: 1
locality:
region: http-route-dest/backend/0
- clusterName: tcp-route-dest
endpoints:
- lbEndpoints:
- endpoint:
address:
socketAddress:
address: 1.2.3.4
portValue: 50000
loadBalancingWeight: 1
loadBalancingWeight: 1
locality:
region: tcp-route-dest/backend/0
- clusterName: udp-route-dest
endpoints:
- lbEndpoints:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
statPrefix: http-10080
useRemoteAddress: true
name: envoy-gateway/gateway-1/http1
filterChains:
- filters:
- name: envoy.filters.network.tcp_proxy
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tcp-route-dest
statPrefix: tcp-10080
name: envoy-gateway/gateway-1/http1
perConnectionBufferLimitBytes: 32768
statPrefix: envoy-gateway/gateway-1/http1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
- ignorePortInHostMatching: true
name: envoy-gateway/gateway-1/http1
virtualHosts:
- domains:
- '*'
name: envoy-gateway/gateway-1/http1/*
routes:
- match:
prefix: /
name: http-route
route:
cluster: http-route-dest
upgradeConfigs:
- upgradeType: websocket
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,39 @@
outlierDetection: {}
perConnectionBufferLimitBytes: 32768
type: EDS
- circuitBreakers:
thresholds:
- maxRetries: 1024
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
resourceApiVersion: V3
serviceName: tls-route-dest
ignoreHealthOnHostRemoval: true
lbPolicy: LEAST_REQUEST
name: tls-route-dest
outlierDetection: {}
perConnectionBufferLimitBytes: 32768
type: EDS
- circuitBreakers:
thresholds:
- maxRetries: 1024
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
resourceApiVersion: V3
serviceName: tcp-route-dest
ignoreHealthOnHostRemoval: true
lbPolicy: LEAST_REQUEST
name: tcp-route-dest
outlierDetection: {}
perConnectionBufferLimitBytes: 32768
type: EDS
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,27 @@
loadBalancingWeight: 1
locality:
region: second-route-dest/backend/0
- clusterName: tls-route-dest
endpoints:
- lbEndpoints:
- endpoint:
address:
socketAddress:
address: 1.2.3.4
portValue: 50000
loadBalancingWeight: 1
loadBalancingWeight: 1
locality:
region: tls-route-dest/backend/0
- clusterName: tcp-route-dest
endpoints:
- lbEndpoints:
- endpoint:
address:
socketAddress:
address: 1.2.3.4
portValue: 50000
loadBalancingWeight: 1
loadBalancingWeight: 1
locality:
region: tcp-route-dest/backend/0
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,43 @@
socketAddress:
address: 0.0.0.0
portValue: 10082
filterChains:
- filterChainMatch:
serverNames:
- bar.com
filters:
- name: envoy.filters.network.connection_limit
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.connection_limit.v3.ConnectionLimit
maxConnections: "3"
statPrefix: tls-passthrough-10082
- name: envoy.filters.network.tcp_proxy
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tls-route-dest
statPrefix: tls-passthrough-10082
listenerFilters:
- name: envoy.filters.listener.tls_inspector
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector
name: third-listener
perConnectionBufferLimitBytes: 32768
- address:
socketAddress:
address: 0.0.0.0
portValue: 10083
filterChains:
- filters:
- name: envoy.filters.network.connection_limit
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.connection_limit.v3.ConnectionLimit
delay: 3s
maxConnections: "10"
statPrefix: tcp-10083
- name: envoy.filters.network.tcp_proxy
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tcp-route-dest
statPrefix: tcp-10083
name: fourth-listener
perConnectionBufferLimitBytes: 32768
Loading

0 comments on commit f99c36c

Please sign in to comment.