feat: support upstream health checks in BackendTrafficPolicy#2763
Merged
AlinsRan merged 10 commits intoMay 18, 2026
Merged
Conversation
- Fix Timeouts field JSON tag: timeout -> timeouts to match ADC type - Enforce minimum 1s interval in translateBTPActiveHealthCheck to prevent sub-second values from truncating to 0 (matching v2/apisixupstream behavior) - Scope e2e upstream assertions to httpbin-service-e2e-test by name - Regenerate CRD manifests and API reference docs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Upstream Name is cleared when embedded in a service object (httproute translator sets Name="" for single-backend upstreams). Filtering by name always fails; rely on Checks field instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Reuse apiv2.ActiveHealthCheckMinInterval instead of duplicating the constant to avoid divergence - Assert upstreams list is non-empty before checking post-deletion state so the test fails explicitly if no upstreams are found Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The AuthParameter field is declared as *ApisixConsumerAuthParameter (pointer), but the test was using a non-pointer value literal. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nic-6443
approved these changes
May 15, 2026
shreemaan-abhishek
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds health check support to
BackendTrafficPolicy, allowing users to configure active and passive health checks for upstream backends directly through theBackendTrafficPolicyresource.Changes
New API types (
api/v1alpha1/backendtrafficpolicy_types.go)HealthCheckstruct withActiveandPassivefields toBackendTrafficPolicySpecActiveHealthCheck: configures HTTP/TCP probes with configurable interval, timeout, thresholds, and TLS settingsPassiveHealthCheck: configures passive (observational) health monitoring with configurable thresholdsBackendTrafficPolicyTimeoutsstruct (renamed json tag fromtimeouttotimeoutsfor consistency)Translation (
internal/adc/translator/policies.go)BackendTrafficPolicy.Spec.HealthCheckinto APISIX upstreamchecksconfigurationCRD regeneration
config/crd/bases/apisix.apache.org_backendtrafficpolicies.yamlwith health check schemaE2E tests (
test/e2e/crds/v1alpha1/backendtrafficpolicy.go)Example