Documentation ¶
Overview ¶
Package ratelimiter contains suggested default ratelimiters for Crossplane.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BucketRateLimiter ¶ added in v1.18.0
type BucketRateLimiter = workqueue.TypedBucketRateLimiter[string]
BucketRateLimiter for a standard crossplane reconciler.
func NewGlobal ¶ added in v0.16.0
func NewGlobal(rps int) *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.
type ControllerRateLimiter ¶ added in v1.18.0
type ControllerRateLimiter = workqueue.TypedRateLimiter[reconcile.Request]
ControllerRateLimiter to work with sigs.k8s.io/controller-runtime/pkg/controller.Options.
func NewController ¶ added in v0.16.0
func NewController() ControllerRateLimiter
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.
type RateLimiter ¶ added in v1.18.0
type RateLimiter = workqueue.TypedRateLimiter[string]
RateLimiter for a standard crossplane reconciler.
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) *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.