This repository has been archived by the owner on Dec 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…t (fixed), and/or instance percentage.
@ichekrygin thanks a lot, actually I wanted to add the same anyway for our test clusters (where can scale down more than one instance at a time). |
hjacobs
reviewed
Dec 13, 2017
for resource in RESOURCES: | ||
parser.add_argument('--buffer-{}-percentage'.format(resource), type=float, | ||
help='{} buffer %%'.format(resource.capitalize()), | ||
default=os.getenv('BUFFER_{}_PERCENTAGE'.format(resource.upper()), DEFAULT_BUFFER_PERCENTAGE[resource])) | ||
parser.add_argument('--buffer-{}-fixed'.format(resource), type=str, | ||
help='{} buffer (fixed amount)'.format(resource.capitalize()), | ||
default=os.getenv('BUFFER_{}_FIXED'.format(resource.upper()), DEFAULT_BUFFER_FIXED[resource])) | ||
|
||
parser.add_argument('--scale-down-step-fixed', |
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.
I would add some os.getenv
default (similar to the --buffer-*
options) as we are configuring our downscaler via a config map (envFrom
).
hjacobs
reviewed
Dec 15, 2017
kube_aws_autoscaler/main.py
Outdated
help='Scale down strategy expressed in terms of instances count, defaults to 1. Note: value must be >= 1', | ||
type=int, default=os.getenv('SCALE_DOWN_STEP_FIXED', 1)) | ||
parser.add_argument('--scale-down-step-percentage', | ||
help='Scale down strategy expressed in terms of instances count, defaults to 0.01, i.e. 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.
the default is 0.0, but the help says 0.01 😏
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.
ah... nice catch.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Adding scale down functionality as per enhancement request #31.
Scale down step is expressed in:
1
[0.0, 1.0)
and defaults to0.0
Logic
These values are used in
slow_down_downscale
with following logic:There are two
new_desired_size
values are computed:new_desired_size_fixed
andnew_desired_size_percentage
new_desired_size_fixed
is computed as previously defined by subtractingscale_down_step_fixed
fromnodes_count
new_desired_size_percentage
is computed as a rounded up percentage value of thenode_count
new_desired_size
is set to a smallest value from the two above