Add per-host connection limits to DestinationRule #3614
+519
−65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add per-host connection limits to DestinationRule
Description
This PR adds support for per-host connection limits in the API by introducing a new
perHostLimitsfield to ConnectionPoolSettings. This feature aligns with Envoy'sper_host_thresholdscapability for circuit breakers.Motivation
Currently, Istio's DestinationRule only allows setting a global connection limit for the entire cluster, independent of the number of endpoints. This makes it difficult to properly manage concurrency for destination services, especially in autoscaling scenarios where the number of replicas changes dynamically.
Per-host connection limits allow controlling connections to each individual endpoint, which:
The underlying Envoy cluster circuit breaker already has this
per_host_thresholdscapability. Other Envoy-based tools (Envoy Gateway, Contour) have already added this support.Example Usage
Limitations
Currently only the maxConnections field is supported for per-host limits, as per Envoy's circuit breaker implementation. Other fields in TCPSettings will be ignored.
Testing
Generated CRD files successfully with make gen
Test case not included due to CRD validation cost limits (will be validated in istio/istio integration)
Fixes #57697