Why does KEDA create a second Selenium Node for the second Chrome session instead of using available slots on the first node #7184
Unanswered
distroitt
asked this question in
Q&A / Need Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm running Selenium Grid in Minikube using the official Docker Selenium Helm chart, with KEDA enabled for autoscaling. My goal is to scale Chrome nodes based on session demand, where each node can handle up to 3 parallel sessions. However, when I launch a second identical test job, KEDA spins up a second node instead of assigning the session to one of the available slots on the first node. I'm trying to figure out why this happens.
Kubernetes: Minikube (latest version, single-node cluster). Helm Install Command:
helm install selenium-grid docker-selenium/selenium-grid --values val.yaml --namespace defaultval.yaml
I launch sessions via Python Selenium script in Kubernetes Jobs. The script creates a single Chrome session and keeps it open for testing.
Python code (in a Docker image, run as K8s Job):
K8s Job:
I apply the first Job (kubectl apply -f job1.yaml), wait for it to run, then apply the second (kubectl apply -f job2.yaml with a different name).
This is what happening
First Job: KEDA scales up to 1 Chrome node (selenium-grid-selenium-node-chrome Deployment replicas=1). Hub assigns the session to this node (1/3 slots used).
Second Job: Instead of assigning to the existing node (which has 2/3 slots free), KEDA immediately scales to 2 replicas. New node starts, and the second session goes there.
I tried increasing the pooling interval for the scaled object from 20 seconds to 60 (I suspected that a new application instance wouldn't have time to connect to an existing node). I tried running jobs with a longer interval, about 2-3 minutes. I changed the scaling type for autoscaling from deployment to jobs.
Beta Was this translation helpful? Give feedback.
All reactions