From ce186489f13b1470a59311acb91abd43fe0953fc Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Tue, 17 Sep 2024 11:31:36 +0000 Subject: [PATCH 1/4] Update for Selenium Grid scaler in release 2.16 @SeleniumHQ involve as maintainer Signed-off-by: Viet Nguyen Duc --- .../docs/2.16/scalers/selenium-grid-scaler.md | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/content/docs/2.16/scalers/selenium-grid-scaler.md b/content/docs/2.16/scalers/selenium-grid-scaler.md index 05b3cc5dc..e2afe9ae8 100644 --- a/content/docs/2.16/scalers/selenium-grid-scaler.md +++ b/content/docs/2.16/scalers/selenium-grid-scaler.md @@ -1,7 +1,7 @@ +++ title = "Selenium Grid Scaler" availability = "v2.4+" -maintainer = "Volvo Cars" +maintainer = "Volvo Cars, SeleniumHQ" category = "Testing" description = "Scales Selenium browser nodes based on number of requests waiting in session queue" go_file = "selenium_grid_scaler" @@ -29,16 +29,20 @@ triggers: **Parameter list:** -- `url` - Graphql url of your Selenium Grid. Refer to the Selenium Grid's documentation [here](https://www.selenium.dev/documentation/en/grid/grid_4/graphql_support/) to for more info. -- `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. +- `url` - Graphql url of your Selenium Grid (Required). Refer to the Selenium Grid's documentation [here](https://www.selenium.dev/documentation/en/grid/grid_4/graphql_support/) to for more info. If endpoint requires authentication, you can use `TriggerAuthentication` to provide the credentials instead of embedding in the URL. +- `browserName` - Name of browser that usually gets passed in the browser capability (Required). 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) +- `nodeMaxSessions` - Number of maximum sessions that can run in parallel on a Node. (Default: `1`, Optional). Update this parameter align with node config `--max-sessions` (`SE_NODE_MAX_SESSIONS`) to have the correct scaling behavior. + +**Trigger Authentication** +- `username` - Username for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional) +- `password` - Password for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional) +- `authType` - Type of authentication to be used. (Optional). This can be set to `Bearer` or `OAuth2` in case Selenium Grid behind an Ingress proxy with other authentication types. +- `accessToken` - Access token (Optional). This is required when `authType` is set a value. ### Example @@ -108,7 +112,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 `sessionsPerNode` to real number of slots, if you wanna scale from 0. +In case you want to scale from 0 (`minReplicaCount: 0`), and browser nodes are configured different `--max-sessions` greater than 1, you can set `nodeMaxSessions` for scaler align with number of slots available per node to have the correct scaling behavior. ```yaml apiVersion: keda.sh/v1alpha1 @@ -127,8 +131,7 @@ spec: metadata: url: 'http://selenium-hub:4444/graphql' browserName: 'chrome' - setSessionsFromHub: 'true' - sessionsPerNode: 4 + nodeMaxSessions: 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. @@ -178,11 +181,8 @@ spec: It is possible to specify the Graphql url of your Selenium Grid using authentication parameters. This useful if you have enabled Selenium Grid's Basic HTTP Authentication and would like to keep your credentials secure. - `url` - Graphql url of your Selenium Grid. Refer to the Selenium Grid's documentation [here](https://www.selenium.dev/documentation/en/grid/grid_4/graphql_support/) for more info. - -As an alternative you can also authenticate by using username and password via `TriggerAuthentication` configuration instead of using url. - -- `username` - Username for connect to the Selenium Grid graphql endpoint. -- `password` - Password for connect to the Selenium Grid graphql endpoint. +- `username` - Username for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional) +- `password` - Password for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional) ```yaml apiVersion: v1 @@ -193,9 +193,8 @@ metadata: type: Opaque data: graphql-url: base64 encoded value of GraphQL URL - # or use username and password separately - grid-username: GRID_USERNAME - grid-password: GRID_PASSWORD + graphql-username: base64 encoded value of GraphQL Username + graphql-password: base64 encoded value of GraphQL Password --- apiVersion: keda.sh/v1alpha1 kind: TriggerAuthentication @@ -209,10 +208,10 @@ spec: key: graphql-url - parameter: username name: selenium-grid-secret - key: grid-username + key: graphql-username - parameter: password name: selenium-grid-secret - key: grid-password + key: graphql-password --- apiVersion: keda.sh/v1alpha1 kind: ScaledObject From 34c05fd5b0e86c7ec5998c4edff80a2ce0f983fd Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Sun, 3 Nov 2024 17:55:47 +0700 Subject: [PATCH 2/4] Update docs for selenium-grid-scaler Co-authored-by: Jorge Turrado Ferrero Signed-off-by: Viet Nguyen Duc --- content/docs/2.16/scalers/selenium-grid-scaler.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/2.16/scalers/selenium-grid-scaler.md b/content/docs/2.16/scalers/selenium-grid-scaler.md index e2afe9ae8..a03698d12 100644 --- a/content/docs/2.16/scalers/selenium-grid-scaler.md +++ b/content/docs/2.16/scalers/selenium-grid-scaler.md @@ -29,8 +29,8 @@ triggers: **Parameter list:** -- `url` - Graphql url of your Selenium Grid (Required). Refer to the Selenium Grid's documentation [here](https://www.selenium.dev/documentation/en/grid/grid_4/graphql_support/) to for more info. If endpoint requires authentication, you can use `TriggerAuthentication` to provide the credentials instead of embedding in the URL. -- `browserName` - Name of browser that usually gets passed in the browser capability (Required). 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. +- `url` - Graphql url of your Selenium Grid. Refer to the Selenium Grid's documentation [here](https://www.selenium.dev/documentation/en/grid/grid_4/graphql_support/) to for more info. If endpoint requires authentication, you can use `TriggerAuthentication` to provide the credentials instead of embedding in the URL. +- `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) - `unsafeSsl` - Skip certificate validation when connecting over HTTPS. (Values: `true`, `false`, Default: `false`, Optional) From 6ec5ab2b048d5cdc1bfc0c19397248a089ad54c8 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Sun, 3 Nov 2024 17:56:37 +0700 Subject: [PATCH 3/4] Update for selenium-grid-scaler Co-authored-by: Jorge Turrado Ferrero Signed-off-by: Viet Nguyen Duc --- content/docs/2.16/scalers/selenium-grid-scaler.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/2.16/scalers/selenium-grid-scaler.md b/content/docs/2.16/scalers/selenium-grid-scaler.md index a03698d12..a8c455f9d 100644 --- a/content/docs/2.16/scalers/selenium-grid-scaler.md +++ b/content/docs/2.16/scalers/selenium-grid-scaler.md @@ -41,8 +41,8 @@ triggers: **Trigger Authentication** - `username` - Username for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional) - `password` - Password for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional) -- `authType` - Type of authentication to be used. (Optional). This can be set to `Bearer` or `OAuth2` in case Selenium Grid behind an Ingress proxy with other authentication types. -- `accessToken` - Access token (Optional). This is required when `authType` is set a value. +- `authType` - Type of authentication to be used. This can be set to `Bearer` or `OAuth2` in case Selenium Grid behind an Ingress proxy with other authentication types. (Optional) +- `accessToken` - Access token. This is required when `authType` is set a value. (Optional) ### Example From 7ebfabbf1e8353179ffeb5672b2983bf1b50606f Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Mon, 4 Nov 2024 00:52:00 +0700 Subject: [PATCH 4/4] Update as standard Signed-off-by: Viet Nguyen Duc --- 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 a8c455f9d..6ce9d281a 100644 --- a/content/docs/2.16/scalers/selenium-grid-scaler.md +++ b/content/docs/2.16/scalers/selenium-grid-scaler.md @@ -36,7 +36,7 @@ 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) -- `nodeMaxSessions` - Number of maximum sessions that can run in parallel on a Node. (Default: `1`, Optional). Update this parameter align with node config `--max-sessions` (`SE_NODE_MAX_SESSIONS`) to have the correct scaling behavior. +- `nodeMaxSessions` - Number of maximum sessions that can run in parallel on a Node. Update this parameter align with node config `--max-sessions` (`SE_NODE_MAX_SESSIONS`) to have the correct scaling behavior. (Default: `1`, Optional). **Trigger Authentication** - `username` - Username for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional)