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

Support Pod conditions for calculating PendingJobCount in accurate scaling startegy #1963

Closed
yaronya opened this issue Jul 15, 2021 · 2 comments · Fixed by #1970 or #2009
Closed

Support Pod conditions for calculating PendingJobCount in accurate scaling startegy #1963

yaronya opened this issue Jul 15, 2021 · 2 comments · Fixed by #1970 or #2009
Labels
feature-request All issues for new features that have not been committed to needs-discussion

Comments

@yaronya
Copy link
Contributor

yaronya commented Jul 15, 2021

Proposal

Currently KEDA looks for the Pod phase (when scaling strategy is set to accurate) to determine whether a pod is pending or not in order to avoid excess triggers when pod is waiting to start or create. This feature was introduced in #1391.

I believe this could be enhanced by not only looking at the Pod's phase, but also its conditions. The conditions should be configurable like:

scalingStategy:
  strategy: "accurate"
  customPendingPodConditions: 
    - "Ready"
    - "PodScheduled"
    - "SomeOtherCustomConditionDefinedByReadinessGate"

Another refactor can be to not look at the Pod's Running phase at all since the native PodScheduled: true condition means the Pod phase is Running so PodScheduled can always be set in customPendingPodConditions (but I'd leave this to whoever implements it)

Use-Case

SQS scaler with a polling interval of 5s (needs to react ASAP to new messages).
Sometimes the pod is already marked with a Running phase but haven't deleted the message from the queue just yet so KEDA triggers another redundant job in the meantime 😢

Using Readiness Probes (or custom readinessGate) would allow me to mark the pod as "not pending" only after assuring the message is no longer in the queue, helping me to avoid those redundant KEDA triggers 💯

Anything else?

Thank you for this great solution. Go KEDA! 🥇

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

@yaronya this is a great proposal, it sounds reasonable for me. Are you willing to contribute this one?

@yaronya
Copy link
Contributor Author

yaronya commented Jul 19, 2021

Sure thing.
I'm a little busy lately so I'll try to get to it in the forthcoming week or two.

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
2 participants