Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #2502 from mwielgus/ca-starting-fix
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Cluster-autoscaler: Fix isNodeStarting

Fix for: kubernetes/kubernetes#43709

cc: @MaciekPytel @fgrzadkowski
  • Loading branch information
Kubernetes Submit Queue authored Mar 28, 2017
2 parents 97c4d19 + 65e136e commit a74a141
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cluster-autoscaler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ifndef REGISTRY
$(ERR)
endif
docker build --pull -t ${REGISTRY}/cluster-autoscaler:${TAG} .
gcloud docker push ${REGISTRY}/cluster-autoscaler:${TAG}
gcloud docker -- push ${REGISTRY}/cluster-autoscaler:${TAG}

clean:
rm -f cluster-autoscaler
Expand Down
12 changes: 11 additions & 1 deletion cluster-autoscaler/clusterstate/clusterstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const (

// MaxStatusSettingDelayAfterCreation is the maximum time for node to set its initial status after the
// node is registered.
MaxStatusSettingDelayAfterCreation = time.Minute
MaxStatusSettingDelayAfterCreation = 2 * time.Minute
)

// ScaleUpRequest contains information about the requested node group scale up.
Expand Down Expand Up @@ -615,6 +615,16 @@ func isNodeNotStarted(node *apiv1.Node) bool {
condition.LastTransitionTime.Time.Sub(node.CreationTimestamp.Time) < MaxStatusSettingDelayAfterCreation {
return true
}
if condition.Type == apiv1.NodeOutOfDisk &&
condition.Status == apiv1.ConditionTrue &&
condition.LastTransitionTime.Time.Sub(node.CreationTimestamp.Time) < MaxStatusSettingDelayAfterCreation {
return true
}
if condition.Type == apiv1.NodeNetworkUnavailable &&
condition.Status == apiv1.ConditionTrue &&
condition.LastTransitionTime.Time.Sub(node.CreationTimestamp.Time) < MaxStatusSettingDelayAfterCreation {
return true
}
}
return false
}
Expand Down
7 changes: 6 additions & 1 deletion cluster-autoscaler/core/scale_up.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func ScaleUp(context *AutoscalingContext, unschedulablePods []*apiv1.Pod, nodes
upcomingNodes = append(upcomingNodes, nodeTemplate)
}
}
glog.V(4).Infof("Upcoming %d nodes", len(upcomingNodes))

podsRemainUnschedulable := make(map[*apiv1.Pod]bool)
expansionOptions := make([]expander.Option, 0)
Expand Down Expand Up @@ -119,12 +120,16 @@ func ScaleUp(context *AutoscalingContext, unschedulablePods []*apiv1.Pod, nodes
}
if option.NodeCount > 0 {
expansionOptions = append(expansionOptions, option)
} else {
glog.V(2).Infof("No need for any nodes in %s", nodeGroup.Id())
}
} else {
glog.V(4).Info("No pod can fit to %s", nodeGroup.Id())
}
}

if len(expansionOptions) == 0 {
glog.V(1).Info("No node group can help with pending pods.")
glog.V(1).Info("No expansion options")
for pod, unschedulable := range podsRemainUnschedulable {
if unschedulable {
context.Recorder.Event(pod, apiv1.EventTypeNormal, "NotTriggerScaleUp",
Expand Down
4 changes: 4 additions & 0 deletions cluster-autoscaler/core/static_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,16 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) {
// in the describe situation.
schedulablePodsPresent := false
if a.VerifyUnschedulablePods {

glog.V(4).Infof("Filtering out schedulables")
newUnschedulablePodsToHelp := FilterOutSchedulable(unschedulablePodsToHelp, readyNodes, allScheduled,
a.PredicateChecker)

if len(newUnschedulablePodsToHelp) != len(unschedulablePodsToHelp) {
glog.V(2).Info("Schedulable pods present")
schedulablePodsPresent = true
} else {
glog.V(4).Info("No schedulable pods")
}
unschedulablePodsToHelp = newUnschedulablePodsToHelp
}
Expand Down

0 comments on commit a74a141

Please sign in to comment.