Skip to content

Commit c294814

Browse files
authored
Fix preStop behavior for KEDA scale-down
Updated the preStop hook to decouple it from Selenium node command-line arguments. This prevents random node terminations during KEDA scale-down.
1 parent 203cffc commit c294814

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

website_and_docs/content/blog/2022/scaling-grid-with-keda.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ spec:
118118
lifecycle:
119119
preStop:
120120
exec:
121-
command: ["/bin/sh", "-c", "curl --request POST 'localhost:5555/se/grid/node/drain' --header 'X-REGISTRATION-SECRET;'; tail --pid=$(pgrep -f '[n]ode --bind-host false --config /opt/selenium/config.toml') -f /dev/null; sleep 30s"]
121+
command: ["/bin/sh", "-c", "curl --request POST 'localhost:5555/se/grid/node/drain' --header 'X-REGISTRATION-SECRET;'; while curl -fs localhost:5555/status >/dev/null; do sleep 1; done; sleep 10"]
122122
```
123123
124124
#### Breaking this down
@@ -219,4 +219,4 @@ spec:
219219
command: ["/bin/sh", "-c", "curl --request POST 'localhost:5555/se/grid/node/drain' --header 'X-REGISTRATION-SECRET;'; tail --pid=$(pgrep -f '[n]ode --bind-host false --config /opt/selenium/config.toml') -f /dev/null; sleep 30s"]
220220
```
221221

222-
That is it, your Selenium Grid pods should now scale up and down properly without any lost sessions!
222+
That is it, your Selenium Grid pods should now scale up and down properly without any lost sessions!

0 commit comments

Comments
 (0)