Skip to content

Commit

Permalink
Skip scale-down when nodegroup in backoff (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonincms authored Nov 24, 2023
1 parent 06a8f8d commit 26c973b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions controllers/scheduler_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,13 @@ func (r *SchedulerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
}
}

// If the scale up is in state backoff, skip scale down. It is
// needed since in Backoff the cluster-autoscaler will not increase
// the cloudProviderTarget, e.g. : Backoff (ready=0 cloudProviderTarget=0).
if targetStatus.ScaleUp.Status == clusterautoscaler.ScaleUpBackoff {
down = 0
}

// List instances already deployed by this scheduler
instances := &corev1alpha1.InstanceList{}
if err := r.List(ctx, instances, client.InNamespace(req.Namespace), client.MatchingLabels(map[string]string{lblScheduler: req.Name})); err != nil {
Expand Down

0 comments on commit 26c973b

Please sign in to comment.