有没有人有一个Dockerfile或建议用于在Kubernetes上运行phantomJS获取selnium网格节点?我能够在docker中本地运行docker镜像并注册到网格集线器,但是当在Kubernetes中运行时,同一节点似乎不会连接到网格集线器 . 相同的设置适用于在kubernetes中运行的其他docker镜像,其中包含具有Chrome和Firefox的selenium网格节点 .

我一直在努力试图让它运行的两个示例图像是:thisthis . 每个都在本地的docker中工作(至少连接到hub;后者在连接后在selenium中有一个可能无关的bug),但是当在kubernetes中运行时它只吐出通常的三个日志消息中的第一个:

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

但它永远不会连接到集线器,即使我可以从这个节点连接到集线器容器,如果我连接到它并执行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
 ...

在本地,它连接:

[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)