Skip to content
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

feat(translator): prefix TCP FilterChain name by irListener name #3738

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
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
8a78c59
Prefix TCP FilterChain name by irListener name
aoledk Jul 3, 2024
7d9c643
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Jul 3, 2024
ecf06d2
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Jul 5, 2024
52b7fcf
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Jul 12, 2024
4c677f9
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Jul 15, 2024
4103a4c
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Jul 22, 2024
358cccd
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Jul 23, 2024
0aa91a1
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Jul 26, 2024
2672970
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Jul 29, 2024
c94790c
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Jul 30, 2024
9109d82
prefix ir tcp/udp route name with ir listener name
aoledk Jul 30, 2024
7e8d424
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Jul 30, 2024
ee5753f
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Jul 31, 2024
79030d2
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Aug 2, 2024
1bf519d
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Aug 5, 2024
0f2e774
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Aug 6, 2024
e15386f
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Aug 6, 2024
956d887
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Aug 7, 2024
562df20
Merge branch 'main' into prefix-tcp-filter-chain-name-by-listener-name
aoledk Aug 15, 2024
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 @@ -1029,7 +1029,7 @@ xds:
path: /dev/stdout
cluster: tcproute/default/backend/rule/-1
statPrefix: tcp
name: tcproute/default/backend
name: default/eg/tcp/tcproute/default/backend
name: default/eg/tcp
perConnectionBufferLimitBytes: 32768
- activeState:
Expand Down Expand Up @@ -1072,7 +1072,7 @@ xds:
path: /dev/stdout
cluster: tlsroute/default/backend/rule/-1
statPrefix: passthrough
name: tlsroute/default/backend
name: default/eg/tls-passthrough/tlsroute/default/backend
listenerFilters:
- name: envoy.filters.listener.tls_inspector
typedConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@
}
}
],
"name": "tcproute/default/backend"
"name": "default/eg/tcp/tcproute/default/backend"
}
],
"name": "default/eg/tcp",
Expand Down Expand Up @@ -929,7 +929,7 @@
}
}
],
"name": "tlsroute/default/backend"
"name": "default/eg/tls-passthrough/tlsroute/default/backend"
}
],
"listenerFilters": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ xds:
path: /dev/stdout
cluster: tcproute/default/backend/rule/-1
statPrefix: tcp
name: tcproute/default/backend
name: default/eg/tcp/tcproute/default/backend
name: default/eg/tcp
perConnectionBufferLimitBytes: 32768
- activeState:
Expand Down Expand Up @@ -553,7 +553,7 @@ xds:
path: /dev/stdout
cluster: tlsroute/default/backend/rule/-1
statPrefix: passthrough
name: tlsroute/default/backend
name: default/eg/tls-passthrough/tlsroute/default/backend
listenerFilters:
- name: envoy.filters.listener.tls_inspector
typedConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ xds:
path: /dev/stdout
cluster: tcproute/default/backend/rule/-1
statPrefix: tcp
name: tcproute/default/backend
name: default/eg/tcp/tcproute/default/backend
name: default/eg/tcp
perConnectionBufferLimitBytes: 32768
- activeState:
Expand Down Expand Up @@ -210,7 +210,7 @@ xds:
path: /dev/stdout
cluster: tlsroute/default/backend/rule/-1
statPrefix: passthrough
name: tlsroute/default/backend
name: default/eg/tls-passthrough/tlsroute/default/backend
listenerFilters:
- name: envoy.filters.listener.tls_inspector
typedConfig:
Expand Down
5 changes: 3 additions & 2 deletions internal/xds/translator/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package translator

import (
"errors"
"fmt"

xdscore "github.com/cncf/xds/go/xds/core/v3"
matcher "github.com/cncf/xds/go/xds/type/matcher/v3"
Expand Down Expand Up @@ -391,7 +392,7 @@ func findXdsHTTPRouteConfigName(xdsListener *listenerv3.Listener) string {
return ""
}

func addXdsTCPFilterChain(xdsListener *listenerv3.Listener, irRoute *ir.TCPRoute,
func addXdsTCPFilterChain(xdsListener *listenerv3.Listener, irListener *ir.TCPListener, irRoute *ir.TCPRoute,
clusterName string, accesslog *ir.AccessLog, timeout *ir.ClientTimeout,
connection *ir.ClientConnection,
) error {
Expand Down Expand Up @@ -444,7 +445,7 @@ func addXdsTCPFilterChain(xdsListener *listenerv3.Listener, irRoute *ir.TCPRoute

filterChain := &listenerv3.FilterChain{
Filters: filters,
Name: irRoute.Name,
Name: fmt.Sprintf("%s/%s", irListener.Name, irRoute.Name),
}

if isTLSPassthrough {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tcp-route-dest
statPrefix: tcp
name: tcp-route-dest
name: second-listener/tcp-route-dest
name: second-listener
perConnectionBufferLimitBytes: 1500
- address:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tcp-route-dest
statPrefix: tcp
name: tcp-route-dest
name: second-listener/tcp-route-dest
name: second-listener
perConnectionBufferLimitBytes: 1500
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
cluster: second-route-dest
idleTimeout: 1200s
statPrefix: tcp
name: second-route
name: second-listener/second-route
name: second-listener
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tls-route-dest
statPrefix: tcp
name: tcp-route-dest
name: second-listener/tcp-route-dest
listenerFilters:
- name: envoy.filters.listener.proxy_protocol
typedConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tcp-route-dest
statPrefix: passthrough
name: fifth-route
name: fifth-listener/fifth-route
- filterChainMatch:
serverNames:
- bar.net
Expand All @@ -137,7 +137,7 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tls-route-dest
statPrefix: passthrough
name: sixth-route
name: sixth-listener/sixth-route
listenerFilters:
- name: envoy.filters.listener.tls_inspector
typedConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tcp-route-simple-dest
statPrefix: tcp
name: tcp-route-simple
name: tcp-listener-simple/tcp-route-simple
- filters:
- name: envoy.filters.network.tcp_proxy
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tcp-route-simple-1-dest
statPrefix: tcp
name: tcp-route-simple-1
name: tcp-listener-simple-1/tcp-route-simple-1
- filters:
- name: envoy.filters.network.tcp_proxy
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tcp-route-simple-2-dest
statPrefix: tcp
name: tcp-route-simple-2
name: tcp-listener-simple-2/tcp-route-simple-2
- filters:
- name: envoy.filters.network.tcp_proxy
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tcp-route-simple-3-dest
statPrefix: tcp
name: tcp-route-simple-3
name: tcp-listener-simple-3/tcp-route-simple-3
- filters:
- name: envoy.filters.network.tcp_proxy
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tcp-route-simple-4-dest
statPrefix: tcp
name: tcp-route-simple-4
name: tcp-listener-simple-4/tcp-route-simple-4
name: tcp-listener-simple
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tls-terminate-dest
statPrefix: terminate
name: tls-route-terminate
name: second-listener/tls-route-terminate
transportSocket:
name: envoy.transport_sockets.tls
typedConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tls-terminate-dest
statPrefix: terminate
name: tls-route-terminate
name: second-listener/tls-route-terminate
transportSocket:
name: envoy.transport_sockets.tls
typedConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tcp-route-complex-dest
statPrefix: passthrough
name: tcp-route-complex
name: tcp-listener-complex/tcp-route-complex
listenerFilters:
- name: envoy.filters.listener.tls_inspector
typedConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tcp-route-simple-dest
statPrefix: tcp
name: tcp-route-simple
name: tcp-listener-simple/tcp-route-simple
name: tcp-listener-simple
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tls-terminate-dest
statPrefix: terminate
name: tls-route-terminate
name: tls-listener-terminate/tls-route-terminate
transportSocket:
name: envoy.transport_sockets.tls
typedConfig:
Expand All @@ -34,7 +34,7 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tls-terminate-hostname-dest
statPrefix: terminate
name: tls-terminate-hostname
name: tls-listener-terminate/tls-terminate-hostname
transportSocket:
name: envoy.transport_sockets.tls
typedConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tcp-route-weighted-backend-dest
statPrefix: passthrough
name: tcp-route-weighted-backend
name: tcp-listener-weighted-backend/tcp-route-weighted-backend
listenerFilters:
- name: envoy.filters.listener.tls_inspector
typedConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tls-passthrough-foo-dest
statPrefix: passthrough
name: tls-route-passthrough-foo
name: tls-passthrough-foo/tls-route-passthrough-foo
listenerFilters:
- name: envoy.filters.listener.tls_inspector
typedConfig:
Expand All @@ -35,7 +35,7 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tls-passthrough-bar-dest
statPrefix: passthrough
name: tls-route-passthrough-bar
name: tls-passthrough-bar/tls-route-passthrough-bar
listenerFilters:
- name: envoy.filters.listener.tls_inspector
typedConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: tls-terminate-dest
statPrefix: terminate
name: tls-route-terminate
name: second-listener/tls-route-terminate
transportSocket:
name: envoy.transport_sockets.tls
typedConfig:
Expand Down
2 changes: 1 addition & 1 deletion internal/xds/translator/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ func (t *Translator) processTCPListenerXdsTranslation(
}
}
}
if err := addXdsTCPFilterChain(xdsListener, route, route.Destination.Name, accesslog, tcpListener.Timeout, tcpListener.Connection); err != nil {
if err := addXdsTCPFilterChain(xdsListener, tcpListener, route, route.Destination.Name, accesslog, tcpListener.Timeout, tcpListener.Connection); err != nil {
errs = errors.Join(errs, err)
}
}
Expand Down
Loading