-
Notifications
You must be signed in to change notification settings - Fork 173
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
VAULT-2230 Only update webhooks CA bundle when needed #336
Conversation
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.
LGTM!
Thanks for the suggestions. This is ready for review again. I've switched to using an informer. |
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.
Worked great for me when testing locally. Left a couple thoughts, but I think this is good.
8033400
to
e3c5f24
Compare
@calvn let me know if you want to take another look |
Instead of every second. Specifically, we now only update the webhooks bundle if: * we have generated a certificate and the CA bundle does not match the current webhook CA bundle; this will also happen if a new leader is elected, or * the webhook itself was changed (e.g., by a helm upgrade), checked by `Watch`ing the webhooks. In any case, will only send the `Patch` if the CA bundle on the webhook no longer matches our own CA bundle. This was tested by performing a `helm upgrade` with a webhook change and verifying that the webhook change was noticed and the CA bundle was patched, and also by setting the certificate lifetimes very low and making sure that the CA bundle was *not* patched (since the CA did not change when the certificate was regenerated). Fixes #332.
Also use the cache attached to it instead of querying the API ourselves.
* Use exponential backoff * Also simplify retry immediate logic * Remove namespace from mutating webhooks
e3c5f24
to
d484cfa
Compare
Thanks! |
Instead of every second. Specifically, we now only update the webhooks
bundle if:
current webhook CA bundle; this will also happen if a new leader is
elected, or
Watch
ing the webhooks.In any case, will only send the
Patch
if the CA bundle on thewebhook no longer matches our own CA bundle.
This was tested by performing a
helm upgrade
with a webhook change andverifying that the webhook change was noticed and the CA bundle was
patched, and also by setting the certificate lifetimes very low and
making sure that the CA bundle was not patched (since the CA did not
change when the certificate was regenerated).
Fixes #332.