Skip to content

docs(proposals): add KEP-3165 for filesystem webhook certificates - #3166

Draft
shubhM13 wants to merge 1 commit into
kubeflow:masterfrom
shubhM13:kep/filesystem-webhook-certificates
Draft

shubhM13 wants to merge 1 commit into
kubeflow:masterfrom
shubhM13:kep/filesystem-webhook-certificates

Conversation

@shubhM13

@shubhM13 shubhM13 commented Sep 13, 2026

Copy link
Copy Markdown

Purpose of this PR

This adds the provisional design document for #3165. The Spark Operator webhook
currently obtains serving certificates through its self-signed or cert-manager
paths, both of which assume certificate material is stored in a Kubernetes
Secret and copied into the serving directory. Clusters whose platform PKI
delivers short-lived certificates directly as files have no supported path that
preserves live rotation and avoids unnecessary Secret ownership.

Proposed changes:

  • Define an opt-in filesystem certificate provider while preserving the
    existing self-signed default and cert-manager compatibility flag.
  • Separate serving-certificate source from admission caBundle ownership, with
    exactly one operator or external writer.
  • Specify validated hot reload, CA overlap, readiness, migration, rollback,
    least-privilege RBAC, observability, and test requirements.
  • Record the controller-runtime watcher behavior that needs maintainer direction
    before implementation.

Fixes #3165

Change Category

  • Bugfix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that could affect existing functionality)
  • Documentation update

Rationale

Admission webhooks are fail-closed, and serving-certificate and trust rotation
span filesystem generations, two admission objects, API-server propagation, and
multiple webhook replicas. Agreeing on the ownership and rotation contract
before implementation avoids encoding an unsafe or incompatible API.

The two points where maintainer direction is most useful are in
Open Questions:

  1. Whether to enhance controller-runtime's certificate watcher or approve a
    small bounded polling loader in Spark Operator.
  2. Whether the initial chart should support generic injector annotations,
    static CA PEM, or only out-of-band external ownership.

Checklist

  • I have conducted a self-review of my own code.
  • I have updated documentation accordingly.
  • I have added tests that prove my changes are effective or that my feature works.
  • Existing unit tests pass locally with my changes.

Additional Notes

Documentation-only change; no production code or generated manifests are
modified, so unit tests were not run.

Validation performed locally:

  • All local Markdown links resolve.
  • git diff --check passes.
  • The signed-off commit is based directly on current upstream/master.

@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chenyi015 for approval. For more information see the Kubernetes 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

Signed-off-by: Shubham Mishra <smishra.shubhammishra@gmail.com>
@shubhM13
shubhM13 force-pushed the kep/filesystem-webhook-certificates branch from 4170196 to 0e0bb22 Compare September 13, 2026 17:15

@tariq-hasan tariq-hasan 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.

Hi @shubhM13! Thanks for raising the PR. I have added some initial comments - mostly around the scope covered by the KEP.

Comment on lines +86 to +88
- [#2502](https://github.com/kubeflow/spark-operator/issues/2502) tracks future
webhook deprecation. Existing supported releases still require safe TLS
operation until that work is complete.

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'm actually wondering if we'd want to deprecate webhook altogether - since the webhooks are now used not only for pod mutation but also for CRD mutation and validation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Agree! the issue was closed as not planned #2502

Comment on lines +64 to +78
An external PKI already owns certificate issuance, private-key rotation, and
renewal. Requiring that material to pass through the current self-signed or
cert-manager paths creates one or more of the following problems:

- A second component becomes responsible for a private key.
- The webhook retains Secret permissions it does not need.
- Certificate files are copied only at startup and do not follow renewal.
- A pod restart is required to serve a renewed certificate.
- Each external-PKI installation maintains a security-sensitive downstream
patch.

Admission webhooks are fail-closed by default. A serving-certificate or CA
rotation mistake can therefore prevent unrelated Kubernetes API operations.
The upstream contract needs to define ownership, validation, overlap, and
rollback rather than merely adding a flag that skips certificate generation.

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.

It appears that a filesystem provider was already supported before v2 but was removed - #2016. The removal seems to be owed to the fact that bootstrap mechanism was prone to lead to failure modes - #855, #926, #1705, #1739, #1740, #2032, #2281.

Since the KEP addresses the various gaps by reshaping filesystem provision I am thinking this may warrant a callout in the motivation section.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks! I’ll add a motivation callout distinguishing the previous mechanism from this proposal’s read-only external filesystem consumer and connect the relevant historical failures to the proposed safeguards.

Comment on lines +118 to +132
Add `filesystem` alongside the current self-signed and cert-manager certificate
sources. The filesystem provider reads a serving certificate chain, private key,
and minimal CA bundle from configurable paths. It does not persist or copy the
external private key.

Certificate source and CA publication are selected independently:

- **Operator-owned CA publication:** the existing admission-configuration
controllers publish the validated CA bundle.
- **External CA publication:** the Spark Operator does not read or write the
admission configurations for certificate management. An injector, Helm,
GitOps controller, or administrator owns the fields.

Exactly one CA writer is allowed. The binary and chart reject combinations that
would create two writers.

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.

At the same time I am wondering if we want to break down the scope of the KEP into multiple phases, and for phase 1, to only support filesystem serving identity with external CA ownership, and to retain full CA reconciliation as part of a phase 2 discussion. Would appreciate thoughts from @nabuskey @RobuRishabh @vjanelle @vikas-saxena02 as well.

@sxivansx sxivansx mentioned this pull request Sep 18, 2026
8 tasks
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.

Support externally managed filesystem certificates for the webhook

2 participants