Configurable scale velocity for HPA#883
Conversation
|
Hi @gliush. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/ok-to-test |
keps/sig-autoscaling/20190307-configurable-scale-velocity-for-hpa.md
Outdated
Show resolved
Hide resolved
|
@thockin Could you review the api change here? |
keps/sig-autoscaling/20190307-configurable-scale-velocity-for-hpa.md
Outdated
Show resolved
Hide resolved
keps/sig-autoscaling/20190307-configurable-scale-velocity-for-hpa.md
Outdated
Show resolved
Hide resolved
keps/sig-autoscaling/20190307-configurable-scale-velocity-for-hpa.md
Outdated
Show resolved
Hide resolved
* Adds "delaySeconds" field into the HPA constraints * Makes sure that it could be configured by the "stabilization window" command line argument * Adds user story * Fixes typos
keps/sig-autoscaling/20190307-configurable-scale-velocity-for-hpa.md
Outdated
Show resolved
Hide resolved
keps/sig-autoscaling/20190307-configurable-scale-velocity-for-hpa.md
Outdated
Show resolved
Hide resolved
keps/sig-autoscaling/20190307-configurable-scale-velocity-for-hpa.md
Outdated
Show resolved
Hide resolved
keps/sig-autoscaling/20190307-configurable-scale-velocity-for-hpa.md
Outdated
Show resolved
Hide resolved
keps/sig-autoscaling/20190307-configurable-scale-velocity-for-hpa.md
Outdated
Show resolved
Hide resolved
keps/sig-autoscaling/20190307-configurable-scale-velocity-for-hpa.md
Outdated
Show resolved
Hide resolved
keps/sig-autoscaling/20190307-configurable-scale-velocity-for-hpa.md
Outdated
Show resolved
Hide resolved
Fixes typos Use another default values Some additional explanations added
keps/sig-autoscaling/20190307-configurable-scale-velocity-for-hpa.md
Outdated
Show resolved
Hide resolved
Also adds new section for the delay option
|
@josephburnett: changing LGTM is restricted to assignees, and only kubernetes/enhancements repo collaborators may be assigned issues. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
keps/sig-autoscaling/20190307-configurable-scale-velocity-for-hpa.md
Outdated
Show resolved
Hide resolved
|
@josephburnett: |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gliush, josephburnett, mwielgus The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
a couple notes for clarity:
|
|
A KEP should not be a full API review, so it seems appropriate that this merge without that final approval. It would be bad if the ultimate API was radically different than what is in the KEP, but the reality is that APIs almost always evolve as they are implemented :) Re-reading now. |
thockin
left a comment
There was a problem hiding this comment.
Mostly API comments to sort through as you finalize the UX. This is a complicated API, so I'll encourage you to seek out simplifications, even at the cost of some flexibility. We can always add stuff, but removing is very hard.
|
|
||
| - `constraints`: | ||
| - `scaleUp`: | ||
| - `percent = 900` (i.e., to increase the number of pods 10 times per minute is ok). |
There was a problem hiding this comment.
For final API we may want to try a few variants to see what UX works best and is least confusing. E.g. if I want to allow 10x growth, does it make sense to say "grow by 900%" or "grow to 1000%" ?
For examples like "grow by 100%" it seems pretty obvious, just less so at larger numbers :)
There was a problem hiding this comment.
I would prefer "grow to 1000%". It makes the math more obvious: maxAllowed = current * (percent / 100)
| type HPAScaleConstraintRateValue struct { | ||
| Pods *int32 | ||
| Percent *int32 | ||
| PeriodSeconds *int32 |
There was a problem hiding this comment.
Is this smoothed over the period or done at edges? E.g. 3 pods per minute could be 1 pod per 20 seconds or 3 pods all at once after 60 seconds. Just specify the behavior.
There was a problem hiding this comment.
Is it ok for pods and percent to share a period? e.g. do I need to be able to specify "3 pods per minute or 100% per 20 seconds" ?
| Create an HPA with the following constraints: | ||
|
|
||
| - `constraints`: | ||
| - `scaleDown`: |
There was a problem hiding this comment.
This is a little clunky -- if there are ever new modes here (I don't have even a hypothetical example, but pretend :), then any YAML that carries this payload will not have that new field.
There are other API conventions being strengthened around one-of sets, which want a discriminator field, so maybe this looks like:
constraints:
scaleDown: # 3 pods per 10 minutes
policy: Pods
value: 3
periodSeconds: 600
constraints:
scaleDown: # no scale-down allowed
policy: Disabled
Or if pods and percent are not mutually exclusive (?) then something like:
constraints:
scaleDown: {} # no scale-down allowed
This changes the defaults from being on the leaf fields to being on the struct. If scaleDown is not specified, the default value is { percent: 100, pods: 4 }, but if it is specified, the fields inside default to 0.
Something like that.
There was a problem hiding this comment.
@gliush this is worth considering for kubernetes/kubernetes#74525. Just wanted to make sure you didn't miss this feedback.
| - `constraints`: | ||
| - `scaleDown`: | ||
| - `pods = 5` | ||
| - `delaySeconds = 600` |
There was a problem hiding this comment.
is delay specific to down-scaling or also for up? The YAML listed here is confusing
|
|
||
| ```golang | ||
| type HPAScaleConstraintValue struct { | ||
| Rate *HPAScaleConstraintRateValue |
There was a problem hiding this comment.
what does it mean if this is not specified? Make sure to document and think through all optionality
| MinReplicas *int32 | ||
| MaxReplicas int32 | ||
| Metrics []MetricSpec | ||
| Constraints *HPAScaleConstraints |
There was a problem hiding this comment.
FWIW I still dislike "constraints" as a term here. "policy" or somethng makes more sense to me, but I probably won't fight very hard on this
| ```golang | ||
| type HPAScaleConstraintValue struct { | ||
| Rate *HPAScaleConstraintRateValue | ||
| DelaySeconds *int32 |
There was a problem hiding this comment.
if I understand, this is not a "delay" as much as a "window" ? Please think about the name that best captures the semantics.
Also document bounds. Can I set a delay of 14 days? How much buffer are we willing to allocate (and lose if the controller crashes) ?
|
|
||
| Example for `CurReplicas = 10` and HPA controller cycle once per a minute: | ||
|
|
||
| - First 9 minutes the algorithm will do nothing except gathering recommendations. |
There was a problem hiding this comment.
where are these stored? If the controller goes down, is it all lost? That should feedback into our API limits so we don't promise to store too much, and then cause a huge problem when the controller dies for whatever reason.
No description provided.