Skip to content

feat: add support for certificate fetching and rotation via SDS server#8537

Open
zirain wants to merge 6 commits intoenvoyproxy:mainfrom
zirain:sds
Open

feat: add support for certificate fetching and rotation via SDS server#8537
zirain wants to merge 6 commits intoenvoyproxy:mainfrom
zirain:sds

Conversation

@zirain
Copy link
Member

@zirain zirain commented Mar 17, 2026

fixes: #6366

The idea is introduce a new API SDS in EnvoyProxy to define an external SDS server.

  • It could be a Service or Backend
  • Users could use kind: SDS incaCertificateRefs or clientCertificateRef, name will be used to fetch certificate from (external) SDS server.

@netlify
Copy link

netlify bot commented Mar 17, 2026

Deploy Preview for cerulean-figolla-1f9435 ready!

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

// such as the SPIRE or others.
//
// +optional
SDS *SDSProvider `json:"sds,omitempty"`
Copy link
Member Author

Choose a reason for hiding this comment

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

do we need to support multiple SDS here?

Choose a reason for hiding this comment

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

probably safer to do a list

Copy link
Member Author

Choose a reason for hiding this comment

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

In that case, we need to figure out how to reference to specific sds provider in clientCertificateRef:

caCertificateRefs:
- name: ROOTCA
  kind: SDS

we probably need something like sds-provider-name://ROOTCA but which make thing more complex, becasue we use BackendObjectReference/BackendCluster to reference the backend, there's no provider name.

Copy link
Contributor

Choose a reason for hiding this comment

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

we rely on parentRef like semantics

Copy link
Member Author

Choose a reason for hiding this comment

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

AFAIT, CACertificateRefs uses gwapiv1.SecretObjectReference or gwapiv1.LocalObjectReference.

@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 72.83951% with 44 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@cc23457). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/provider/kubernetes/controller.go 17.64% 26 Missing and 2 partials ⚠️
internal/gatewayapi/backendtlspolicy.go 82.45% 8 Missing and 2 partials ⚠️
internal/gatewayapi/listener.go 92.85% 2 Missing ⚠️
internal/xds/translator/sds.go 93.10% 1 Missing and 1 partial ⚠️
internal/xds/translator/translator.go 85.71% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8537   +/-   ##
=======================================
  Coverage        ?   74.19%           
=======================================
  Files           ?      243           
  Lines           ?    37727           
  Branches        ?        0           
=======================================
  Hits            ?    27991           
  Misses          ?     7782           
  Partials        ?     1954           

☔ 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 6 commits March 18, 2026 10:23
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
@zirain zirain marked this pull request as ready for review March 18, 2026 02:23
@zirain zirain requested a review from a team as a code owner March 18, 2026 02:23
@zirain zirain added this to the v1.8.0-rc.1 Release milestone Mar 19, 2026
// such as the SPIRE or others.
type SDSProvider struct {
// BackendObjectReference references a Kubernetes object that represents the backend.
gwapiv1.BackendObjectReference `json:",inline"`
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldnt this be

type BackendCluster struct {
?

Copy link
Member Author

Choose a reason for hiding this comment

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

this related to #8537 (comment)

// Name of the Secret object.
Name string `json:"name" yaml:"name"`
Name string `json:"name" yaml:"name"`
FromSDS *bool `json:"fromSDS,omitempty" yaml:"fromSDS,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

does this need to be a named sds string ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have no strong option about use a SDSName instead of the combination of FromSDS+Name.

// such as the SPIRE or others.
//
// +optional
SDS *SDSProvider `json:"sds,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

also needs smething like https://gateway-api.sigs.k8s.io/reference/1.5/spec/#allowedroutes to allow which namespaces and BTLSP can reference it

Copy link
Member Author

Choose a reason for hiding this comment

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

Under what conditions, we need to limit a BTLSP reference to SDS provider.

Copy link
Contributor

Choose a reason for hiding this comment

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

we dont want an unknown app to reference an sds secret unless allowed by the platform team

Copy link
Member Author

Choose a reason for hiding this comment

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

this could be done in the next iterater or later.
Let's focus on #8537 (comment) first, do we really need mutiple SDS providers, and how will the API looks like.

// such as the SPIRE or others.
type SDSProvider struct {
// BackendObjectReference references a Kubernetes object that represents the backend.
gwapiv1.BackendObjectReference `json:",inline"`
Copy link
Member

Choose a reason for hiding this comment

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

should we validate if it is a Service or Backend?

Copy link
Member Author

Choose a reason for hiding this comment

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

we should, let's make an agreement about should this be multiple or not first.

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.

Feat: Native support for certificate fetching and rotation via SDS server

4 participants