Skip to content

Preserve backend ports and host rewrites in endpoint probes - #1301

Open
kahirokunn wants to merge 1 commit into
knative-extensions:mainfrom
kahirokunn:fix-previous-endpoint-probe-host-rewrite
Open

Preserve backend ports and host rewrites in endpoint probes#1301
kahirokunn wants to merge 1 commit into
knative-extensions:mainfrom
kahirokunn:fix-previous-endpoint-probe-host-rewrite

Conversation

@kahirokunn

@kahirokunn kahirokunn commented Aug 31, 2026

Copy link
Copy Markdown
Member

Problem

Before switching a KIngress to new Envoy programming, net-contour creates a temporary --ep KIngress that keeps the current and previous backends available while Envoy loads the new endpoint configuration.

For example, an update can replace this previously programmed HTTPProxy route:

routes:
- requestHeadersPolicy:
    set:
    - name: Host
      value: app.default.svc.cluster.local
  services:
  - name: app
    port: 80

with this KIngress backend:

splits:
- serviceName: app
  servicePort: 8080

The endpoint probe grouped backends only by Service name, so app:8080 replaced app:80 in the temporary route. When a previous Service was restored, its route-level Host rewrite was also lost. The probe could therefore omit the previous Envoy cluster or forward its synthetic *.net-contour.invalid host to a backend that requires the internal host, leaving the KIngress in EndpointsNotReady.

The Host rewrite case is exercised by knative/serving#16685, which changes a DomainMapping KIngress from a cluster-local Service backend to direct Revision Service backends.

Changes

Key endpoint-probe backends by Service name and port, include the port in each synthetic probe host, and restore the previous HTTPProxy route's Host rewrite.

Testing

Unit tests cover changed numeric ports, named ports, current-setting precedence for an unchanged backend, and Host rewrite recovery for previous backends.

/kind bug

Release Note

Fixed endpoint probes for previous backends that use a different Service port or require host rewriting.

Docs

N/A

@knative-prow knative-prow Bot added kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 31, 2026
@knative-prow

knative-prow Bot commented Aug 31, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kahirokunn
Once this PR has been reviewed and has the lgtm label, please assign skonto for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow
knative-prow Bot requested review from dprotaso and skonto August 31, 2026 16:48
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.74%. Comparing base (577c757) to head (231a047).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1301      +/-   ##
==========================================
+ Coverage   93.41%   93.74%   +0.32%     
==========================================
  Files           9        9              
  Lines         653      687      +34     
==========================================
+ Hits          610      644      +34     
  Misses         22       22              
  Partials       21       21              

☔ 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.

@kahirokunn
kahirokunn force-pushed the fix-previous-endpoint-probe-host-rewrite branch from f39fb14 to b00081f Compare August 31, 2026 17:54
@kahirokunn
kahirokunn marked this pull request as draft August 31, 2026 18:03
@knative-prow knative-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 31, 2026
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
@kahirokunn
kahirokunn force-pushed the fix-previous-endpoint-probe-host-rewrite branch from b00081f to 231a047 Compare September 1, 2026 04:59
@knative-prow knative-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 1, 2026
@kahirokunn kahirokunn changed the title Preserve host rewrites for previous endpoint probes Preserve backend ports and host rewrites in endpoint probes Sep 1, 2026
@kahirokunn
kahirokunn marked this pull request as ready for review September 1, 2026 05:00
@knative-prow knative-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 1, 2026
@kahirokunn

Copy link
Copy Markdown
Member Author

@linkvt Hi ✋ Could you please review this PR when you have time, if you don't mind? Thank you🙇

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

Labels

kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant