knative-extensions / autoscaler-keda

Keda based Knative HPA Autoscaler
Apache License 2.0
2 stars 5 forks source link

Support scale to zero #55

Closed skonto closed 2 months ago

skonto commented 2 months ago

Changes

$ k get hpa -n serving-tests
NAME                           REFERENCE                                            TARGETS       MINPODS   MAXPODS   REPLICAS   AGE
scale-to-zero-gotnxmxb-00001   Deployment/scale-to-zero-gotnxmxb-00001-deployment   <unknown>/5   1         10        0          6m53s

Similarly the scaledobject shows to be inactive.

$k get scaledobject -n serving-tests
NAME                           SCALETARGETKIND      SCALETARGETNAME                           MIN   MAX   TRIGGERS     AUTHENTICATION   READY   ACTIVE   FALLBACK   PAUSED    AGE
scale-to-zero-lllzzbds-00001   apps/v1.Deployment   scale-to-zero-lllzzbds-00001-deployment         10    prometheus                    True    False    False      Unknown   6m14s
stream.go:304: I 12:57:22.399 controller-6f874b497b-jcwkt [knative.dev.serving.pkg.reconciler.gc.reconciler] [serving-tests/scale-to-zero-gotnxmxb] Reconcile succeeded
stream.go:304: I 12:57:22.399 controller-6f874b497b-jcwkt [knative.dev.serving.pkg.reconciler.configuration.Reconciler] [serving-tests/scale-to-zero-gotnxmxb] Reconcile succeeded
--- PASS: TestScaleToZero (430.80s)
PASS
ok      knative.dev/autoscaler-keda/test/e2e    430.821s

/kind enhancement

Fixes #15

Release Note

Support scale to zero. When we scale down to zero external metrics need to be available for scaling up again. Initially when a service is created it will not become ready unless hpa reports its target correctly (external metrics are available).  
codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 72.77%. Comparing base (c2fa22d) to head (13881fe). Report is 7 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #55 +/- ## ========================================== - Coverage 73.46% 72.77% -0.69% ========================================== Files 8 8 Lines 520 518 -2 ========================================== - Hits 382 377 -5 - Misses 108 110 +2 - Partials 30 31 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

knative-prow[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ReToCode, skonto

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: - ~~[OWNERS](https://github.com/knative-extensions/autoscaler-keda/blob/main/OWNERS)~~ [ReToCode,skonto] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment