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

Provide capability to extend scalers #624

Open
tomkerkhove opened this issue Feb 11, 2020 · 4 comments
Open

Provide capability to extend scalers #624

tomkerkhove opened this issue Feb 11, 2020 · 4 comments
Labels
feature All issues for new features that have been committed to help wanted Looking for support from community scaler

Comments

@tomkerkhove
Copy link
Member

In certain scenarios it would be interesting to react based on what a certain scaler is doing.

For example; when processing a Service Bus/RabbitMQ queue but the queue does not exist it would be nice if we could react to that.

Proposal

We should provide the capability to opt-in for events which are emitted by a given scaler. With that, we could trigger a process to react. (Relates to #479)

Alternative

Alternative is to be able to define a job to run as part of the metadata, but personally I think it's best to decouple this from KEDA and provide the info but leave it up to others to handle it.

Other information

This came up on #KEDA in Kubernetes Slack for Tomek Święcicki his scenario.

@tomkerkhove tomkerkhove added needs-discussion scaler feature-request All issues for new features that have not been committed to labels Feb 11, 2020
@tomislater
Copy link
Contributor

I can add some info about scenarios and how we have handled some of them.

Scenario 1

Your consumer/worker (deployment) creates a queue in RabbitMQ. If you create Deployment and ScaledObject in the same time, and for some reason your pod (which creates a queue) takes some time to run, KEDA can be faster and scale your deployment down and thus you will never be able to create a queue (if minReplicaCount is set to 0).

Solutions:

  1. Set minReplicaCount to 1, but if you have many workers/consumers and you need them only for a while (when something is on queue) there is no point to set this to 1; you just want to scale them down
  2. Create ScaledObject after Deployment. We use Helm, so we can just create ScaledObject in post-install,post-upgrade hooks. And, it works... most of the workers/consumers are up and ready at the time, but there is another scenario 💃

Scenario 2

You have ScaledObject with minReplicaCount set to 0, your Deployment (worker/consumer which creates a queue) has 0 replicas (let's say there was nothing on queue, so KEDA had scaled it down) and for some reason, there is no queue in RabbitMQ (someone has deleted disk, queue was not durable, someone has set TTL on queue, whatever).
With such setup, KEDA will never scale up your deployment because there is no queue in RabbitMQ and it will never be, because a queue is created (which is not a rare case) by your worker/consumer.

Solutions:

  1. DITTO, set minReplicaCount to 1
  2. Remove ScaledObject objects and scale Deployment to 1 replicas. But, it is not a solution at all.

It would be great to tell KEDA what should be done if there is an error. In one case it look okay to scale your deployment to 1 if there are such error (no queue in rabbit), but in another, when something is wrong with backend (RabbitMQ, Redis, etc. (cannot create a disk for instance)) such action does not make any sense as @tomkerkhove has pointed out. But, it is another problem.

@tomkerkhove tomkerkhove added feature All issues for new features that have been committed to help wanted Looking for support from community and removed feature-request All issues for new features that have not been committed to needs-discussion labels Feb 27, 2020
@redyamsirisha
Copy link

how we can trigger a single workflow after all other workflows are completed in github actions?

@JorTurFer
Copy link
Member

@tomislater , could this be solved using fallback feature?

@tomislater
Copy link
Contributor

I think so 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature All issues for new features that have been committed to help wanted Looking for support from community scaler
Projects
Status: To Do
Development

No branches or pull requests

4 participants