-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
csr: add resync to csr approver #49788
Conversation
@@ -33,6 +34,10 @@ import ( | |||
"k8s.io/kubernetes/pkg/features" | |||
) | |||
|
|||
// Changes outside of the kubernetes universe could cause the approval decision | |||
// to change. We get around this be frequently resyncing. |
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.
I definitely wouldn't expect resyncs this frequently
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.
Picked 15 seconds for initial testing but I was hoping to discuss what would be reasonable in this review. What do you think?
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.
Our use case is sometimes nodes post a CSR before the RBAC role bindings are initialize during cluster start up. In that particular case, 15s would be great. In the more general case, a few minutes seems appropriate.
If there are a lot of CSRs in the system, they will all be reprocessed with each resync, right? Approved/Denied ones will be quickly processed, but they will all go through this queue each cycle, right?
@@ -33,6 +34,10 @@ import ( | |||
"k8s.io/kubernetes/pkg/features" | |||
) | |||
|
|||
// Changes outside of the kubernetes universe could cause the approval decision |
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.
More like outside the state of this controller. Adding a new RBAC role binding is not exactly outside the Kubernetes universe.
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.
Not just rbac. An IAM change could require resyncing the controller.
@liggitt @jcbsmpsn I pushed an alternative approach that relies on the controller default backoff which is: // DefaultControllerRateLimiter is a no-arg constructor for a default rate limiter for a workqueue. It has
// both overall and per-item rate limitting. The overall is a token bucket and the per-item is exponential
func DefaultControllerRateLimiter() RateLimiter {
return NewMaxOfRateLimiter(
NewItemExponentialFailureRateLimiter(5*time.Millisecond, 1000*time.Second),
// 10 qps, 100 bucket size. This is only for retry speed and its only the overall factor (not per item)
&BucketRateLimiter{Bucket: ratelimit.NewBucketWithRate(float64(10), int64(100))},
)
} Basically recognized certificates will be continuously with a backoff to ~15 minutes. |
d26f7f3
to
dd6c32a
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jcbsmpsn, mikedanese Associated issue: 49787 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest Review the full test history for this PR. |
/retest Review the full test history for this PR. |
Automatic merge from submit-queue (batch tested with PRs 49615, 49321, 49982, 49788, 50355) |
Removing label |
Commit found in the "release-1.7" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
fixes #49787