Running PhantomJS Selenium Node on Kubernetes

3/6/2017

Does anyone have a Dockerfile or advice for getting a selnium grid node with phantomJS running on Kubernetes? I'm able to get docker images run locally in docker and register to a grid hub, but the same node does not appear to connect to the grid hub when run in Kubernetes. The same setup works fine for other docker images running in kubernetes with selenium grid nodes having Chrome and Firefox.

Two example images I've been battling with to try to get it to run are: this and this. Each works in docker locally (at least to connect to the hub; the latter has a likely unrelated bug in selenium after it connects), but when run in kubernetes it spits out only the first of the usual three log messages:

[INFO  - 2017-03-06T15:28:42.018Z] GhostDriver - Main - running on port 4444

But it never connects to the hub, even though I can wget to the hub container from this node if I connect to it and exec bash.

 seluser@selenium-node-phantomjs-f8vj6:/$ wget selenium-hub:4444 --2017-03-06 15:33:29--  http://selenium-hub:4444/
 Resolving selenium-hub (selenium-hub)... 100.68.165.77
 Connecting to selenium-hub (selenium-hub)|100.68.165.77|:4444... connected.
 HTTP request sent, awaiting response... 200 OK
 ...

Locally, it connects:

[INFO  - 2017-03-06T15:31:56.443Z] GhostDriver - Main - running on port 4444
[INFO  - 2017-03-06T15:31:56.443Z] GhostDriver - Main - registering to Selenium HUB 'http://172.17.0.2:4444' using '172.17.0.3:4444'
[INFO  - 2017-03-06T15:31:56.454Z] HUB Register - register - Registered with grid hub: http://172.17.0.2:4444/ (ok)
-- JJC
docker
kubernetes
phantomjs
selenium

0 Answers