Repository navigation
Description
Pre-submission checklist
- I have searched existing issues and confirmed this is not a duplicate.
Description
kargo-api and the external webhooks server load their TLS serving certificate once at startup and never reload it. Both call http.Server.ServeTLS(listener, certPath, keyPath) without setting TLSConfig.GetCertificate, so the certificate files are read once when the server starts:
pkg/server/server.go(TLS_CERT_PATH/TLS_KEY_PATH)pkg/webhook/external/server.go(same variables)
When the certificate in the mounted Secret is renewed (by cert-manager, or any other rotation of a provided Secret), the kubelet updates the files on disk, but the running server keeps serving the old certificate. With the chart defaults (api.tls.enabled: true, externalWebhooksServer.tls.enabled: true, selfSignedCert: true), cert-manager renews these certificates at about 60 days and they expire at 90 days. A Pod that runs past the old certificate's expiry serves an expired certificate until it is restarted.
The Kubernetes webhooks server is not affected: controller-runtime's webhook server watches and reloads its certificate.
Found by code inspection while working on #6866, which is the same class of problem for kargo-api's trust of Dex's certificate (fixed in #8091).
Steps to Reproduce
- Install the chart with the defaults (TLS enabled on the API server and external webhooks server, self-signed certificates).
- Force cert-manager to reissue the
kargo-apiCertificate, e.g. by deleting its Secret, and wait for the kubelet to update the mounted files. - Inspect the certificate served on the API server's port (e.g.
openssl s_client -connect <host>:<port>). It is still the old certificate.
Expected Behavior
Both servers pick up a renewed certificate from disk without a restart, e.g. by serving through a tls.Config whose GetCertificate returns a certificate that is reloaded when the files change. controller-runtime's certwatcher already does this.
Actual Behavior
Both servers keep serving the certificate they loaded at startup until the Pod restarts, including after that certificate has expired.
Kargo Version
main (also present in release-1.12)
Activity
kargo-governance-bot commentedon Nov 30, 2026
Before Starting Work
Thank you for opening this issue.
Please do not start work on this issue, and please do not ask to be assigned to it, until a maintainer has triaged it and cleared it for contribution. This applies to bug reports too. A maintainer needs to confirm a bug, and usually reproduce it, before a fix is worth writing.
An issue is cleared for contribution when none of the blocking labels remain on it. Pull requests that reference an issue that has not been cleared are automatically converted to drafts, which maintainers do not routinely review.
Maintainers triage issues on a best-effort basis. See the Contributor Guide for details.