Skip to content

fix(telemetry): support BackendTLSPolicy for telemetry backends - #8545

Merged
arkodg merged 3 commits into
envoyproxy:mainfrom
codefromthecrypt:fix/telemetry-backendtlspolicy
Apr 2, 2026
Merged

arkodg merged 3 commits into
envoyproxy:mainfrom
codefromthecrypt:fix/telemetry-backendtlspolicy

Conversation

@codefromthecrypt

Copy link
Copy Markdown
Contributor

What type of PR is this?
fix(telemetry): support BackendTLSPolicy for telemetry backends

What this PR does / why we need it:
processBackendRefs does not look up BackendTLSPolicy for telemetry backends (access logs, tracing, metrics), so TLS can only be configured via Backend.spec.tls.

Replace inline processServerValidationTLSSettings with applyBackendTLSSetting so telemetry backends get the full Backend + BackendTLSPolicy + EnvoyProxy TLS merge.

Which issue(s) this PR fixes:
Workaround: theagentrouter/agent-router#1964

Release Notes: Yes

Tested with examples/otel-headers against Elastic Cloud using BackendTLSPolicy (no Backend.spec.tls):

--- a/examples/otel-headers/resources/gateway.yaml
+++ b/examples/otel-headers/resources/gateway.yaml
@@ -5,15 +5,21 @@
 spec:
   endpoints:
     - fqdn:
-        hostname: localhost
-        port: 4317
-# Use below for cloud OTLP endpoints
-#   endpoints:
-#     - fqdn:
-#         hostname: otel.example.com
-#         port: 443
-#   tls:
-#     wellKnownCACertificates: System
+        hostname: adrian-o11y-b7e5ce.ingest.us-central1.gcp.elastic.cloud
+        port: 443
+---
+apiVersion: gateway.networking.k8s.io/v1alpha3
+kind: BackendTLSPolicy
+metadata:
+  name: otel-tls
+spec:
+  targetRefs:
+    - group: gateway.envoyproxy.io
+      kind: Backend
+      name: otel-collector
+  validation:
+    wellKnownCACertificates: System
+    hostname: adrian-o11y-b7e5ce.ingest.us-central1.gcp.elastic.cloud
 ---
@@ -35,7 +41,7 @@
             headers:
               - name: Authorization
-                value: Bearer fake
+                value: ApiKey <redacted>

@codefromthecrypt
codefromthecrypt requested a review from a team as a code owner March 18, 2026 03:50
@netlify

netlify Bot commented Mar 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 canceled.

Name Link
🔨 Latest commit f9e5061
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/69cc5ae05084f60008f508cc

@codecov

codecov Bot commented Mar 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.36%. Comparing base (fdc3128) to head (f9e5061).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/listener.go 90.47% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8545      +/-   ##
==========================================
- Coverage   74.40%   74.36%   -0.04%     
==========================================
  Files         243      243              
  Lines       38262    38267       +5     
==========================================
- Hits        28467    28457      -10     
- Misses       7805     7816      +11     
- Partials     1990     1994       +4     

☔ View full report in Codecov by Sentry.
📢 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.

zirain
zirain previously approved these changes Mar 18, 2026
zirain
zirain previously approved these changes Mar 19, 2026
@codefromthecrypt
codefromthecrypt force-pushed the fix/telemetry-backendtlspolicy branch from 0c36522 to d698a37 Compare March 21, 2026 16:30
@arkodg
arkodg requested review from a team March 23, 2026 03:54
zirain
zirain previously approved these changes Mar 23, 2026
@codefromthecrypt
codefromthecrypt force-pushed the fix/telemetry-backendtlspolicy branch 2 times, most recently from ef89f02 to 7077639 Compare March 30, 2026 12:56
Comment thread internal/gatewayapi/listener.go Resolved
zhaohuabing
zhaohuabing previously approved these changes Mar 31, 2026
zirain
zirain previously approved these changes Mar 31, 2026
@codefromthecrypt
codefromthecrypt dismissed stale reviews from zirain and zhaohuabing via cb7727e March 31, 2026 12:52
@codefromthecrypt
codefromthecrypt force-pushed the fix/telemetry-backendtlspolicy branch from 7077639 to cb7727e Compare March 31, 2026 12:52
processBackendRefs does not look up BackendTLSPolicy for telemetry
backends (access logs, tracing, metrics), so TLS can only be configured
via Backend.spec.tls. Replace inline processServerValidationTLSSettings
with applyBackendTLSSetting so telemetry backends get the full Backend +
BackendTLSPolicy + EnvoyProxy TLS merge.

Workaround: theagentrouter/agent-router#1964

Signed-off-by: Adrian Cole <[email protected]>
Signed-off-by: Adrian Cole <[email protected]>
@zirain
zirain force-pushed the fix/telemetry-backendtlspolicy branch from cb7727e to f9e5061 Compare March 31, 2026 23:38

@zhaohuabing zhaohuabing left a comment

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.

LGTM. Thanks!

@zirain

zirain commented Apr 1, 2026

Copy link
Copy Markdown
Member

/retest

@arkodg
arkodg merged commit ac18feb into envoyproxy:main Apr 2, 2026
54 of 58 checks passed
@codefromthecrypt
codefromthecrypt deleted the fix/telemetry-backendtlspolicy branch April 2, 2026 12:47
cnvergence pushed a commit to cnvergence/gateway that referenced this pull request Apr 16, 2026
…yproxy#8545)

* fix(telemetry): support BackendTLSPolicy for telemetry backends

processBackendRefs does not look up BackendTLSPolicy for telemetry
backends (access logs, tracing, metrics), so TLS can only be configured
via Backend.spec.tls. Replace inline processServerValidationTLSSettings
with applyBackendTLSSetting so telemetry backends get the full Backend +
BackendTLSPolicy + EnvoyProxy TLS merge.

Workaround: theagentrouter/agent-router#1964

Signed-off-by: Adrian Cole <[email protected]>
(cherry picked from commit ac18feb)
Signed-off-by: Karol Szwaj <[email protected]>
cnvergence added a commit that referenced this pull request Apr 16, 2026
* fix: handle network errors in rate limit e2e tests (#8446)

Signed-off-by: Rudrakh Panigrahi <[email protected]>
(cherry picked from commit b0638d5)
Signed-off-by: Karol Szwaj <[email protected]>

* refactor/perf: use LuaPerRoute instead of FilterConfig (#8355)

perf: use LuaPerRoute instead of FilterConfig

Signed-off-by: Rudrakh Panigrahi <[email protected]>
(cherry picked from commit f31ac4e)
Signed-off-by: Karol Szwaj <[email protected]>

* fix: per-endpoint hostname override blocked by auto-generated wildcad host (#8565)

* fix: per-endpoint hostname override blocked by auto-generated wildcard host

Signed-off-by: zirain <[email protected]>

* add UT

Signed-off-by: zirain <[email protected]>

---------

Signed-off-by: zirain <[email protected]>
(cherry picked from commit 595010a)
Signed-off-by: Karol Szwaj <[email protected]>

* fix bug with grpcroute mirror filter (#8541)

* fix bug with grpcroute mirror filter

Signed-off-by: Adam Buran <[email protected]>

* add indexers test

Signed-off-by: Adam Buran <[email protected]>

* add release note

Signed-off-by: Adam Buran <[email protected]>

---------

Signed-off-by: Adam Buran <[email protected]>
Signed-off-by: Arko Dasgupta <[email protected]>
Co-authored-by: Arko Dasgupta <[email protected]>
(cherry picked from commit e633c08)
Signed-off-by: Karol Szwaj <[email protected]>

* fix: normalize CRLF line endings in htpasswd basic auth secrets (#8557)

Fixes #8554

Signed-off-by: stekole <[email protected]>
Signed-off-by: stekole <[email protected]>
(cherry picked from commit 9cac348)
Signed-off-by: Karol Szwaj <[email protected]>

* fix: avoid metric increments on no-op delete reconcile paths (#8480)

* fix: avoid metric increments on no-op delete reconcile paths

Signed-off-by: Felipe Sabadini Facina <[email protected]>

* Update internal/infrastructure/kubernetes/infra_resource_test.go

Signed-off-by: Isaac Wilson <[email protected]>

* Update internal/infrastructure/kubernetes/infra_resource_test.go

Signed-off-by: Isaac Wilson <[email protected]>

---------

Signed-off-by: Felipe Sabadini Facina <[email protected]>
Signed-off-by: Isaac Wilson <[email protected]>
Co-authored-by: Isaac Wilson <[email protected]>
(cherry picked from commit 7a2a4ec)
Signed-off-by: Karol Szwaj <[email protected]>

* fix(telemetry): support BackendTLSPolicy for telemetry backends (#8545)

* fix(telemetry): support BackendTLSPolicy for telemetry backends

processBackendRefs does not look up BackendTLSPolicy for telemetry
backends (access logs, tracing, metrics), so TLS can only be configured
via Backend.spec.tls. Replace inline processServerValidationTLSSettings
with applyBackendTLSSetting so telemetry backends get the full Backend +
BackendTLSPolicy + EnvoyProxy TLS merge.

Workaround: theagentrouter/agent-router#1964

Signed-off-by: Adrian Cole <[email protected]>
(cherry picked from commit ac18feb)
Signed-off-by: Karol Szwaj <[email protected]>

* fix: restore failure-path metric recording for delete and HPA reconcile (#8656)

Fixes #8651

Signed-off-by: Felipe Sabadini Facina <[email protected]>
(cherry picked from commit 2a5bfd0)
Signed-off-by: Karol Szwaj <[email protected]>

* fix: status for mirror backend (#8675)

Signed-off-by: kkk777-7 <[email protected]>
(cherry picked from commit fa81778)
Signed-off-by: Karol Szwaj <[email protected]>

* fix: client certificate secret never delivered when it is exclusively referenced by a SecurityPolicy extAuth Backend (#8654)

* fix: client certificate secret never delivered when it is exclusively referenced by a SecurityPolicy extAuth Backend

Signed-off-by: zirain <[email protected]>

* fix lint

Signed-off-by: zirain <[email protected]>

---------

Signed-off-by: zirain <[email protected]>
(cherry picked from commit c7e21fa)
Signed-off-by: Karol Szwaj <[email protected]>

* fix: client certificate secret never delivered when it is exclusively referenced by a SecurityPolicy jwt/oidc Backend (#8711)

Signed-off-by: zirain <[email protected]>
(cherry picked from commit 95c3a79)
Signed-off-by: Karol Szwaj <[email protected]>

* fix: helm secrets rbac for gateway namespace with watch list of namespaces (#8706)

* fix: helm secrets rbac for gateway namespace with watch list of namespaces

Signed-off-by: Karol Szwaj <[email protected]>

* add release notes

Signed-off-by: Karol Szwaj <[email protected]>

* review update

Signed-off-by: Karol Szwaj <[email protected]>

---------

Signed-off-by: Karol Szwaj <[email protected]>
Co-authored-by: Rudrakh Panigrahi <[email protected]>
(cherry picked from commit c48a346)
Signed-off-by: Karol Szwaj <[email protected]>

* add release notes

Signed-off-by: Karol Szwaj <[email protected]>

* fix lint

Signed-off-by: Karol Szwaj <[email protected]>

* fix lint

Signed-off-by: Karol Szwaj <[email protected]>

---------

Signed-off-by: Rudrakh Panigrahi <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: zirain <[email protected]>
Signed-off-by: Adam Buran <[email protected]>
Signed-off-by: Arko Dasgupta <[email protected]>
Signed-off-by: stekole <[email protected]>
Signed-off-by: stekole <[email protected]>
Signed-off-by: Felipe Sabadini Facina <[email protected]>
Signed-off-by: Isaac Wilson <[email protected]>
Signed-off-by: Adrian Cole <[email protected]>
Signed-off-by: kkk777-7 <[email protected]>
Co-authored-by: Rudrakh Panigrahi <[email protected]>
Co-authored-by: zirain <[email protected]>
Co-authored-by: aburanrbx <[email protected]>
Co-authored-by: Arko Dasgupta <[email protected]>
Co-authored-by: stekole <[email protected]>
Co-authored-by: Felipe Sabadini <[email protected]>
Co-authored-by: Isaac Wilson <[email protected]>
Co-authored-by: Adrian Cole <[email protected]>
Co-authored-by: Kota Kimura <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants