Skip to content

Commit

Permalink
Fix review comment
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 committed Dec 23, 2024
1 parent a773b90 commit 3189031
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
11 changes: 6 additions & 5 deletions content/docs/2.16/scalers/selenium-grid-scaler.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,13 @@ triggers:
- `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. Update this parameter align with node config `--max-sessions` (`SE_NODE_MAX_SESSIONS`) to have the correct scaling behavior. (Default: `1`, Optional).
- `targetQueueLength` - The target number of queued sessions to scale on. (Default: `1`, Optional).

**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. 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)

### How does it work?

The scaler will query the Hub GraphQL response to get the number of queued sessions in the specified combination of browser name, version, and platform. If the number of queued sessions is **equal to or greater than** the `targetQueueLength`, the scaler will scale up.

### Example

Here is a full example of scaled object definition using Selenium Grid trigger:
Expand Down Expand Up @@ -90,6 +85,7 @@ spec:
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'chrome'
platformName: 'Linux'
unsafeSsl : 'true'
```

Expand Down Expand Up @@ -231,6 +227,7 @@ spec:
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'firefox'
platformName: 'Linux'
unsafeSsl : 'true'
```

Expand Down Expand Up @@ -293,6 +290,7 @@ spec:
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'chrome'
platformName: 'Linux'
nodeMaxSessions: 4
unsafeSsl : 'true'
```
Expand All @@ -316,6 +314,7 @@ spec:
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'chrome'
platformName: 'Linux'
browserVersion: '91.0'
unsafeSsl : 'true'
```
Expand All @@ -337,6 +336,7 @@ spec:
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'chrome'
platformName: 'Linux'
browserVersion: '90.0'
unsafeSsl : 'true'
```
Expand Down Expand Up @@ -393,6 +393,7 @@ spec:
- type: selenium-grid
metadata:
browserName: 'chrome'
platformName: 'Linux'
unsafeSsl : 'true'
authenticationRef:
name: keda-trigger-auth-selenium-grid-secret
Expand Down
15 changes: 8 additions & 7 deletions content/docs/2.17/scalers/selenium-grid-scaler.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This specification describes the `selenium-grid` trigger that scales browser nod

The scaler creates one browser node per pending request in session queue, divided by the max amount of sessions that can run in parallel. You will have to create one trigger per browser capability that you would like to support in your Selenium Grid.

The below is an example trigger configuration with default values.
The below is an example trigger configuration with default values represent.

```yaml
triggers:
Expand All @@ -37,18 +37,13 @@ triggers:
- `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. Update this parameter align with node config `--max-sessions` (`SE_NODE_MAX_SESSIONS`) to have the correct scaling behavior. (Default: `1`, Optional).
- `targetQueueLength` - The target number of queued sessions to scale on. (Default: `1`, Optional).

**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. 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)

### How does it work?

The scaler will query the Hub GraphQL response to get the number of queued sessions in the specified combination of browser name, version, and platform. If the number of queued sessions is **equal to or greater than** the `targetQueueLength`, the scaler will scale up.

### Example

Here is a full example of scaled object definition using Selenium Grid trigger:
Expand All @@ -70,7 +65,7 @@ spec:
- containerPort: 5555
env:
- name: SE_NODE_BROWSER_VERSION
value: ""
value: ''
---
Expand All @@ -90,6 +85,7 @@ spec:
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'chrome'
platformName: 'Linux'
unsafeSsl : 'true'
```

Expand Down Expand Up @@ -231,6 +227,7 @@ spec:
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'firefox'
platformName: 'Linux'
unsafeSsl : 'true'
```

Expand Down Expand Up @@ -293,6 +290,7 @@ spec:
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'chrome'
platformName: 'Linux'
nodeMaxSessions: 4
unsafeSsl : 'true'
```
Expand All @@ -316,6 +314,7 @@ spec:
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'chrome'
platformName: 'Linux'
browserVersion: '91.0'
unsafeSsl : 'true'
```
Expand All @@ -337,6 +336,7 @@ spec:
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'chrome'
platformName: 'Linux'
browserVersion: '90.0'
unsafeSsl : 'true'
```
Expand Down Expand Up @@ -393,6 +393,7 @@ spec:
- type: selenium-grid
metadata:
browserName: 'chrome'
platformName: 'Linux'
unsafeSsl : 'true'
authenticationRef:
name: keda-trigger-auth-selenium-grid-secret
Expand Down

0 comments on commit 3189031

Please sign in to comment.