-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 active-min-scale annotation #13136
Conversation
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com> This PR implements a "min-scale, but with scale to zero" feature. In essence, when this feature is in use, if the service is handling requests it will never have less than N number of pods (though it can still scale to zero). N is specified on a per-revision basis using an `autoscaling.knative.dev/min-non-zero-replicas` annotation. If min-non-zero-replicas > initial-scale, the service will initially scale to the min-non-zero-replicas value.
@vagababov I think I've seen you pop in a bit recently, so if you have bandwidth to take a look that'd be great (and if not, no worries at all) /approve cancel |
Codecov Report
@@ Coverage Diff @@
## main #13136 +/- ##
==========================================
- Coverage 86.78% 86.69% -0.09%
==========================================
Files 196 196
Lines 14410 14450 +40
==========================================
+ Hits 12506 12528 +22
- Misses 1609 1626 +17
- Partials 295 296 +1
Continue to review full report at Codecov.
|
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 think the annotation name min-non-zero-replicas
is confusing. The only alternative I have to offer is min-activate-scale
- where active
(to me) means the revision is handling a request(s)
} else if nzMin < 2 { | ||
errs = errs.Also(&apis.FieldError{ | ||
Message: fmt.Sprintf("min-non-zero-replicas=%d must be greater than 1", nzMin), | ||
Paths: []string{MinNonZeroReplicasKey}, | ||
}) | ||
} |
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.
Curious if setting a value of 1
would be necessary for the scenario:
min-scale: 0
initial-scale: 0
min-non-zero-replicas: 1
Or is setting it to 1
just not necessary because that's the floor?
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.
My thought here was that if you're going to set this value, it needs to actually do something (setting it equal to one is the same as not setting it at all, and in that case you may as well not use it at all...)
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>
Also - I would do a sanity check on the annotation name say with someone from Docs/UX - in case they have a better suggestion. Worst case we change the name again in a future before (but before the release) |
/lgtm |
I guess one last thing (in a follow up PR) - having an e2e test would be great |
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>
We chatted in slack on the name change |
/lgtm let's do an e2e test in a followup |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprotaso The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Paul S. Schweigert paulschw@us.ibm.com
Proposed Changes
This PR implements a "min-scale, but with scale to zero" feature. In
essence, when this feature is in use, if the service is handling
requests it will never have less than N number of pods (though it can
still scale to zero).
N is specified on a per-revision basis using an
autoscaling.knative.dev/active-min-scale
annotation.This annotation will not impact
initial-scale
values, as it will only apply onsubsequent scales from zero.
Fixes #11308
/assign @nader-ziada @dprotaso