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

[enhancement]: Add idle timeout flag when running with "once" enabled #4806

Open
Nohac opened this issue May 22, 2024 · 2 comments
Open

[enhancement]: Add idle timeout flag when running with "once" enabled #4806

Nohac opened this issue May 22, 2024 · 2 comments

Comments

@Nohac
Copy link

Nohac commented May 22, 2024

Describe your feature request here

I'm managing a kubernetes cluster that uses KEDA to dispatch agents on demand based on the pool queue on DevOps. The agents run with --once to make sure they shut down after each job to allow the cluster to scale down it's nodes when no jobs are running, this works fine most of the time.

The issue arises if, for whatever reason, the new agent did not receive a job (this could happen if someone cancels a job, or something else unexpected happens). This is usually fine in a busy pool, since the agent will receive a job within a short amount of time, however, when this happens at the end of the day, or end of the work week, this can cause unnecessary infrastructure to run over the weekend, which will dramatically increase the cost, especially if the infrastructure includes GPU's or other expensive hardware.

I think this could be easily fixed by adding an "idle timeout" flag to the agent, this flag should allow specifying how long an agent is allowed to run while being idle.

./run-agent.sh --timeout 5m --once

The above command would ensure that the agent would timeout after 5 minutes, unless it received a job within that time frame.

I could work around this issue by using the DevOps api to fetch idle agents and tell kubernetes to stop the pod, but this seems like a lot of work that could be easily avoided with this proposal.

@DmitriiBobreshev
Copy link
Contributor

DmitriiBobreshev commented May 22, 2024

Hi @Nohac, thank you for the idea. We're working on higher-prioritized issues at the moment, but we'll try to implement it soon as we can.

@Nohac
Copy link
Author

Nohac commented May 24, 2024

I'm willing to try implementing this feature if someone can point me in the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants