feat(webhook): support external TLS certificate - #200
Open
faganihajizada wants to merge 1 commit into
Open
Conversation
faganihajizada
requested review from
SkylerMalinowski,
alanmutsch,
catblade,
vivian-hafener and
wickberg
as code owners
May 27, 2026 12:29
Contributor
|
Good afternoon @faganihajizada, I will look into this. Best, |
Contributor
|
Good afternoon Fagani, When you have the chance, could you please rebase this against Thanks! Best, |
Adds a third webhook-TLS mode, `externalCertInjection`, mutually
exclusive with cert-manager and the existing self-signed `genCA` path.
When enabled, the chart renders neither a Secret nor any cert-manager
resources; the webhook Deployment mounts a pre-existing
`kubernetes.io/tls` Secret named by the user, and the webhook
configurations' `caBundle` is populated via Helm `lookup` at install
time. This lets organizations issue the webhook certificate from their
own PKI (Vault, AWS Private CA, external-secrets, an internal CA)
without the chart managing it
Changelog: Added - Helm chart values `externalCertInjection.{enabled,
secretName}` for the slurm-operator chart, allowing the webhook
serving certificate to be supplied via a pre-existing
`kubernetes.io/tls` Secret. Added `webhook.validatingAnnotations` and
`webhook.mutatingAnnotations` for cainjector-based `caBundle`
population.
faganihajizada
force-pushed
the
externalCertInjection
branch
from
August 6, 2026 06:50
23d6567 to
c414eb5
Compare
Contributor
Author
|
Hi @vivian-hafener, thanks! Done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a third webhook-TLS provisioning mode,
externalCertInjection, to theslurm-operatorHelm chart, allowing organizations to issue the webhook serving certificate from their own PKI (HashiCorp Vault, AWS Private CA, external-secrets-operator, an internal DigiCert intermediate, etc.). Instead of relying on cert-manager or the chart's Helm-generated self-signed (genCA) fallback. This closes the only remaining "we can't ship slurm-operator into our cluster as-is" objection from users who require corporate-CA-signed leaves on every in-cluster TLS endpoint.What the user gets
A new top-level values block:
And two annotation pass-through fields on the webhook configurations, for GitOps users who can't depend on Helm
lookup:The three TLS modes are mutually exclusive at template-render time
cert-manager (default, unchanged) —
certManager.enabled: true,externalCertInjection.enabled: false. The chart renders anIssuer+Certificate; cert-manager creates the Secret;cainjectorpopulatescaBundleon both webhook configurations via a chart-injected annotation. Cert rotation owner: cert-manager.Helm self-signed (unchanged) —
certManager.enabled: false,externalCertInjection.enabled: false. The chart renders a chart-ownedOpaqueSecret containinggenCA+genSignedCertmaterial and inlines its base64 intocaBundleat render time. Cert rotation owner: Helm, which re-rolls the CA on everyhelm upgrade.External (new) —
certManager.enabled: false,externalCertInjection.enabled: true,externalCertInjection.secretName: <user-set>. The chart renders no Secret and no cert-manager resources. The webhook Deployment mounts the user's pre-existingkubernetes.io/tlsSecret, andcaBundleis populated by Helmlookupreading the Secret'sca.crt. Cert rotation owner: the user's external PKI.A misconfigured combination (
certManager.enabled=trueandexternalCertInjection.enabled=true, orexternalCertInjection.enabled=truewith an emptysecretName) is rejected with a clear message during template rendering, before the user can apply a half-broken manifest set to the cluster.Checklist
Breaking Changes
N/A
Testing Notes
Automated checks
helm lint helm/slurm-operatorhelm unittest helm/slurm-operatormake helm-docsNew unit tests added
In
certmanager_pki_test.yaml:externalCertInjection.enabled=true— noIssuer, noCertificaterendered.certManager.enabled=true+externalCertInjection.enabled=true) — template render fails with the documented message.secretName(externalCertInjection.enabled=true,secretName="") — template render fails with the documented message.In
webhook_webhook_test.yaml:kubernetesProviderSecret —caBundleequalsb64enc(ca.crt)byte-exact on both Validating and Mutating configs.Opaque) — template render fails.tls.crt/tls.key/ca.crteach) — template render fails on each.webhook.validatingAnnotationsandwebhook.mutatingAnnotationskeys land on the right*WebhookConfiguration.null-tolerance —webhook.validatingAnnotations: nulldoes not panic the template.certManager.enabled=false, noannotations:block is emitted at all.End-to-end on a
kindv1.34 clusterVerified against the released
ghcr.io/slinkyproject/slurm-operator:1.1.0andslurm-operator-webhook:1.1.0images, with the chart pointed at the branch in this PR.Each scenario was verified end-to-end: chart install →
kubectl get *WebhookConfiguration -o jsonpath='{.webhooks[0].clientConfig.caBundle}'→ submit a realNodeSetadmission request → observe the webhook log the validation decision.Reproducing
Additional Context
Why the strict
validateModestemplate-render failure?Kyverno and Gatekeeper handle conflicting cert-provisioning flags either by documentation ("cert-manager takes precedence") or by trusting the user. Both have runtime cert-controllers that gracefully recover from inconsistent state. We don't — so a misconfiguration like
certManager.enabled=true+externalCertInjection.enabled=truewould render two Secrets with the same name and confuse the webhook.Why the cainjector annotation pass-through was promoted to a first-class field
Live testing surfaced a non-obvious blocker: cainjector refuses to read a Secret unless that Secret carries
cert-manager.io/allow-direct-injection: "true". Without it, the user ends up with the BYO mode silently disabled and the chart's self-signed mode silently re-enabled, producing a TLS-handshake mismatch that's diagnosable only by reading both pod logs and cert-manager logs side by side.