add sessionsPerNode and setSessionsFromHub parameters to selenium-grid scaler
Added two new parameters for selenium-grid scaler, allowing to scale up based on real browser node sizing. When sesSessionsFromHub is set, KEDA will look for existing browser nodes with browserName, browserVersion and platformName same as scaledObject / scaledJob, get maxSessions and calculate how much nodes it needs. When no existing browser node matches, it uses sessionsPerNode value for calculation.
Checklist
- [ ] When introducing a new scaler, I agree with the scaling governance policy
- [x] I have verified that my change is according to the deprecations & breaking changes policy
- [x] Tests have been added
- [x] Changelog has been updated and is aligned with our changelog requirements
- [ ] A PR is opened to update our Helm chart (repo) (if applicable, ie. when deployment manifests are modified)
- [x] A PR is opened to update the documentation on (repo) (if applicable)
- [x] Commits are signed with Developer Certificate of Origin (DCO - learn more)
Fixes #
Relates to #
Could you open an issue and provide a description of your improvement for better tracking?
/run-e2e selenium Update: You can check the progress here
@rubroboletus , there are 2 checks failing:
- DCO (you need to sign all the commits)
- Static checks (https://github.com/kedacore/keda/actions/runs/10419863822/job/28858769588?pr=6055#step:6:128)
Could you take a look please?
@rubroboletus , there are 2 checks failing:
- DCO (you need to sign all the commits)
- Static checks (https://github.com/kedacore/keda/actions/runs/10419863822/job/28858769588?pr=6055#step:6:128)
Could you take a look please?
@JorTurFer Fixed.
/run-e2e selenium Update: You can check the progress here
@rubroboletus, can you review this PR https://github.com/kedacore/keda/pull/6169 to see it can solve your expectation. In the PR, there is no need for new params. We extract Node stereotypes, node sessions against requests capabilities. Expect that a Node with different max sessions is set, scaler will look at the slots available and return correct scale needed.
@rubroboletus, can you review this PR #6169 to see it can solve your expectation. In the PR, there is no need for new params. We extract Node stereotypes, node sessions against requests capabilities. Expect that a Node with different max sessions is set, scaler will look at the slots available and return correct scale needed.
Problem is, that you can obtain info from the Grid only in case, that there is at least one node of such type running. When there is no node of such type running, you know nothing about its settings.
Ok, I can understand now, the problem for calculation when minReplica=0. Let me update my PR and add a test to prove it works.
I updated one more scaler param nodeMaxSessions (the naming aligns with CLI option --max-sessions - https://www.selenium.dev/documentation/grid/configuration/cli_options/#node)
Few tests for that param could be seen in https://github.com/kedacore/keda/pull/6169/files#diff-59589fb3c981e73ac59806307eb5a26330cafb0260a88777cba9124621748a8cR1410