Description
What happened?
I was going through the helm chart steps here: https://github.com/SeleniumHQ/docker-selenium/blob/trunk/charts/selenium-grid/README.md
Everything worked and initialized fine in helm/kubectl, but two commands/steps were missing to get the ingress url (default is selenium-grid.local
) to be useful. I am new to all of this and I kept getting this:
$ ping selenium-grid.local
ping: selenium-grid.local: Name or service not known
And therefore, when trying to create a RemoteWebDriver using the ingress URL like this in Java:
String gridIngressUrl = "http://selenium-grid.local";
ChromeOptions caps = new ChromeOptions();
RemoteWebDriver driver = new RemoteWebDriver(new URL(gridIngressUrl), caps);
was giving me this exception:
Caused by: java.net.UnknownHostException: selenium-grid.local.: Name or service not known
I figured out these 2 steps were required to get the ingress urls to work:
Step 1: Verify ingress config, run: kubectl get ingress
$ kubectl get ingress
NAME CLASS HOSTS ADDRESS PORTS AGE
selenium-ingress nginx selenium-grid.local 192.168.49.2 80 45m
Step 2: Add the IP and host name to the local host file in /etc/hosts
, like:
192.168.49.2 selenium-grid.local
It would be very useful to add it to this README: https://github.com/SeleniumHQ/docker-selenium/blob/trunk/charts/selenium-grid/README.md
Command used to start Selenium Grid with Docker
helm install selenium-grid docker-selenium/selenium-grid
Relevant log output
$ ping selenium-grid.local
ping: selenium-grid.local: Name or service not known
Operating System
Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-1031-aws x86_64)
Docker Selenium version (tag)
$ helm list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
selenium-grid default 1 2023-03-16 18:27:29.187525806 -0500 CDT deployed selenium-grid-0.15.4 4.8.1-20230306