-
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
Old revisions running forever when using minScale #2720
Comments
I ran into this last night when monkeying with |
You can delete the revision and it will go away. Or you can just wait and it should get garbage collected after a while (if no route is referencing it). If that doesn't happen, it's a bug. Also, you can just edit the pod autoscaler and delete the |
The current behavior is that it does not get garbage collected. The |
Hey, @josephburnett:
Which Kubernetes resource for the pod autoscaler stores the |
cc @greghaynes Do they get GC'd? |
I had the exact same issue, deleting annotations for old revisions manually does not sound a viable solution, currently I manually delete the old revisions but will need to double check if revision gc works in this case. I guess with default setting they will go away after 24h? |
Yes, the configuration controller should GC revisions not referenced by a route after It seems like the desired behavior here is for minScale to not apply for non-routed revisions in order to more quickly delete the deployment for a revision? If so I could also see arguments for minScale being enforced for the full lifetime of a revision (maybe I have a reason I never want my app to scale to 0). |
I think if theres desire for faster deleting of deployments (to free up resources taken by minScale) we could try and come up with a more responsive GC system for revisions... |
It isn't getting GC'd at all. I still have an old revision with an active deployment from December 17th (~2 weeks ago). The version deployed after it was using the If you follow the repro steps from @nicolaferraro, the Kubernetes deployment that gets created to run a container of The behavior I expected, right or wrong, was when I deployed a service with |
Yes, exactly. Though I think you're talking about less than 24h and the reporters of this issue are talking about less than never. There's an interesting conversation here about this potentially having issues if a kNative service is not intended to receive traffic, but instead be the source of it. If something were to be scaled to zero if it were to never receive traffic, then this use case of |
Putting in v1 because they should at least be subject to GC. |
Agreed. I'm on holiday until Jan 9 but if no one has looked at it by then I'll have a look. |
@josephburnett if it's cool with you I'm going to mark this as 0.4 scope, assuming @greghaynes has cycles to tackle it? /milestone Serving 0.4 |
I do! /assign greghaynes |
Good that it's in milestone 0.4. There are two issues here: Issue 1: The revision should definitely be garbage collected normally, whether it has running pods or not. This is a bug outright and should be fixed as part of this issue. Issue 2: Should |
@nicolaferraro Sorry it took a bit, but I just attempted to reproduce the issue where your revision 1 was not getting GC'd after 24h and was unable to. A couple shots in the dark:
If you are able to run from source heres how you can turn the GC time span down which should demonstrate working GC without having to wait 24h: master...greghaynes:test/quick-gc Also, if you are able to run with the above changes and see GC not occurring, could you do a Thanks! |
hi @greghaynes i am pretty new to kubernetes and knative, running on a small 4 node cluster and setup my first service in a ci/cd pipeline and quickly noticed my resources disappear as i slammed revisions out. This thread has been amazing to workout what is causing it and the solution. Would be great to have this highlighted more in documentation if it was possible, potentially in a FAQ. Might help others out as it caught me out fairly quickly. |
There's also this configuration item "StaleRevisionMinimumGenerations", which it keeps N revisions even if they are stale. Perhaps it's set > 1? |
Ah, nice catch. I was running v0.2.0 in the instance where it never got cleaned up (or at least, not after 2+ weeks). I'm glad to know that upgrading to v0.2.1+ will at least set a 24h cap on the old revision finally scaling back to 0. |
Skimming the updates in this thread, it looks like folks should be WAI, but that our docs need work. @greghaynes since your assigned do you want to take a crack at it? cc @josephburnett as this is also related to |
I am running v0.2.3 and service has
|
@yuzisun that looks right to me.
|
/unassign @greghaynes As this isn't a GC bug, but a minScale documentation gap I'm moving to 0.5 and reassigning. |
/unassign @josephburnett |
/area autoscale
/kind bug
Expected Behavior
When running a kservice with a
runLatest
configuration and aautoscaling.knative.dev/minScale
annotation set to1
, Knative should apply theminScale
configuration only on active revisions not on "retired" revisions, otherwise old revisions will remain always running.I've seen a similar discussion in #755, but that wasn't a real problem since apparently it wasn't possible to deactivate scaling to 0. But the
minScale=1
annotation actually deactivates scaling to 0 for a specific service.Actual Behavior
Each time a kservice is updated, a new revision is added and all revisions are kept running forever.
Steps to Reproduce the Problem
Revision v1 is never recycled or scaled down.
Additional Info
Question related to this: is there a way to limit the number of total revisions to reduce the impact of the problem?
The text was updated successfully, but these errors were encountered: