Skip to content

Commit

Permalink
controllers: removes throttling for vmagent and vmalert
Browse files Browse the repository at this point in the history
it's fine to skip throttle check for vmagent and vmalert objects, since it's unlikely that there will be a lot of such objects
for testing purpose it's highly recommended to setup env var VM_FORCERESYNCINTERVAL=2s , it should help mitigate possible issues with object throttling
it real world applications default resync interval = 60s should be fine
#533
  • Loading branch information
f41gh7 committed Oct 24, 2022
1 parent 2fbc6a7 commit 63ca52b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions controllers/vmagent_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ type VMAgentReconciler struct {
// +kubebuilder:rbac:groups="policy",resources=podsecuritypolicies,verbs=get;create,update;list
// +kubebuilder:rbac:groups="",resources=serviceaccounts,verbs=get;create,update;list
func (r *VMAgentReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
if vmAgentReconcileLimit.MustThrottleReconcile() {
// fast path, rate limited
return ctrl.Result{}, nil
}
reqLogger := r.Log.WithValues("vmagent", req.NamespacedName)
reqLogger.Info("Reconciling")

Expand Down
4 changes: 0 additions & 4 deletions controllers/vmalert_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ func (r *VMAlertReconciler) Scheme() *runtime.Scheme {
// +kubebuilder:rbac:groups=operator.victoriametrics.com,resources=vmalerts/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=operator.victoriametrics.com,resources=vmalerts/finalizers,verbs=*
func (r *VMAlertReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
if vmAlertRateLimiter.MustThrottleReconcile() {
// fast path
return ctrl.Result{}, nil
}
reqLogger := r.Log.WithValues("vmalert", req.NamespacedName)
reqLogger.Info("Reconciling")

Expand Down

0 comments on commit 63ca52b

Please sign in to comment.