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.
Just recently noticed that the webhook & metrics server are starting certWatchers like this
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
Startfunc of the servers return an error when the cert-watcher fails.