Skip to content
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

Introduce Idle Replica Mode #1958

Merged
merged 2 commits into from
Jul 15, 2021
Merged

Introduce Idle Replica Mode #1958

merged 2 commits into from
Jul 15, 2021

Conversation

zroubalik
Copy link
Member

@zroubalik zroubalik commented Jul 14, 2021

Signed-off-by: Zbynek Roubalik zroubali@redhat.com

Introducing optional Idle Replica Mode, which allows scaling to a different (lower) number of replicas when triggers are not active through setting idleReplicaCount. Once triggers are active the target deployment is scaled to minReplicaCount which which can be arbitrary number greeter then idleReplicaCount and less then maxReplicaCount. Then the scaling is being handled by HPA as usual. Once the triggers are again not active, the target workload is again scaled to idleReplicaCount.

  1. Example ScaledObject, which allows to have 0 replicas on target workload if there's nothing to do, once triggers are active the workload is scaled immediately to 5 and then scaled up to 10 by HPA as usual.
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: example-so
spec:
  scaleTargetRef:
    name:  target 
  idleReplicaCount: 0            
  minReplicaCount: 5                     
  maxReplicaCount: 10
  1. Example ScaledObject, which allows to have 1 replicas on target workload if there's nothing to do, once triggers are active the workload is scaled immediately to 10 and then scaled up to 20 by HPA as usual.
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: example-so
spec:
  scaleTargetRef:
    name:  target 
  idleReplicaCount: 1             
  minReplicaCount: 10                     
  maxReplicaCount: 20

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • Tests have been added
  • [N/A] A PR is opened to update our Helm chart (repo) (if applicable, ie. when deployment manifests are modified)
  • A PR is opened to update the documentation on (Documentation for Idle Replica Mode keda-docs#488) (if applicable)
  • Changelog has been updated

Fixes #1838

@zroubalik zroubalik requested a review from ahmelsayed as a code owner July 14, 2021 19:35
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
@zroubalik zroubalik merged commit a50f9f2 into kedacore:main Jul 15, 2021
nilayasiktoprak pushed a commit to nilayasiktoprak/keda that referenced this pull request Oct 23, 2021
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Signed-off-by: nilayasiktoprak <nilayasiktoprak@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow HPA minReplicas other than 1 while still scaling to 0
2 participants