feat: expose maxHosts for DynamicResolver DNS cache #9740
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.47) × (1 − Review Confidence (0.41)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 274 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.336
Real PR Conversation Timeline
1 comments
"Review active on #9740"
general
weight: 0.35
vishals-3
Fixes #9382
What this does
Envoy's
dynamic_forward_proxyDnsCacheConfigsupports amax_hostsfield that bounds how many hosts the DNS cache holds. Envoy Gateway did not expose it, so it was pinned to Envoy's default of 1024. This adds a first-classmaxHostsfield to the DNS configuration.Design
The field is added to the shared
DNStype, so it is configurable everywhere existing DNS settings live (BackendTrafficPolicy, EnvoyExtensionPolicy, EnvoyProxy, SecurityPolicy) — consistent with howdnsRefreshRateandlookupFamilyare already surfaced. It flows through the standard pipeline:api/v1alpha1/dns_types.go:MaxHosts uint32(+kubebuilder:validation:Minimum=1)internal/ir/xds.go:MaxHosts uint32on the internalDNSstructinternal/gatewayapi/clustersettings.go(translateDNS)internal/xds/translator/cluster.go(buildDFPDNSCacheConfig), which feeds both the cluster and SNI dynamic-forward-proxy pathsWhen unset, Envoy's default is preserved.
The issue floated Backend / DynamicResolver / EnvoyProxy as candidate homes for the field; putting it on the shared DNS type covers those via the existing
ClusterSettings.dnssurface. Happy to move it if maintainers prefer a narrower placement.Testing
Generated code (deepcopy, CRDs, API reference docs) was regenerated with the repo's own tooling (
controller-gen,crd-ref-docs).http-route-dynamic-resolver-dns-max-hostsassertingmaxHostsin the rendered EnvoydnsCacheConfigbackendtrafficpolicy-with-dns-settingsfixture to exercise the API→IR conversionTestBuildDFPDNSCacheConfigunit test covering nil / unset / set---
This PR was authored with the assistance of Claude, an AI assistant.
🤖 Generated with Claude Code