Skip to content

feat: support UDP health checks for UDPRoute - #10668

Open
zhaohuabing wants to merge 1 commit into
envoyproxy:mainfrom
zhaohuabing:feat/udp-health-check-api
Open

zhaohuabing wants to merge 1 commit into
envoyproxy:mainfrom
zhaohuabing:feat/udp-health-check-api

Conversation

@zhaohuabing

@zhaohuabing zhaohuabing commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Adds a UDP active health checker to BackendTrafficPolicy for UDPRoute backends, using Envoy's native UDP health checker. A probe sends one datagram and passes only when the reply matches the expected payload exactly.

The UDP checker only applies to UDPRoute, and UDPRoute only takes the UDP checker, so existing policies don't start probing UDP backends. Any other pairing gets a status warning.

Fixes #10416

@netlify

netlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit ffc0097
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6b1268dd763cfe2536480b1a
😎 Deploy Preview https://deploy-preview-10668--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the area/api API-related issues label Nov 20, 2026
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.03937% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.86%. Comparing base (0b677fb) to head (ffc0097).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/backendtrafficpolicy.go 83.01% 9 Missing ⚠️
internal/ir/xds.go 55.55% 8 Missing ⚠️
internal/gatewayapi/backendsettings.go 97.29% 1 Missing ⚠️
internal/xds/translator/cluster.go 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10668      +/-   ##
==========================================
+ Coverage   82.85%   82.86%   +0.01%     
==========================================
  Files         278      278              
  Lines       44695    44815     +120     
==========================================
+ Hits        37032    37136     +104     
- Misses       7662     7678      +16     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zhaohuabing zhaohuabing changed the title api: add a UDP active health checker feat: add a UDP active health checker Nov 20, 2026
@zhaohuabing zhaohuabing changed the title feat: add a UDP active health checker feat: support UDP health checks for UDPRoute Nov 20, 2026

@zhaohuabing zhaohuabing Nov 20, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think UDP hc works with HTTPRoute and TCPRoute, but not sure if this is a common case and should we support it in the first iteration. cc @envoyproxy/gateway-maintainers

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 for support UDP only in the first iteration.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For context: on main, HTTP, TCP and gRPC health checks already work on every route type except UDPRoute. This PR adds the UDP checker for all route types, and a UDPRoute takes only the UDP checker.

The UDP checker on HTTP and TCP routes only helps when a backend answers UDP probes but serves its traffic over TCP. If that's rare, I can limit the UDP checker to UDPRoute in this PR.

@zhaohuabing
zhaohuabing force-pushed the feat/udp-health-check-api branch from 15ffdd9 to abb3e20 Compare December 1, 2026 08:46
@zhaohuabing
zhaohuabing marked this pull request as ready for review December 1, 2026 08:46
@zhaohuabing
zhaohuabing requested a review from a team as a code owner December 1, 2026 08:46
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-12-04T07:17:00.278224Z
We couldn’t complete this review. Comment @codex review to try again.
ffc0097 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@zhaohuabing
zhaohuabing force-pushed the feat/udp-health-check-api branch from abb3e20 to edeb81c Compare December 1, 2026 08:46

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: abb3e2009e

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/gatewayapi/backendsettings.go Outdated
irhc.Passive = buildPassiveHealthCheck(*policy.HealthCheck)
irhc.Active = buildActiveHealthCheck(*policy.HealthCheck)
irhc.PanicThreshold = policy.HealthCheck.PanicThreshold
if validateActiveHealthCheckPayloads(irhc.Active) != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Warn when dropping checks from non-BTP backends

When a non-BackendTrafficPolicy BackendSettings consumer, such as an HTTP ExtAuth backend, supplies an expectedResponse larger than 1,024 bytes, this branch clears the active check and can return no health check without an error. Only the BackendTrafficPolicy processing paths report this validation failure, so these resources are still translated without the health check and without a warning; propagate the validation result or report it through those callers too.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed. These resources have no warning status, so an invalid payload now rejects the resource instead of silently dropping the check.

@zhaohuabing
zhaohuabing force-pushed the feat/udp-health-check-api branch from edeb81c to 9e0568b Compare December 1, 2026 09:48
@zhaohuabing zhaohuabing added this to the v1.11.0-rc.1 Release milestone Dec 1, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e0568b0ed

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

required bool
}
var checks []limited
if hc.UDP != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject UDP checks without their udp block

For file-provider input, CEL isn't evaluated, so active.type: UDP without active.udp reaches this validator with hc.UDP == nil and queues no payload checks. buildActiveHealthCheck then leaves UDP unset, and udpHealthCheck drops the empty check, allowing a UDPRoute-targeted BackendTrafficPolicy to be accepted without producing probes; validate the required UDP configuration in the translator instead of relying on CRD CEL.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the same for every checker type, since the file provider doesn't run CEL for any field. For UDP the check is just dropped, so nothing breaks. Validating CEL rules for file-provider input should be handled separately, not per field.

@zhaohuabing
zhaohuabing force-pushed the feat/udp-health-check-api branch 5 times, most recently from 66f27b1 to 686b260 Compare December 4, 2026 05:12
Adds a UDP active health checker to BackendTrafficPolicy, using Envoy's native
UDP health checker. It only applies to UDPRoute backends, and UDPRoute only
takes the UDP checker, so existing policies don't start probing UDP backends.
Invalid payloads drop the active check with a status warning instead of
breaking the cluster.

Fixes envoyproxy#10416

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <huabing@tetrate.io>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing
zhaohuabing force-pushed the feat/udp-health-check-api branch from 686b260 to ffc0097 Compare December 4, 2026 07:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API-related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support UDP health checks in BackendTrafficPolicy for UDPRoute

2 participants