Skip to content

Commit

Permalink
fix(meshtimeout): don't set default timeouts on inbound cluster and l…
Browse files Browse the repository at this point in the history
…istener (#12043)

## Motivation

We noticed that when a user upgrades to version 2.9.x without a default
MeshTimeout/Timeout policy, default timeouts are applied on inbound
clusters and listeners. This could disrupt the existing behavior of the
environment.

## Implementation information

When no policy is present, we simply skip configuration and do not set
up the timeouts for inbound cluster or listener.

## Supporting documentation


Fix #12033

<!--
> Changelog: skip
-->
<!--
Uncomment the above section to explicitly set a [`> Changelog:` entry
here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)?
-->

---------

Signed-off-by: Lukasz Dziedziak <[email protected]>
  • Loading branch information
lukidzi authored and kumahq[bot] committed Nov 14, 2024
1 parent 7fb2695 commit f58221c
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: localhost:8080
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
address:
socketAddress:
address: 127.0.0.1
portValue: 80
enableReusePort: false
filterChains:
- filters:
- name: envoy.filters.network.http_connection_manager
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
httpFilters:
- name: envoy.filters.http.router
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
routeConfig:
name: inbound:backend
requestHeadersToRemove:
- x-kuma-tags
validateClusters: false
virtualHosts:
- domains:
- '*'
name: backend
routes:
- match:
prefix: /
route:
cluster: backend
timeout: 0s
statPrefix: inbound_127_0_0_1_80
name: inbound:127.0.0.1:80
trafficDirection: INBOUND
2 changes: 1 addition & 1 deletion pkg/plugins/policies/meshtimeout/plugin/v1alpha1/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func applyToInbounds(fromRules core_rules.FromRules, inboundListeners map[core_r
protocol := core_mesh.ParseProtocol(inbound.GetProtocol())
conf := getConf(fromRules.Rules[listenerKey], core_rules.MeshSubset())
if conf == nil {
conf = &plugin_xds.DefaultTimeoutConf
continue
}
configurer := plugin_xds.ListenerConfigurer{
Conf: *conf,
Expand Down
24 changes: 24 additions & 0 deletions pkg/plugins/policies/meshtimeout/plugin/v1alpha1/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,30 @@ var _ = Describe("MeshTimeout", func() {
expectedClusters: []string{"basic_inbound_cluster.golden.yaml"},
expectedListeners: []string{"basic_inbound_listener.golden.yaml"},
}),
Entry("basic inbound route without defaults", sidecarTestCase{
resources: []core_xds.Resource{
{
Name: "inbound",
Origin: generator.OriginInbound,
Resource: httpInboundListenerWith(),
},
{
Name: "inbound",
Origin: generator.OriginInbound,
Resource: test_xds.ClusterWithName(fmt.Sprintf("localhost:%d", builders.FirstInboundServicePort)),
},
},
fromRules: core_rules.FromRules{
Rules: map[core_rules.InboundListener]core_rules.Rules{
{
Address: "127.0.0.1",
Port: 80,
}: []*core_rules.Rule{},
},
},
expectedClusters: []string{"basic_without_defaults_inbound_cluster.golden.yaml"},
expectedListeners: []string{"basic_without_defaults_inbound_listener.golden.yaml"},
}),
Entry("outbound with defaults when http conf missing", sidecarTestCase{
resources: []core_xds.Resource{
{
Expand Down

0 comments on commit f58221c

Please sign in to comment.