Non-Active Revisions with ScaleToZeroPodRetention and min-non-active-revisions > 1 is not scaled down
What version of Knative?
1.9.2
Expected Behavior
Non active must be scaled down with autoscaling.knative.dev/scale-to-zero-pod-retention-period set
Actual Behavior
Non active revisions are not scaled down
Steps to Reproduce the Problem
Deploy a Knative service with scale-to-zero-pod-retention-period (make sure this value is higher so you will be able to see the issue)
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: hello-example
namespace: default
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/initial-scale: "1"
autoscaling.knative.dev/min-scale: "0"
autoscaling.knative.dev/scale-to-zero-pod-retention-period: "1h"
spec:
containerConcurrency: 0
containers:
- env:
- name: TARGET
value: World
image: gcr.io/knative-samples/helloworld-go
name: user-container
Edit the config-map config-gc and set below values
max-non-active-revisions: "2"
min-non-active-revisions: "1"
retain-since-create-time: disabled
retain-since-last-active-time: disabled
- Deploy The knative service
- Then alter the service to deploy a newer revisions
- You will see the old revision not scaling down
autoscaling.knative.dev/scale-to-zero-pod-retention-period: "1h"
I lowered this from an hour (1h) to 10 miuntes (10m) and the pod scaled down after 10 minutes. Are you seeing something else?
/triage needs-user-input
Hey @dprotaso,
Thanks for taking time to check this out.
Indeed, it eventually scales down, but I think the non-active revisions can be scaled down immediately. Am i missing something?
I guess to clarify your ask is
A revision, that has no route pointed to it, should scale down and ignore the configured
scale-to-zero-pod-retention-period' ?
Or another way to phrase it
scale-to-zero-pod-retention-periodshould only apply to revisions that can be reached by a route
This issue might be covered by this PR - https://github.com/knative/serving/pull/13731 but would need to confirm
/triage accepted
I'm assuming your ask what I've described - if so I agree that revisions that aren't routable should ignore the scale down retention periods.
I'm assuming your ask what I've described - if so I agree that revisions that aren't routable should ignore the scale down retention periods.
You are right and let me check the PR
I guess to clarify your ask is
A revision, that has no route pointed to it, should scale down and ignore the configured
scale-to-zero-pod-retention-period' ?Or another way to phrase it
scale-to-zero-pod-retention-periodshould only apply to revisions that can be reached by a routeThis issue might be covered by this PR - #13731 but would need to confirm
Hey @dprotaso I checked the PR, and as far as I am aware it is not covered. Will start working on it once you confirm.
/remove-triage needs-user-input
@dprotaso, can I go ahead with the fix ?
@AswinT22 sure
/assign @AswinT22
@AswinT22 are you still working on this?
/unassign @AswinT22
@dprotaso hi can I work on this?