Skip to content

Commit

Permalink
Stop waiting for upcoming nodes from unhealthy node groups
Browse files Browse the repository at this point in the history
  • Loading branch information
mvisonneau committed May 2, 2019
1 parent a6c109f commit 2a8529d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cluster-autoscaler/core/scale_up.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,20 @@ func ScaleUp(context *context.AutoscalingContext, processors *ca_processors.Auto
}

upcomingNodes := make([]*schedulernodeinfo.NodeInfo, 0)
for nodeGroup, numberOfNodes := range clusterStateRegistry.GetUpcomingNodes() {
nodeTemplate, found := nodeInfos[nodeGroup]
for nodeGroupID, numberOfNodes := range clusterStateRegistry.GetUpcomingNodes() {
nodeTemplate, found := nodeInfos[nodeGroupID]
if !found {
return &status.ScaleUpStatus{Result: status.ScaleUpError}, errors.NewAutoscalerError(
errors.InternalError,
"failed to find template node for node group %s",
nodeGroup)
nodeGroupID)
}
for i := 0; i < numberOfNodes; i++ {
upcomingNodes = append(upcomingNodes, nodeTemplate)

// We do not consider upcoming nodes from unhealthy nodegroups
if clusterStateRegistry.IsNodeGroupHealthy(nodeGroupID) {
for i := 0; i < numberOfNodes; i++ {
upcomingNodes = append(upcomingNodes, nodeTemplate)
}
}
}
klog.V(4).Infof("Upcoming %d nodes", len(upcomingNodes))
Expand Down

0 comments on commit 2a8529d

Please sign in to comment.