I have this in a selenium-hub-service.yml
file:
apiVersion: v1
kind: Service
metadata:
name: selenium-srv
spec:
selector:
app: selenium-hub
ports:
- port: 4444
nodePort: 30001
type: NodePort
sessionAffinity: None
When I do kubectl describe service
on terminal, I get the endpoint of kubernetes service as 192.168.49.2:8443
. I then take that and point the browser to 192.168.49.2:30001
but browser is not able to reach that endpoint. I was expecting to reach selenium hub.
When I do minikube service selenium-srv --url
, which gives me http://127.0.0.1:56498
and point browser to it, I can reach the hub.
My question is: why am I not able to reach through nodePort
?
I would like to do it through nodePort
way because I know the port beforehand and if kubernetes service end point remains constant then it may be easy to point my tests to a known endpoint when I integrate it with azure pipeline.
EDIT: output of kubectl get service
:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 4d
selenium-srv NodePort 10.96.34.117 <none> 4444:30001/TCP 2d2h