Documentation ¶
Overview ¶
Package ratelimiter contains suggested default ratelimiters for Crossplane.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LimitRESTConfig ¶ added in v0.16.0
LimitRESTConfig returns a copy of the supplied REST config with rate limits derived from the supplied rate of reconciles per second.
func NewController ¶ added in v0.16.0
func NewController() ratelimiter.RateLimiter
NewController returns a rate limiter that takes the maximum delay between the passed rate limiter and a per-item exponential backoff limiter. The exponential backoff limiter has a base delay of 1s and a maximum of 60s.
func NewGlobal ¶ added in v0.16.0
func NewGlobal(rps int) *workqueue.BucketRateLimiter
NewGlobal returns a token bucket rate limiter meant for limiting the number of average total requeues per second for all controllers registered with a controller manager. The bucket size (i.e. allowed burst) is rps * 10.
Types ¶
type Reconciler ¶ added in v0.16.0
type Reconciler struct {
// contains filtered or unexported fields
}
A Reconciler rate limits an inner, wrapped Reconciler. Requests that are rate limited immediately return RequeueAfter: d without calling the wrapped Reconciler, where d is imposed by the rate limiter.
func NewReconciler ¶ added in v0.16.0
func NewReconciler(name string, r reconcile.Reconciler, l ratelimiter.RateLimiter) *Reconciler
NewReconciler wraps the supplied Reconciler, ensuring requests are passed to it no more frequently than the supplied RateLimiter allows. Multiple uniquely named Reconcilers can share the same RateLimiter.