Skip to content

Commit

Permalink
extend selenium-grid scaler (#1449)
Browse files Browse the repository at this point in the history
* describe sessionsPerNode and setSessionsFromHub parameters for selenium-grid scaler

Signed-off-by: Hanzlik, Robert (MONETA) <robert.hanzlik@moneta.cz>

* document sessionBrowserVersion

Signed-off-by: Hanzlik, Robert (MONETA) <robert.hanzlik@moneta.cz>

* Update content/docs/2.16/scalers/selenium-grid-scaler.md

fix typo

Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Signed-off-by: Robert Hanzlík <robi@junyks.cz>
Signed-off-by: Hanzlik, Robert (MONETA) <robert.hanzlik@moneta.cz>

---------

Signed-off-by: Hanzlik, Robert (MONETA) <robert.hanzlik@moneta.cz>
Signed-off-by: Robert Hanzlík <robi@junyks.cz>
Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
  • Loading branch information
rubroboletus and JorTurFer authored Oct 16, 2024
1 parent f60d2b5 commit e735935
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions content/docs/2.16/scalers/selenium-grid-scaler.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ triggers:
- `browserName` - Name of browser that usually gets passed in the browser capability. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info.
- `sessionBrowserName` - Name of the browser when it is an active session, only set if `BrowserName` changes between the queue and the active session. See the Edge example below for further detail. (Optional)
- `browserVersion` - Version of browser that usually gets passed in the browser capability. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info. (Optional)
- `sessionBrowserVersion` - Version of the browser when it is an active session, only set, when scaling without defined exact `browserVersion`.
- `unsafeSsl` - Skip certificate validation when connecting over HTTPS. (Values: `true`, `false`, Default: `false`, Optional)
- `activationThreshold` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional)
- `platformName` - Name of the browser platform. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info. (Default: `Linux`, Optional)
- `setSessionsFromHub` - When set, count number of browser node slots and sessions from existing nodes, use this data for scaling. (Default: `false`, Optional)
- `sessionsPerNode` - Use as default number of sessions per browser node, when none are found existing on selenium grid. (Default: `1`, Optional)

### Example

Expand Down Expand Up @@ -105,6 +108,29 @@ spec:
sessionBrowserName: 'msedge'
```

If your selenium browser nodes are not exactly same and you wanna to scale them based on real `slots` settings, set `setSessionsFromHub` to `true` and `sessionsPerNode` to real number of slots, if you wanna scale from 0.

```yaml
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: selenium-grid-chrome-scaledobject
namespace: keda
labels:
deploymentName: selenium-chrome-node
spec:
maxReplicaCount: 8
scaleTargetRef:
name: selenium-chrome-node
triggers:
- type: selenium-grid
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'chrome'
setSessionsFromHub: 'true'
sessionsPerNode: 4
```

If you are supporting multiple versions of browser capability in your Selenium Grid, You should create one scaler for every browser version and pass the `browserVersion` in the metadata.

```yaml
Expand Down

0 comments on commit e735935

Please sign in to comment.