-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Azure DevOps Scaler Demands Must Be a Subset #4195
Comments
@Eldarrin , could you take a look? 🙏 |
So, this is a bug in the documentation, not a bug in the implementation. It is designed to match all, not match any. I would suggest that I don't change this implementation, but extend it to have 2 options (demandsMatch: any and demandsMatch: all). Be aware though that with demandsMatch: any the scaler will spin up all agents that can match, not just the first one that hits as each scaler is independent of the others and there is no state across the scalers. And/or fix the docs :) Parent type matching works better for these scenarios as it passes all the matching complexity into ADO rather than KEDA having to do it. |
Thank you for the feedback. The demand "any" for us might work. ( I assume any as a subset of demands) We have our deployment per scaling, this is the reason for us being more useful to match a set only . But I must say that we problay could change our architecture to work more with the scalar. I trust in your good judgement to decide how you think is better for your product. Thank you for your work. |
hey there, if I understand your requirement correct probably my PR will help you : #4203 The part in the docs with
was hard to understand for me as well. But I think we must differentiate three things:
The part in the docs is related to 1. + 2.. If the KEDA triggers scales up a new build agent, the build agents capabilities have no direct relationship to the KEDA triggers demands. In theory the ScaledObject can have totally different capabilities to what the trigger has specified as demands and what the build job is expecting. So, the docs stating the agents capabilities should be a subset of the KEDA triggers demands is correct, imho. The problem the current implementation has and what I am trying to solve with #4203 is that there is no possibility to have a exact matching between 2. + 3. . |
Sorry for my ignorant question (I'm not an expert in AzDO). Doesn't #4203 fulfill your requirements? I mean, you could specify the demands you want as required. |
PR #4405 should fix this subset to be true subset or all matching |
This does not fix the problem where demands are uniquely set in 2 different ScaledJobs for the same agent pool but no demands are specified in the Azure Pipeline Job, which UNEXPECTEDLY results in ALL deployments being scaled (two agents are created instead of 1). In theory, this should trigger one ScaledJob or the other but not both - one agent only for one of the capability sets (the empty pipeline demands/empty set use case). I'm not sure if this is an architecture limitation or something the operator can have an awareness of so that some round-robin or load balancing occurs when the pipeline doesn't care about any capability but the ScaledJobs have demands specified. |
@arthurgawronski The upcoming patch with |
@Eldarrin Does this mean that there is no way to support a multi-cluster approach where a ScaledJob is defined in two places for a single node pool i.e. a separate "capability"? This would always trigger scaling in both instances and one instance would ultimately be abandoned (only a job would only be scheduled on one of the agents)? |
@arthurgawronski I'm not sure I understand exactly what you mean, so if my understanding is incorrect I apologise, but I think its this: |
Yes @Eldarrin , that is basically it. There seems to be an old thread here (#1587) that seems to have some thought around a single "aware" component rather than all instances and/or ScaledJobs acting independently. My only workaround at this point to support the multi capability/multi cluster requirement while continuing to support the use-case where the demands are not required and/or not set in the Azure Pipeline is the following: ScaledJob1 with demands: CapabilityA with requireAllDemands true (PoolX) -> force to KEDA operator/ScaledJob on ClusterA The above would trigger if someone demands CapabilityA in one scenario or CapabilityB, but not the other and, also hopefully not ScaledJob3. On the empty set scenario, if demands are not set, Job1 and Job2 should not be scaled and only Job3 should be used. I have tried to solution a "ScaledJob4" with "no demands specified" for ClusterB but this would still cause ScaledJob3 and ScaledJob4 to scale causing an abandoned Agent. Unless you or @JorTurFer say otherwise or can see alternatives, for now, I'll need to deal with this agent pool being backed by only one empty set location. |
The only alternative I can think of, but would require a bit of re-architecting of your scaledjobs. If you use |
The problem is that currently there isn't any way to create some kind of KEDA cluster across different clusters, so different KEDA instances will see the same if the ScaledJob is the same. I can't see any way to achieve the behavior you want without communicating KEDA instances across all the clusters :( |
I think the OP issue has been fixed by the PR#4405 & PR#4203; should this be closed? I think @arthurgawronski 's issue is different to the OP's and actually is handled partially through ADO |
I close this issue, feel free to reopen it if the problem isn't solved |
Report
Possible bug Please review if is correct.
Reading the documentation: (https://keda.sh/docs/2.9/scalers/azure-pipelines/)
Reading the code:
https://github.com/kedacore/keda/blob/main/pkg/scalers/azure_pipelines_scaler.go
Line 364:
Not familiar with the code but looks to me it is not the subset but all the demands minus the version demand.
Expected Behavior
Demands should be a subset. Like the webpage says.
Actual Behavior
All the demands need to mache minus one
Steps to Reproduce the Problem
Logs from KEDA operator
KEDA Version
2.9.3
Kubernetes Version
1.26
Platform
Other
Scaler Details
azure devops
Anything else?
I hope that I read correctly the code.
The text was updated successfully, but these errors were encountered: