-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add periodSeconds logic #368
Conversation
|
||
scaleUp_stabilizationWindow := time.Duration(vsp.Spec.Behavior.ScaleUp.StabilizationWindowSeconds) * time.Second | ||
scaleDown_stabilizationWindow := time.Duration(vsp.Spec.Behavior.ScaleDown.StabilizationWindowSeconds) * time.Second | ||
|
||
// If there is a larger instance type available, check if we want to vertically scale up the IG | ||
if hasLargerInstanceType && vsp.Status != nil && time.Since(vsp.Status.TargetStatuses[igName].LastTransitionTime.Time) > scaleUp_stabilizationWindow { | ||
if hasLargerInstanceType && vsp.Status != nil && time.Since(vsp.Status.TargetStatuses[namespacedIGName].LastTransitionTime.Time) > scaleUp_stabilizationWindow { | ||
nextBiggerInstance := instanceTypeRange.InstanceTypes[currInstanceTypeIndex+1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create and use a nextSmallerInstance with valueinstanceTypeRange.InstanceTypes[currInstanceTypeIndex-1]
as well?
} | ||
|
||
if time.Since(memoryAboveScaleUpThreshold.LastTransitionTime.Time) > time.Duration(scaleUpOnMemoryUtilizationPolicy.PeriodSeconds) { | ||
r.ManagerContext.ComputedTypes[namespacedIGName] = instanceTypeRange.InstanceTypes[currInstanceTypeIndex+1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use nextBiggerInstance here
} | ||
} | ||
} | ||
|
||
vsp.Status.TargetStatuses[namespacedIGName] = &v1alpha1.TargetStatus{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is outside of the nil check for vsp.Status
so we should check here as well?
No description provided.