Fixing nits: renamed newPodScaleUpBuffer -> newPodScaleUpDelay, deleted redundant comment
Change-Id: I7969194d8e07e2fb34029d0d7990341c891d0623
This commit is contained in:
parent
33b93cbc5f
commit
56b5456269
|
|
@ -116,5 +116,5 @@ type AutoscalingOptions struct {
|
|||
// Regional tells whether the cluster is regional.
|
||||
Regional bool
|
||||
// Pods newer than this will not be considered as unschedulable for scale-up.
|
||||
NewPodScaleUpBuffer time.Duration
|
||||
NewPodScaleUpDelay time.Duration
|
||||
}
|
||||
|
|
|
|||
|
|
@ -358,11 +358,10 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) errors.AutoscalerError
|
|||
return nil
|
||||
}
|
||||
|
||||
// don't consider pods newer than newPodScaleUpBuffer seconds old as unschedulable
|
||||
// don't consider pods newer than newPodScaleUpDelay seconds old as unschedulable
|
||||
func (a *StaticAutoscaler) filterOutYoungPods(allUnschedulablePods []*apiv1.Pod, currentTime time.Time) []*apiv1.Pod {
|
||||
// only consider unschedulable pods older than X
|
||||
var oldUnschedulablePods []*apiv1.Pod
|
||||
newPodScaleUpBuffer := a.AutoscalingOptions.NewPodScaleUpBuffer
|
||||
newPodScaleUpBuffer := a.AutoscalingOptions.NewPodScaleUpDelay
|
||||
for _, pod := range allUnschedulablePods {
|
||||
podAge := currentTime.Sub(pod.CreationTimestamp.Time)
|
||||
if podAge > newPodScaleUpBuffer {
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ var (
|
|||
unremovableNodeRecheckTimeout = flag.Duration("unremovable-node-recheck-timeout", 5*time.Minute, "The timeout before we check again a node that couldn't be removed before")
|
||||
expendablePodsPriorityCutoff = flag.Int("expendable-pods-priority-cutoff", -10, "Pods with priority below cutoff will be expendable. They can be killed without any consideration during scale down and they don't cause scale up. Pods with null priority (PodPriority disabled) are non expendable.")
|
||||
regional = flag.Bool("regional", false, "Cluster is regional.")
|
||||
newPodScaleUpBuffer = flag.Duration("new-pod-scale-up-buffer", 0*time.Second, "Pods less than this many seconds old will not be considered for scale-up.")
|
||||
newPodScaleUpDelay = flag.Duration("new-pod-scale-up-delay", 0*time.Second, "Pods less than this old will not be considered for scale-up.")
|
||||
)
|
||||
|
||||
func createAutoscalingOptions() config.AutoscalingOptions {
|
||||
|
|
@ -206,7 +206,7 @@ func createAutoscalingOptions() config.AutoscalingOptions {
|
|||
UnremovableNodeRecheckTimeout: *unremovableNodeRecheckTimeout,
|
||||
ExpendablePodsPriorityCutoff: *expendablePodsPriorityCutoff,
|
||||
Regional: *regional,
|
||||
NewPodScaleUpBuffer: *newPodScaleUpBuffer,
|
||||
NewPodScaleUpDelay: *newPodScaleUpDelay,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue