kubernetes-sigs / kubernetes-sigs/controller-runtime
Shutdown manager if webhook & metrics server cert-watchers fail
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3k
- Forks
- 1.3k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 14
Description
Just recently noticed that the webhook & metrics server are starting certWatchers like this
go func() {
if err := certWatcher.Start(ctx); err != nil {
log.Error(err, "certificate watcher error")
}
}()
If the cert-watcher is failing we only log this error and that's it. As soon as the certs are rotated again the servers will use outdated certificates.
If this is somehow covered by a livenessProbe the manager will restart otherwise it won't.
I think we should look into how we can shutdown the manager / restart the binary if one of these cert-watchers fail.
One option might be to ensure the Start func of the servers return an error when the cert-watcher fails.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the certWatcher.Start(ctx) calls in the webhook and metrics server, then trace how those server Start functions are connected to the manager. Determine how a watcher failure should propagate so the manager shuts down or the binary restarts, and verify that failures are no longer only logged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100