fix(xds): use DnsCluster extension for DNS clusters#9155
fix(xds): use DnsCluster extension for DNS clusters#9155andreademurtas wants to merge 5 commits into
Conversation
Replace the deprecated Cluster.dns_refresh_rate and respect_dns_ttl fields with Envoy's envoy.cluster.dns extension for DNS-based clusters. Behavior is preserved (30s default, respect_dns_ttl, dns_lookup_family carried into the extension via a name-based enum mapping); STRICT_DNS semantics kept via all_addresses_in_single_endpoint=false. Fixes envoyproxy#6192 Signed-off-by: Andrea De Murtas <56048157+andreademurtas@users.noreply.github.com>
…lidation Signed-off-by: Andrea De Murtas <56048157+andreademurtas@users.noreply.github.com>
Signed-off-by: Andrea De Murtas <56048157+andreademurtas@users.noreply.github.com>
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d725b55237
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9155 +/- ##
==========================================
+ Coverage 74.81% 74.92% +0.11%
==========================================
Files 252 252
Lines 40756 40818 +62
==========================================
+ Hits 30490 30584 +94
+ Misses 8184 8152 -32
Partials 2082 2082 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/retest |
Signed-off-by: Andrea De Murtas <56048157+andreademurtas@users.noreply.github.com>
|
/retest |
There was a problem hiding this comment.
Pull request overview
Migrates DNS-based xDS clusters generated by the translator from deprecated Cluster.dns_refresh_rate / Cluster.respect_dns_ttl fields to Envoy’s supported DNS cluster extension (envoy.cluster.dns / envoy.extensions.clusters.dns.v3.DnsCluster), keeping existing defaults and behavior while updating golden outputs and tests.
Changes:
- Update
internal/xds/translator/cluster.goto emit DNS clusters viacluster_typewithDnsClustertyped config and a lookup-family enum mapping. - Update unit tests to validate the new typed config and refresh-rate validation behavior.
- Refresh translator/egctl golden outputs and add release-note guidance for patch/extension-server consumers.
Findings
Required fixes
release-notes/current.yaml:7: Release note should also mentiondns_lookup_familypatches need to move tocluster_typetyped config (Envoy ignores top-levelCluster.dns_lookup_familywhencluster_typeis set).
Optional follow-ups
- None.
Reviewed changes
Copilot reviewed 3 out of 63 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| release-notes/current.yaml | Document breaking xDS shape change for DNS clusters / patchers |
| internal/xds/translator/cluster.go | Emit DNS clusters via envoy.cluster.dns typed config (DnsCluster extension) |
| internal/xds/translator/cluster_test.go | Assert typed config contents + add validation/mapping tests |
| internal/xds/translator/testdata/out/xds-ir/wasm.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/tracing.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/tracing-zipkin.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/tracing-span-name.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/tracing-otel-sampler.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/tracing-otel-sampler-always-on.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/tracing-otel-headers.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/tracing-endpoint-stats.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/tracing-datadog.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/tls-route-termination.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/securitypolicy-with-oidc-jwt-authz.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ratelimit.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip-invert.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ratelimit-per-rule-headers.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ratelimit-multi-global-shared.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ratelimit-headers-and-cidr.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ratelimit-global-shared.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ratelimit-endpoint-stats.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ratelimit-disable-headers.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ratelimit-both-type.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/oidc.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/oidc-provider-traffic-features.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/oidc-backend-cluster-provider.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/oidc-and-jwt-with-passthrough.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port-with-different-filters.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/mixed-tls-jwt-authn.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/jwt-with-backend-tls-retry.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/jwt-single-route-single-match.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/jwt-ratelimit.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/jwt-optional.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/jwt-multi-route-single-provider.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/jwt-multi-route-multi-provider.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/jwt-from-multiple-listeners.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/jwt-custom-extractor.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/http2-mixed.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/http-route-dns-cluster.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/health-check-host-hierarchy.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/global-ratelimit-query-parameters.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ext-auth-recomputation.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ext-auth-body.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/ext-auth-backend.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/dynamicmodule.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/dns-lookup-family.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/custom-filter-order.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/authorization-jwt-scope.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/authorization-jwt-claim.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/accesslog.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/accesslog-with-format.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/accesslog-types.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/accesslog-otel-headers.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/accesslog-multi-cel.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/accesslog-formatters.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/accesslog-endpoint-stats.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/xds/translator/testdata/out/xds-ir/accesslog-cel.clusters.yaml | Update golden DNS cluster output to clusterType/DnsCluster |
| internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.cluster.yaml | Update egctl golden cluster output to clusterType/DnsCluster |
| internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml | Update egctl golden “all” output to clusterType/DnsCluster |
| internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json | Update egctl golden JSON output to clusterType/DnsCluster |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Andrea De Murtas <56048157+andreademurtas@users.noreply.github.com>
What type of PR is this?
What this PR does / why we need it:
Cluster.dns_refresh_rateandCluster.respect_dns_ttlare deprecated in Envoy. This PR migrates DNS-based clusters (theSTRICT_DNSpath in the xDS translator) to Envoy'senvoy.cluster.dnscluster extension (envoy.extensions.clusters.dns.v3.DnsCluster), the supported replacement.Behavior is preserved:
dns_refresh_ratedefault andrespect_dns_ttl=truedefault are carried over.dns_lookup_familyis set inside theDnsClusterextension, because Envoy reads it from there (and ignores the top-levelCluster.dns_lookup_family) whencluster_typeis set. Theconfig.cluster.v3andclusters.common.dns.v3lookup-family enums differ by one value, so the mapping is done by name, not a raw cast.all_addresses_in_single_endpointis leftfalse, equivalent to the legacySTRICT_DNStype.The static bootstrap
xds_clusterkeepstype: STRICT_DNS: it does not use the deprecated fields and theSTRICT_DNStype itself is not deprecated, so it is intentionally out of scope.TestBuildXdsClusteris updated accordingly, and unit tests cover the new lookup-family mapping and the refresh-rate validation path.Note for
EnvoyPatchPolicy/JSONPatch users: patches targetingtype,dns_refresh_rate, orrespect_dns_ttlon these clusters must be updated to patch thecluster_type(envoy.cluster.dns) typed config instead (captured in the release notes).Which issue(s) this PR fixes:
Fixes #6192
Release Notes: Yes