From 65f5fda8797e6c3784be559aee76457e5ab4459c Mon Sep 17 00:00:00 2001 From: "Hanzlik, Robert (MONETA)" Date: Fri, 9 Aug 2024 05:40:10 +0000 Subject: [PATCH 1/3] describe sessionsPerNode and setSessionsFromHub parameters for selenium-grid scaler Signed-off-by: Hanzlik, Robert (MONETA) --- .../docs/2.16/scalers/selenium-grid-scaler.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/content/docs/2.16/scalers/selenium-grid-scaler.md b/content/docs/2.16/scalers/selenium-grid-scaler.md index d30c30aa9..3296efb76 100644 --- a/content/docs/2.16/scalers/selenium-grid-scaler.md +++ b/content/docs/2.16/scalers/selenium-grid-scaler.md @@ -36,6 +36,8 @@ triggers: - `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 @@ -105,6 +107,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 `setSessionsFromHub` 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 From 69c84ead71b9f97354c1f58783079a61db7c6e00 Mon Sep 17 00:00:00 2001 From: "Hanzlik, Robert (MONETA)" Date: Fri, 16 Aug 2024 12:03:17 +0000 Subject: [PATCH 2/3] document sessionBrowserVersion Signed-off-by: Hanzlik, Robert (MONETA) --- content/docs/2.16/scalers/selenium-grid-scaler.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/docs/2.16/scalers/selenium-grid-scaler.md b/content/docs/2.16/scalers/selenium-grid-scaler.md index 3296efb76..a9d7ca370 100644 --- a/content/docs/2.16/scalers/selenium-grid-scaler.md +++ b/content/docs/2.16/scalers/selenium-grid-scaler.md @@ -33,6 +33,7 @@ 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) From cec3bf4f51afef8955633cf7b20f1a4b5dba5023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Hanzl=C3=ADk?= Date: Tue, 3 Sep 2024 09:26:59 +0200 Subject: [PATCH 3/3] Update content/docs/2.16/scalers/selenium-grid-scaler.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix typo Co-authored-by: Jorge Turrado Ferrero Signed-off-by: Robert Hanzlík Signed-off-by: Hanzlik, Robert (MONETA) --- content/docs/2.16/scalers/selenium-grid-scaler.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/2.16/scalers/selenium-grid-scaler.md b/content/docs/2.16/scalers/selenium-grid-scaler.md index a9d7ca370..850b8a1e5 100644 --- a/content/docs/2.16/scalers/selenium-grid-scaler.md +++ b/content/docs/2.16/scalers/selenium-grid-scaler.md @@ -108,7 +108,7 @@ 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 `setSessionsFromHub` to real number of slots, if you wanna scale from 0. +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