Cannot access NodePort service outside Kubernetes cluster Cannot access NodePort service outside Kubernetes cluster kubernetes kubernetes

Cannot access NodePort service outside Kubernetes cluster


If you want to access it not using localhost you should use your <windows_hosts's_IP:NodePort>.

So having your deployment and service deployed:

$kubectl get svc,deployNAME                 TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGEservice/echoserver   NodePort    10.105.169.2   <none>        8080:31570/TCP   4m12sservice/kubernetes   ClusterIP   10.96.0.1      <none>        443/TCP          5m3sNAME                         READY   UP-TO-DATE   AVAILABLE   AGEdeployment.apps/echoserver   1/1     1            1           4m19s

You can either access it by using localhost:31570 or <windows_hosts's_IP:NodePort>.

In my case 192.168.0.29 is my Windows host's IP:

curl.exe 192.168.0.29:31570CLIENT VALUES:client_address=192.168.65.3command=GETreal path=/query=nilrequest_version=1.1request_uri=http://192.168.0.29:8080/