Skip to content

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

Merged
zirain merged 7 commits into
envoyproxy:mainfrom
zirain:sds-ref
Apr 22, 2026
Merged

feat: add support for certificate fetching via SDS ref secret#8745
zirain merged 7 commits into
envoyproxy:mainfrom
zirain:sds-ref

Conversation

@zirain

@zirain zirain commented Apr 14, 2026

Copy link
Copy Markdown
Member

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

netlify Bot commented Apr 14, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 0efb282
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/69e8cb7552eb260008593aa9
😎 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.

@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: 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

codecov Bot commented Apr 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.23077% with 84 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.63%. Comparing base (f33ec41) to head (0efb282).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/xds/translator/translator.go 50.98% 18 Missing and 7 partials ⚠️
internal/xds/translator/sds.go 82.60% 14 Missing and 6 partials ⚠️
internal/xds/translator/listener.go 50.00% 14 Missing and 4 partials ⚠️
internal/gatewayapi/backendtlspolicy.go 73.07% 11 Missing and 3 partials ⚠️
internal/ir/xds.go 57.14% 4 Missing and 2 partials ⚠️
internal/gatewayapi/runner/runner.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8745      +/-   ##
==========================================
- Coverage   73.64%   73.63%   -0.02%     
==========================================
  Files         245      246       +1     
  Lines       48864    49076     +212     
==========================================
+ Hits        35985    36135     +150     
- Misses      10874    10919      +45     
- Partials     2005     2022      +17     

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

@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

zirain commented Apr 16, 2026

Copy link
Copy Markdown
Member Author

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

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.

add EnableSDSSecretRef in EnvoyGateway.

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

@arkodg arkodg Apr 18, 2026

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.

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.

@zhaohuabing zhaohuabing Apr 20, 2026

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.

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.

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.

secretName sgtm

// 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"`

@zhaohuabing zhaohuabing Apr 20, 2026

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.

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

@arkodg arkodg left a comment

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.

LGTM thanks

@zirain
zirain requested review from guydc and zhaohuabing April 22, 2026 09:12

@guydc guydc left a comment

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.

LGTM!

zirain added 7 commits April 22, 2026 21:21
…ecret

Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
@zirain
zirain merged commit 30fa914 into envoyproxy:main Apr 22, 2026
62 of 64 checks passed
@zirain
zirain deleted the sds-ref branch April 22, 2026 22:57
@zirain zirain mentioned this pull request Apr 24, 2026
2 tasks
skos-ninja pushed a commit to skos-ninja/envoy-gateway that referenced this pull request May 1, 2026
…roxy#8745)

* feat: add support for certificate fetching and rotation via SDS ref secret

Signed-off-by: zirain <zirain2009@gmail.com>

* fix

Signed-off-by: zirain <zirain2009@gmail.com>

* fix review comments

Signed-off-by: zirain <zirain2009@gmail.com>

* fix lint

Signed-off-by: zirain <zirain2009@gmail.com>

* add EnableSDSSecretRef in EnvoyGateway

Signed-off-by: zirain <zirain2009@gmail.com>

* fix gen

Signed-off-by: zirain <zirain2009@gmail.com>

* rename

Signed-off-by: zirain <zirain2009@gmail.com>

---------

Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: Jake Oliver <jake@truelayer.com>
@owenhaynes

Copy link
Copy Markdown
Contributor

As there are no docs for this I am trying to understand from the testdata what spire-uds backend is used for as see no backendRefs which link to it.

Is this just a unnecessary resource currently or will be used later?

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.

6 participants