Skip to content

Commit 9a0a137

Browse files
authored
K8s: Update KEDA patch version for feature preview (#2649)
* K8s: Update KEDA patch version for feature preview * Update PRs status * Fetch latest scaler resources --------- Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 9fa52f1 commit 9a0a137

File tree

6 files changed

+346
-55
lines changed

6 files changed

+346
-55
lines changed

.keda/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ You can involve to review and discuss the pull requests to help us early detect
4949

5050
[kedacore/keda](https://github.com/kedacore/keda)
5151

52-
- https://github.com/kedacore/keda/pull/6477
52+
- https://github.com/kedacore/keda/pull/6536 (plan, v2.17.0)
53+
54+
- https://github.com/kedacore/keda/pull/6477 (plan, v2.17.0)
5355

5456
- ~~https://github.com/kedacore/keda/pull/6437 (merged, v2.16.1)~~
5557

@@ -59,9 +61,11 @@ You can involve to review and discuss the pull requests to help us early detect
5961

6062
[kedacore/keda-docs](https://github.com/kedacore/keda-docs)
6163

62-
- https://github.com/kedacore/keda-docs/pull/1522
64+
- https://github.com/kedacore/keda-docs/pull/1533 (plan, v2.17.0)
65+
66+
- https://github.com/kedacore/keda-docs/pull/1522 (plan, v2.17.0)
6367

64-
- https://github.com/kedacore/keda-docs/pull/1515
68+
- ~~https://github.com/kedacore/keda-docs/pull/1515 (merged, v2.16.1)~~
6569

6670
- ~~https://github.com/kedacore/keda-docs/pull/1468 (merged, v2.16.0)~~
6771

.keda/scalers/selenium-grid-scaler.md

Lines changed: 73 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ triggers:
2323
browserName: '' # Optional. Required to be matched with the request in queue and Node stereotypes (Similarly for `browserVersion` and `platformName`).
2424
browserVersion: '' # Optional.
2525
platformName: '' # Optional.
26-
unsafeSsl : 'false' # Optional.
26+
unsafeSsl: 'false' # Optional.
2727
activationThreshold: 0 # Optional.
2828
```
2929
@@ -37,6 +37,7 @@ triggers:
3737
- `activationThreshold` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional)
3838
- `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. (Optional)
3939
- `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).
40+
- `capabilities` - Add more custom capabilities for matching specific Nodes. (Optional)
4041

4142
**Trigger Authentication**
4243
- `username` - Username for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional)
@@ -88,7 +89,7 @@ spec:
8889
url: 'http://selenium-hub:4444/graphql'
8990
browserName: 'chrome'
9091
platformName: 'Linux'
91-
unsafeSsl : 'true'
92+
unsafeSsl: 'true'
9293
```
9394

9495
Noted:
@@ -198,7 +199,7 @@ spec:
198199
browserName: 'chrome'
199200
platformName: 'Linux'
200201
browserVersion: '131.0'
201-
unsafeSsl : 'true'
202+
unsafeSsl: 'true'
202203
```
203204

204205
The request to trigger this scaler should be
@@ -210,6 +211,69 @@ options.set_capability('browserVersion', '131.0')
210211
driver = webdriver.Remote(options=options, command_executor=SELENIUM_GRID_URL)
211212
```
212213

214+
For an advanced use case, you also can set custom capabilities for matching specific Nodes in the scaler trigger metadata. For example
215+
216+
```yaml
217+
kind: Deployment
218+
metadata:
219+
name: selenium-node-chrome
220+
labels:
221+
deploymentName: selenium-node-chrome
222+
spec:
223+
replicas: 1
224+
template:
225+
spec:
226+
containers:
227+
- name: selenium-node-chrome
228+
image: selenium/node-chrome:132.0
229+
ports:
230+
- containerPort: 5555
231+
env:
232+
- name: SE_NODE_BROWSER_VERSION
233+
value: '132.0'
234+
- name: SE_NODE_PLATFORM_NAME
235+
value: 'Linux'
236+
# Append custom capabilities to Node stereotype. See: https://github.com/SeleniumHQ/docker-selenium?tab=readme-ov-file#node-configuration-options
237+
- name: SE_NODE_STEREOTYPE_EXTRA
238+
value: "{\"myApp:version\":\"beta\", \"myApp:publish:\":\"public\"}"
239+
240+
---
241+
242+
apiVersion: keda.sh/v1alpha1
243+
kind: ScaledObject
244+
metadata:
245+
name: selenium-grid-scaledobject-chrome-132
246+
namespace: keda
247+
labels:
248+
deploymentName: selenium-node-chrome-132
249+
spec:
250+
maxReplicaCount: 8
251+
scaleTargetRef:
252+
name: selenium-node-chrome-132
253+
triggers:
254+
- type: selenium-grid
255+
metadata:
256+
url: 'http://selenium-hub:4444/graphql'
257+
browserName: 'chrome'
258+
platformName: 'Linux'
259+
browserVersion: '132.0'
260+
unsafeSsl: 'true'
261+
# Add custom capabilities for matching specific Nodes in scaler trigger metadata. See: https://github.com/kedacore/keda/pull/6536
262+
capabilities: "{\"myApp:version\":\"beta\", \"myApp:publish:\":\"public\"}"
263+
```
264+
265+
The request to trigger this scaler should be
266+
267+
```python
268+
options = ChromeOptions()
269+
options.set_capability('platformName', 'Linux')
270+
options.set_capability('browserVersion', '132.0')
271+
# Add custom capabilities for matching specific Nodes in client binding. See: https://www.selenium.dev/documentation/grid/configuration/toml_options/#setting-custom-capabilities-for-matching-specific-nodes
272+
options.set_capability('myApp:version', 'beta')
273+
options.set_capability('myApp:publish', 'public')
274+
driver = webdriver.Remote(options=options, command_executor=SELENIUM_GRID_URL)
275+
```
276+
213277
Similarly, for Firefox
214278

215279
```yaml
@@ -230,7 +294,7 @@ spec:
230294
url: 'http://selenium-hub:4444/graphql'
231295
browserName: 'firefox'
232296
platformName: 'Linux'
233-
unsafeSsl : 'true'
297+
unsafeSsl: 'true'
234298
```
235299

236300
Request to trigger the scaler
@@ -262,7 +326,7 @@ spec:
262326
browserName: 'MicrosoftEdge'
263327
sessionBrowserName: 'msedge'
264328
platformName: 'Linux'
265-
unsafeSsl : 'true'
329+
unsafeSsl: 'true'
266330
```
267331

268332
Request to trigger the scaler
@@ -294,7 +358,7 @@ spec:
294358
browserName: 'chrome'
295359
platformName: 'Linux'
296360
nodeMaxSessions: 4
297-
unsafeSsl : 'true'
361+
unsafeSsl: 'true'
298362
```
299363

300364
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.
@@ -318,7 +382,7 @@ spec:
318382
browserName: 'chrome'
319383
platformName: 'Linux'
320384
browserVersion: '91.0'
321-
unsafeSsl : 'true'
385+
unsafeSsl: 'true'
322386
```
323387

324388
```yaml
@@ -340,7 +404,7 @@ spec:
340404
browserName: 'chrome'
341405
platformName: 'Linux'
342406
browserVersion: '90.0'
343-
unsafeSsl : 'true'
407+
unsafeSsl: 'true'
344408
```
345409

346410
### Authentication Parameters
@@ -396,7 +460,7 @@ spec:
396460
metadata:
397461
browserName: 'chrome'
398462
platformName: 'Linux'
399-
unsafeSsl : 'true'
463+
unsafeSsl: 'true'
400464
authenticationRef:
401465
name: keda-trigger-auth-selenium-grid-secret
402466
```

0 commit comments

Comments
 (0)