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

ScaledObject type Cron with Min Replicas #1807

Closed
msfidelis opened this issue May 15, 2021 · 5 comments
Closed

ScaledObject type Cron with Min Replicas #1807

msfidelis opened this issue May 15, 2021 · 5 comments
Assignees
Labels
feature-request All issues for new features that have not been committed to needs-discussion

Comments

@msfidelis
Copy link

Proposal

Configs in metadata.end of cron scheduler type to not set desired replicas to 0, just adjust to deployment default value.

defaultReplicas or minReplicas to scale after the warm up period ends.

Use-Case

Pre-warming deployments at certain times to prepare for access and periods

Anything else?

No response

@msfidelis msfidelis added feature-request All issues for new features that have not been committed to needs-discussion labels May 15, 2021
@tomkerkhove
Copy link
Member

Hi, can you clarify what you want to achieve, please?

Because from what you are describing, it sounds like you are describing what our Cron scaler does.

It scales a target to a given amount of replicas based on the schedule.

@JorTurFer
Copy link
Member

Maybe @msfidelis was talking about this.
Basically, we are scaling to 1 when we are out of the cron active time. Would it be nice if we support the selection of the amount of the replicas in case of active period and in case of inactive period?

@tomkerkhove
Copy link
Member

The case of inactive is most probably covered by #1958 which is now in v2.4

@JorTurFer
Copy link
Member

Nice!

@msfidelis
Copy link
Author

I'm sorry for delay. I found the solution for my problem. I need create a pre-warmup for predictive throughput and return to normal capacity after that.

To Keda don't set my tasks to 0 after cron triggers ends, i just set minReplicaCount to my default replica count.

---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: example-app-warm-up
  namespace: example-app
spec:
  scaleTargetRef:
    name: example-app
  minReplicaCount: 10
  maxReplicaCount: 30
  triggers:
  - type: cron
    metadata:
      timezone: America/Sao_Paulo
      start: 00 00 * * *
      end: 00 06 * * *
      desiredReplicas: "30"

I'm sorry for the time the issue stay open and I appreciate your attention, folks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request All issues for new features that have not been committed to needs-discussion
Projects
None yet
Development

No branches or pull requests

4 participants