Skip to content
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

Skip scale-down when nodegroup in backoff #260

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions controllers/scheduler_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,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