-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: grpc mTLS certificates are hot reloaded #6756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
/run-e2e |
I've tested this behavior on my local with 1 hour certs and it works, but I'm not fully sure about how to test this deterministically, as e2e tests can't ensure when the certificate has been updated without checking the logs, and that could be quite flaky. In the other hand, IDK how to unit test this as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces hot reloading for gRPC mTLS certificates by updating TLS credential loading and integrating a file watcher for certificate changes. Key changes include:
- Adding a context parameter to LoadGrpcTLSCredentials and updating its callers.
- Implementing a file watcher using fsnotify to detect certificate updates.
- Bumping the fsnotify dependency and updating the certificate generation command in BUILD.md.
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
pkg/metricsservice/utils/tls.go | Updated TLS credentials loading to support certificate hot reloading with fsnotify. |
pkg/metricsservice/server.go | Updated Start() method to pass context for TLS credentials. |
pkg/metricsservice/client.go | Updated NewGrpcClient() to pass context for TLS credentials. |
go.mod | Upgraded fsnotify dependency to v1.9.0. |
cmd/adapter/main.go | Updated to pass context to NewGrpcClient. |
CHANGELOG.md | Documented the certificate hot-reloading improvement. |
BUILD.md | Modified openssl command to include subjectAltName certificate extension. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great, few minor nits below
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
ab30b85
to
8abbf00
Compare
/run-e2e rabbit |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
* feat: grpc mTLS certificates are hot reloaded (#6756) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> * fix: temporal scaler was not setting up tls for apikey auth (#6781) * fix: temporal scaler was not setting up tls for apikey auth Signed-off-by: joaopaulosr95 <joaopaulosr95@gmail.com> * Update CHANGELOG.md Co-authored-by: Jan Wozniak <wozniak.jan@gmail.com> Signed-off-by: João Bastos <joaopaulosr95@gmail.com> --------- Signed-off-by: joaopaulosr95 <joaopaulosr95@gmail.com> Signed-off-by: João Bastos <joaopaulosr95@gmail.com> Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> Co-authored-by: Jan Wozniak <wozniak.jan@gmail.com> Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> * chore: changelog and issue template v2.17.2 Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> --------- Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> Signed-off-by: joaopaulosr95 <joaopaulosr95@gmail.com> Signed-off-by: João Bastos <joaopaulosr95@gmail.com> Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: João Bastos <joaopaulosr95@gmail.com>
Checklist