Skip to content

Commit

Permalink
feat(translator): Add names to filterchains based on the listener name (
Browse files Browse the repository at this point in the history
envoyproxy#3524)

* Add the listener name to each filter chain.

Signed-off-by: Lior Okman <lior.okman@sap.com>

* Update the egctl tests as well.

Signed-off-by: Lior Okman <lior.okman@sap.com>

* Also add the filterchain name from TCPRoutes

Signed-off-by: Lior Okman <lior.okman@sap.com>

---------

Signed-off-by: Lior Okman <lior.okman@sap.com>
  • Loading branch information
liorokman authored Jun 3, 2024
1 parent d2824e2 commit 3712659
Show file tree
Hide file tree
Showing 105 changed files with 160 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ xds:
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: default/eg/http
drainType: MODIFY_ONLY
name: default/eg/http
perConnectionBufferLimitBytes: 32768
Expand Down Expand Up @@ -932,6 +933,7 @@ xds:
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: default/eg/grpc
drainType: MODIFY_ONLY
name: default/eg/grpc
perConnectionBufferLimitBytes: 32768
Expand Down Expand Up @@ -972,6 +974,7 @@ xds:
path: /dev/stdout
cluster: tcproute/default/backend/rule/-1
statPrefix: tcp
name: tcproute/default/backend
name: default/eg/tcp
perConnectionBufferLimitBytes: 32768
- activeState:
Expand Down Expand Up @@ -1014,6 +1017,7 @@ xds:
path: /dev/stdout
cluster: tlsroute/default/backend/rule/-1
statPrefix: passthrough
name: 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 @@ -620,7 +620,8 @@
"useRemoteAddress": true
}
}
]
],
"name": "default/eg/http"
},
"drainType": "MODIFY_ONLY",
"name": "default/eg/http",
Expand Down Expand Up @@ -725,7 +726,8 @@
"useRemoteAddress": true
}
}
]
],
"name": "default/eg/grpc"
},
"drainType": "MODIFY_ONLY",
"name": "default/eg/grpc",
Expand Down Expand Up @@ -790,7 +792,8 @@
"statPrefix": "tcp"
}
}
]
],
"name": "tcproute/default/backend"
}
],
"name": "default/eg/tcp",
Expand Down Expand Up @@ -860,7 +863,8 @@
"statPrefix": "passthrough"
}
}
]
],
"name": "tlsroute/default/backend"
}
],
"listenerFilters": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ xds:
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: default/eg/http
drainType: MODIFY_ONLY
name: default/eg/http
perConnectionBufferLimitBytes: 32768
Expand Down Expand Up @@ -430,6 +431,7 @@ xds:
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: default/eg/grpc
drainType: MODIFY_ONLY
name: default/eg/grpc
perConnectionBufferLimitBytes: 32768
Expand Down Expand Up @@ -470,6 +472,7 @@ xds:
path: /dev/stdout
cluster: tcproute/default/backend/rule/-1
statPrefix: tcp
name: tcproute/default/backend
name: default/eg/tcp
perConnectionBufferLimitBytes: 32768
- activeState:
Expand Down Expand Up @@ -512,6 +515,7 @@ xds:
path: /dev/stdout
cluster: tlsroute/default/backend/rule/-1
statPrefix: passthrough
name: 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 @@ -58,6 +58,7 @@ xds:
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: default/eg/http
drainType: MODIFY_ONLY
name: default/eg/http
perConnectionBufferLimitBytes: 32768
Expand Down Expand Up @@ -125,6 +126,7 @@ xds:
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: default/eg/grpc
drainType: MODIFY_ONLY
name: default/eg/grpc
perConnectionBufferLimitBytes: 32768
Expand Down Expand Up @@ -165,6 +167,7 @@ xds:
path: /dev/stdout
cluster: tcproute/default/backend/rule/-1
statPrefix: tcp
name: tcproute/default/backend
name: default/eg/tcp
perConnectionBufferLimitBytes: 32768
- activeState:
Expand Down Expand Up @@ -207,6 +210,7 @@ xds:
path: /dev/stdout
cluster: tlsroute/default/backend/rule/-1
statPrefix: passthrough
name: 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 @@ -476,7 +476,8 @@
"useRemoteAddress": true
}
}
]
],
"name": "envoy-gateway-system/eg/http"
},
"drainType": "MODIFY_ONLY",
"name": "envoy-gateway-system/eg/http",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ xds:
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: envoy-gateway-system/eg/http
drainType: MODIFY_ONLY
name: envoy-gateway-system/eg/http
perConnectionBufferLimitBytes: 32768
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ xds:
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: envoy-gateway-system/eg/http
drainType: MODIFY_ONLY
name: envoy-gateway-system/eg/http
perConnectionBufferLimitBytes: 32768
2 changes: 2 additions & 0 deletions internal/xds/translator/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ func (t *Translator) addHCMToXDSListener(xdsListener *listenerv3.Listener, irLis

filterChain := &listenerv3.FilterChain{
Filters: filters,
Name: irListener.Name,
}

if irListener.TLS != nil {
Expand Down Expand Up @@ -440,6 +441,7 @@ func addXdsTCPFilterChain(xdsListener *listenerv3.Listener, irRoute *ir.TCPRoute

filterChain := &listenerv3.FilterChain{
Filters: filters,
Name: irRoute.Name,
}

if isTLSPassthrough {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: extension-listener
drainType: MODIFY_ONLY
name: extension-listener
perConnectionBufferLimitBytes: 32768
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: first-listener
drainType: MODIFY_ONLY
name: first-listener
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: policyextension-listener
drainType: MODIFY_ONLY
name: policyextension-listener
perConnectionBufferLimitBytes: 32768
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: first-listener
drainType: MODIFY_ONLY
name: first-listener
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: first-listener
drainType: MODIFY_ONLY
name: first-listener
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: first-listener
drainType: MODIFY_ONLY
name: first-listener
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: envoy-gateway/gateway-1/http
drainType: MODIFY_ONLY
name: envoy-gateway/gateway-1/http
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: first-listener
drainType: MODIFY_ONLY
name: first-listener
perConnectionBufferLimitBytes: 32768
Expand All @@ -44,6 +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
perConnectionBufferLimitBytes: 1500
- address:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: default/gateway-1/http
drainType: MODIFY_ONLY
name: default/gateway-1/http
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: first-listener
drainType: MODIFY_ONLY
name: first-listener
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: first-listener
drainType: MODIFY_ONLY
name: first-listener
perConnectionBufferLimitBytes: 1500
Expand All @@ -44,5 +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
perConnectionBufferLimitBytes: 1500
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
statPrefix: http
useRemoteAddress: true
xffNumTrustedHops: 2
name: first-listener
drainType: MODIFY_ONLY
name: first-listener
perConnectionBufferLimitBytes: 32768
Expand Down Expand Up @@ -66,6 +67,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: false
name: second-listener
drainType: MODIFY_ONLY
name: second-listener
perConnectionBufferLimitBytes: 32768
Expand Down Expand Up @@ -106,6 +108,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: false
name: third-listener
drainType: MODIFY_ONLY
name: third-listener
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: first-listener
drainType: MODIFY_ONLY
name: first-listener
perConnectionBufferLimitBytes: 32768
Expand All @@ -47,5 +48,6 @@
cluster: second-route-dest
idleTimeout: 1200s
statPrefix: tcp
name: second-route
name: second-listener
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: first-listener
drainType: MODIFY_ONLY
name: first-listener
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: envoy-gateway/gateway-1/http
drainType: MODIFY_ONLY
name: envoy-gateway/gateway-1/http
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: default/gateway-1/http
drainType: MODIFY_ONLY
name: default/gateway-1/http
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: envoy-gateway/gateway-1/http
drainType: MODIFY_ONLY
name: envoy-gateway/gateway-1/http
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: first-listener
drainType: MODIFY_ONLY
name: first-listener
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: first-listener
drainType: MODIFY_ONLY
name: first-listener
perConnectionBufferLimitBytes: 32768
Expand Down Expand Up @@ -60,6 +61,7 @@
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
useRemoteAddress: true
name: second-listener
drainType: MODIFY_ONLY
name: second-listener
perConnectionBufferLimitBytes: 32768
Loading

0 comments on commit 3712659

Please sign in to comment.