Skip to content

feat: add support for certificate fetching via SDS ref secret#8745

Open
zirain wants to merge 8 commits intoenvoyproxy:mainfrom
zirain:sds-ref
Open

feat: add support for certificate fetching via SDS ref secret#8745
zirain wants to merge 8 commits intoenvoyproxy:mainfrom
zirain:sds-ref

Conversation

@zirain
Copy link
Copy Markdown
Member

@zirain zirain commented Apr 14, 2026

suppress #8537

Original idea from @guydc

Regarding the secret-based option mentioned yesterday, I meant that we can still use a secret reference (just like today), but when the secret has a custom type like gateway.envoyproxy.io/sds-ref, we expect certain keys to exist in that secret that provide the necessary metadata, e.g. sds url and sds secret name.

apiVersion: v1
kind: Secret
metadata:
  name: sds-secret-sample
type: gateway.envoyproxy.io/sds-ref
data:
  url: /var/run/sds
  secretName: my-tls-secret

This secret may contain additional things like authorization for sds server access.

@zirain zirain requested a review from a team as a code owner April 14, 2026 08:28
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 352c946
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/69e73edbe0b4140008a91b1c
😎 Deploy Preview https://deploy-preview-8745--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.

Copy link
Copy Markdown

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

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: 5ac7d7798e

ℹ️ 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".

Comment thread internal/xds/translator/listener.go
Comment thread internal/gatewayapi/backendtlspolicy.go Outdated
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 72.64151% with 58 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.42%. Comparing base (85e62dd) to head (352c946).

Files with missing lines Patch % Lines
internal/xds/translator/translator.go 57.50% 10 Missing and 7 partials ⚠️
internal/xds/translator/sds.go 84.61% 8 Missing and 6 partials ⚠️
internal/gatewayapi/backendtlspolicy.go 71.79% 8 Missing and 3 partials ⚠️
internal/xds/translator/listener.go 57.69% 7 Missing and 4 partials ⚠️
internal/ir/xds.go 63.63% 2 Missing and 2 partials ⚠️
internal/gatewayapi/runner/runner.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #8745    +/-   ##
========================================
  Coverage   74.41%   74.42%            
========================================
  Files         245      246     +1     
  Lines       38977    39139   +162     
========================================
+ Hits        29006    29129   +123     
- Misses       7967     7991    +24     
- Partials     2004     2019    +15     

☔ 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 added 2 commits April 14, 2026 17:03
…ecret

Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
@owenhaynes
Copy link
Copy Markdown
Contributor

I am looking forward to this. I like the use of no new K8s types. I guess going to have to use some extra tooling so that the secrets can be in all namespaces that BackendTLSPolicy are defined due not being able to use cross reference, which is not a big issue

@zirain
Copy link
Copy Markdown
Member Author

zirain commented Apr 16, 2026

I am looking forward to this. I like the use of no new K8s types. I guess going to have to use some extra tooling so that the secrets can be in all namespaces that BackendTLSPolicy are defined due not being able to use cross reference, which is not a big issue

BackendTLSPolicy use LocalObjectReference, which make it unable to cross namespace reference.
Worth to raise this up on upstream.

Comment thread internal/gatewayapi/backendtlspolicy.go Outdated
Comment thread internal/gatewayapi/backendtlspolicy.go Outdated
Comment thread internal/xds/translator/sds.go Outdated
zirain added 2 commits April 18, 2026 19:22
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
const (
// SDSSecretType is the type for secrets that reference SDS configuration
SDSSecretType = "gateway.envoyproxy.io/sds-ref"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we make this opt in at EnvoyGateway or EnvoyProxy level ?
cc @guydc

type: gateway.envoyproxy.io/sds-ref
data:
url: L3Zhci9ydW4vc2VjcmV0cy93b3JrbG9hZC1zcGlmZmUtdWRzL3NvY2tldA== # /var/run/secrets/workload-spiffe-uds/socket
secretName: Uk9PVENB # ROOTCA
Copy link
Copy Markdown
Contributor

@arkodg arkodg Apr 18, 2026

Choose a reason for hiding this comment

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

non blocking: prefer just name
cc @guydc

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'd to reserve the name for sds provider name in the future, secretName sounds good to me for now.

Copy link
Copy Markdown
Member

@zhaohuabing zhaohuabing Apr 20, 2026

Choose a reason for hiding this comment

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

Using Name for the provider feels a bit ambiguous, and the naming patterns between the two are not consistent.

name: `foo provider`
secretName: `foo secret`
url: xxxxx

How about

provider: `foo provider`
secret: `foo secret`
url: xxxxx

Or

providerName: `foo provider`
secretName: `foo secret`
url: xxxxx

?

I prefer the former one for simplicity.

zirain added 2 commits April 20, 2026 09:33
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
// If set to true, the Lua EnvoyExtensionPolicy feature will be disabled.
DisableLua bool `json:"disableLua"`
// EnableSDSSecretRef enables read SDS(Secret Discovery Service) settings from a secret(with type gateway.envoyproxy.io/sds-ref).
EnableSDSSecretRef bool `json:"enableSDSSecretRef"`
Copy link
Copy Markdown
Member

@zhaohuabing zhaohuabing Apr 20, 2026

Choose a reason for hiding this comment

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

I think we are gating the broader "fetching certificates from third-party SDS" feature, not just the specific "SDS secret type"?

It might makes sense to use a more general name like EnableThirdPartySDS here.

cc @arkodg

Comment thread api/v1alpha1/shared_types.go Outdated

const (
// SDSSecretType is the type for secrets that reference SDS configuration
SDSSecretType = "gateway.envoyproxy.io/sds-ref"
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.

Non-blocking nit: gateway.envoyproxy.io/sds should be good enough?

Suggested change
SDSSecretType = "gateway.envoyproxy.io/sds-ref"
SDSSecretType = "gateway.envoyproxy.io/sds"

zirain added 2 commits April 21, 2026 17:09
Signed-off-by: zirain <zirain2009@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants