Coder Social home page Coder Social logo

Comments (4)

JorTurFer avatar JorTurFer commented on September 27, 2024 2

Hello @gerbil
It's working as expected because the scaling to 5 is happening, as we can see here:

2024-05-15T10:33:11Z	INFO	scaleexecutor	Successfully set ScaleTarget replicas count to ScaledObject minReplicaCount	{"scaledobject.Name": "backend", "scaledObject.Namespace": "ivp-test", "scaleTarget.Name": "backend", "Original Replicas Count": 5, "New Replicas Count": 0}

KEDA is scaling from 0 to 1 because KEDA relies on the HPA to scaling from 1 to N, so the "usual" process is that KEDA scales from 0 to 1 when there is at least 1 active trigger, and then the HPA scales the workload from 1 to N. desiredReplicas is the value that the trigger will return to the HPA Controller. In the same way as with other scalers, if your queue returns 50, KEDA won't scale from 0 to 50 directly.
This is explained here: https://keda.sh/docs/2.14/concepts/scaling-deployments/#activating-and-scaling-thresholds

Given this, if you want to scale from 0 to 5 directly, it's doable. You can use idleReplicaCount option to allow scaling to 0 with min replicas 5, and then KEDA will scaling from 0 to 5 and from 5 to 0 without passing from 1 and the HPA:

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: backend
  namespace: test
spec:
  minReplicaCount: 5
  idleReplicaCount: 0
  scaleTargetRef:
    apiVersion: deployment.xxx.com/v1alpha1
    kind: ApplicationDeployment
    name: backend
  triggers:
    - metadata:
        desiredReplicas: '5'
        end: 30 * * * *
        start: 0 * * * *
        timezone: Europe/Riga
      type: cron

from keda.

tomkerkhove avatar tomkerkhove commented on September 27, 2024

This is by design, I believe, but I still think we should kill it in favor of #3566 @kedacore/keda-maintainers

from keda.

gerbil avatar gerbil commented on September 27, 2024

What exactly is by design here? desiredReplicas is a part of ScaledObject/triggers spec and it's not working as expected.

from keda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.