Skip to content

feat: add transportSocketConnectTimeout on ListenerPolicy#14058

Merged
davidjumani merged 7 commits into
kgateway-dev:mainfrom
NomadXD:feat/13919
Jul 15, 2026
Merged

feat: add transportSocketConnectTimeout on ListenerPolicy#14058
davidjumani merged 7 commits into
kgateway-dev:mainfrom
NomadXD:feat/13919

Conversation

@NomadXD

@NomadXD NomadXD commented May 19, 2026

Copy link
Copy Markdown
Contributor

Description

Adds transportSocketConnectTimeout on ListenerPolicy which gets propagated to FilterChain.transport_socket_connect_timeout on every filter chain of each matched listener. Envoy uses this to limit the time it waits for a TLS handshake to complete after accepting a connection which protects the listener from clients that open connections and never finish the handshake.

Fixes #13919

Change Type

/kind feature

Changelog

Add transportSocketConnectTimeout field to ListenerPolicy

Additional Notes

  • Added a method (ApplyPostListener) to the pluginsdk/ir.ProxyTranslationPass interface. Plugins that embed UnimplementedProxyTranslationPass are unaffected. Any plugin implementing the interface directly will need a no-op method.

Copilot AI review requested due to automatic review settings May 19, 2026 09:53
@NomadXD
NomadXD requested a review from a team as a code owner May 19, 2026 09:53
@gateway-bot gateway-bot added kind/feature Categorizes issue or PR as related to a new feature. release-note labels May 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds transportSocketConnectTimeout support to ListenerPolicy, allowing configured timeouts to propagate to Envoy filter chains after listener filter chains are built.

Changes:

  • Adds the API field, deepcopy support, and CRD schema entries.
  • Adds a post-listener translation hook and invokes it after filter chain construction.
  • Implements ListenerPolicy propagation/merge behavior and adds a translator golden test.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
api/v1alpha1/kgateway/listener_policy_types.go Adds the new ListenerPolicy field and validation.
api/v1alpha1/kgateway/zz_generated.deepcopy.go Adds deepcopy handling for the new duration field.
install/helm/kgateway-crds/templates/gateway.kgateway.dev_listenerpolicies.yaml Updates CRD schemas for default and per-port configs.
pkg/pluginsdk/ir/iface.go Adds the post-listener translation hook.
pkg/kgateway/translator/irtranslator/gateway.go Runs post-listener plugins after filter chains are built.
pkg/kgateway/extensions2/plugins/listenerpolicy/listener_plugin.go Stores and applies the timeout to all listener filter chains.
pkg/kgateway/extensions2/plugins/listenerpolicy/merge.go Adds merge support for the new field.
pkg/kgateway/translator/gateway/gateway_translator_test.go Adds the translator test case.
pkg/kgateway/translator/gateway/testutils/inputs/listener-policy/transport-socket-connect-timeout.yaml Adds test input manifests.
pkg/kgateway/translator/gateway/testutils/outputs/listener-policy/transport-socket-connect-timeout.yaml Adds expected translated output.
Files not reviewed (1)
  • api/v1alpha1/kgateway/zz_generated.deepcopy.go: Language not supported

Comment thread pkg/pluginsdk/ir/iface.go Outdated
Comment on lines +136 to +140
// ApplyPostListener is called 1 time per listener, after FilterChains are built.
ApplyPostListener(
pCtx *ListenerContext,
out *envoylistenerv3.Listener,
)
@NomadXD
NomadXD marked this pull request as draft May 19, 2026 10:04
@andy-fong

Copy link
Copy Markdown
Contributor

@NomadXD This PR looks reasonable but can you add more tests to cover the scenario where you
have 3 https listeners on the same port and 3 listnerpolicies with different values. 1 applies to gateway, 2 apply the other 2 listeners, make sure the one without override get the gateway level setting and the other 2 should have their own setting.

@NomadXD
NomadXD marked this pull request as ready for review June 2, 2026 02:15
# Conflicts:
#	pkg/kgateway/extensions2/plugins/listenerpolicy/merge.go
@andy-fong
andy-fong added this pull request to the merge queue Jul 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 13, 2026
@davidjumani
davidjumani added this pull request to the merge queue Jul 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 13, 2026
@davidjumani
davidjumani added this pull request to the merge queue Jul 13, 2026
@davidjumani
davidjumani removed this pull request from the merge queue due to a manual request Jul 13, 2026
@davidjumani

Copy link
Copy Markdown
Contributor

@NomadXD can you please update to the latest main and regenerate the golden yamls ?

@NomadXD

NomadXD commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@davidjumani
davidjumani added this pull request to the merge queue Jul 15, 2026
Merged via the queue into kgateway-dev:main with commit 7801f47 Jul 15, 2026
42 of 43 checks passed
sheidkamp pushed a commit to sheidkamp/kgateway that referenced this pull request Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow configuring transport_socket_connect_timeout via ListenerPolicy

5 participants