Wire certwatcher for dynamic client TLS cert reloading#16
Open
cahillsf wants to merge 1 commit into
Open
Conversation
54359c8 to
eafe635
Compare
e9f498b to
18ab4a7
Compare
Emissary rotates TLS certs on disk via atomic symlink swaps, but Crossplane's client mTLS config was loaded once at startup. This adds a controller-runtime certwatcher to dynamically reload client certs and CA on rotation, eliminating the need for manual rollout restarts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
eafe635 to
e5ee6fd
Compare
Base automatically changed from
stephen.cahill/CLOUDR-1422-custom-function-dns
to
v2.2-dd
May 5, 2026 14:18
Author
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.
Description of your changes
When Emissary rotates TLS certs on disk via atomic symlink swaps, Crossplane's client mTLS config (used for gRPC connections to Functions) was loaded once at startup and never reloaded. This required manual
kubectl rollout restartto pick up new certs.This wires controller-runtime's
certwatcherinto the client TLS config path:certwatcherfor the client cert+key files (fsnotify + 10s polling fallback)GetClientCertificateon thetls.Configso each TLS handshake uses the latest cached certRootCAswhen the cert rotates (works with Emissary's atomic symlink swap since all files rotate together)mgr.Add()for proper lifecycle managementNote: server-side webhook certs already reload dynamically — controller-runtime's webhook server sets up its own certwatcher internally.
Builds on top of # which added support for reading TLS certs from disk.
Fixes #
I have:
Run./nix.sh flake checkto ensure this PR is ready for review.Added or updated unit tests.Added or updated e2e tests.Linked a PR or a docs tracking issue to document this change.Addedbackport release-x.ylabels to auto-backport this PR.Followed the API promotion workflow if this PR introduces, removes, or promotes an API.