I am trying to convert some K8s examples from ReplicationControllers to Deployments. These examples are for a Selenium grid located: https://github.com/kubernetes/examples/tree/master/staging/selenium
When I run the examples as-is, my selenium-hub and selenium-nodes connect successfully. However, when I tried to convert selenium-hub-rc.yaml
and selenium-node-chrome-rc.yaml
into Deployments, the selenium-nodes will not connect to the selenium-hub.
In selenium-node-chrome-rc.yaml
there are these variables:
...
env:
- name: HUB_PORT_4444_TCP_ADDR
value: "selenium-hub"
- name: HUB_PORT_4444_TCP_PORT
value: "4444"
...
HUB_PORT_4444_TCP_ADDR
is the ip/hostname of the selenium-hub. The selenium-hub-rc.yaml
shows the phrase selenium-hub
in many locations. Question 1: which of these is actually defining the host name? (.metadata.name
, .spec.selector.app
, ...?)
apiVersion: v1
kind: ReplicationController
metadata:
name: selenium-hub <-------------------
labels:
app: selenium-hub <-------------------
spec:
replicas: 1
selector:
app: selenium-hub <-------------------
template:
metadata:
labels:
app: selenium-hub <-------------------
spec:
containers:
- name: selenium-hub <-------------------
....
Now, I changed this selenium-hub-rc.yaml
to a deployment:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: selenium-hub-deployment <---------- this is the hostname?
spec:
replicas: 1
template:
metadata:
labels:
app: selenium-grid
spec:
containers:
- name: selenium-hub <--------- this is the hostname?
image: selenium/hub
ports:
- containerPort: 4444
...
But now the selenium-node won't connect and I believe it is due to HUB_PORT_4444_TCP_ADDR
. I have tried:
- name: HUB_PORT_4444_TCP_ADDR
value: "selenium-hub"
and
- name: HUB_PORT_4444_TCP_ADDR
value: "selenium-hub-deployment"
Neither worked. Question 2: What is the hostname for a deployment? It seemed straight forward in the ReplicationController yaml e.g. selenium-hub
, but I can't get it to work as a deployment.
Note, I have not changed the service in any way. Actually I DID change it and that partially caused my initial issue.