-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[WIP] Skip minScale during rollout for specific workloads #15780
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: skonto The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15780 +/- ##
==========================================
- Coverage 80.81% 80.68% -0.14%
==========================================
Files 222 222
Lines 18075 18114 +39
==========================================
+ Hits 14608 14615 +7
- Misses 3096 3124 +28
- Partials 371 375 +4 ☔ View full report in Codecov by Sentry. |
if err == nil && svc != nil { | ||
sc := svc.Status | ||
scr := sc.GetCondition(servingv1.ServiceConditionReady) | ||
if scr.IsUnknown() && scr.Reason == "RolloutInProgress" && sc.LatestCreatedRevisionName == pa.Name { |
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 might need adjustment for rollbacks.
cc @houshengbo this might interest you, pls let me know what you think. |
Proposed Changes
When in roll out, skip minScale until traffic shifts for workloads with a specific annotation
features.knative.dev/skip-min-scale-during-rollout: "Enabled"
. Although we dont provide guarantees for a smooth traffic transition this can help with certain use cases where expensive resources are used e.g. gpu and we don't optimize for latency e.g. batch or when there is latency tolerance in general. We rely on the activator to manage pending requests (backpressure). Although does not completely fix Allow rolling upgrade during progressive rollout #12971 it unblocks some scenarios until the functionality of the progressive rollout repo is ready. Also it can be useful when utilized during low traffic hours in production. Btw I created this PR to discuss the idea in general.Old pods still do suffer from the terminationGracePeriod (linked to the revision timeout) but at least we can go from 2x resources needed in the worst case to x+N. Maybe we could also relax minScale for the old revision (rely on the autoscaler to scale it before traffic shift is done).
Here is an example where:
a) we start with minScale=2 and
serving.knative.dev/rollout-duration: "380s"
so we have enough time to observe.b) we update the minScale to 210 (random scale) and wait until traffic shifts, and we enter a roll-out. Note here that normally the new revision will serve traffic but will never be active without this patch, eventually progressdeadline will expire if there are no resources.
c) While traffic is shifting the new revision will skip minScale and autoscale based on available resources and max scale.
d) Later on since there is no traffic, both revisions have no replicas (the initial revision is scaled down too) and we have exited the roll-out.
e) When a request comes in the minScale is respected again for the latest revision, since we exited the roll-out, and we operate as usual.
Release Note