Unable to access the app which hosted on minikube & Service type is : NodePort

HI Team,

I installed minikube on my windows 10 and using docker desktop. I created one nodeport service which targeted to nginx pod.

I am unable to access the url , getting error " This site can not be reached"
when i used to minikube service service_ name → then its redirect to browser and application is accessible. but direct minikube ip its not working. Could help me to resolve the issue.

PS C:\Users\ADMIN> curl -v http://192.168.49.2:30000/
VERBOSE: GET http://192.168.49.2:30000/ with 0-byte payload
curl : Unable to connect to the remote server
At line:1 char:1

  • curl -v http://192.168.49.2:30000/
  •   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
    
    

PS C:\Users\ADMIN>
PS C:\Users\ADMIN> Invoke-WebRequest http://192.168.49.2:30000/
Invoke-WebRequest : Unable to connect to the remote server
At line:1 char:1

  • Invoke-WebRequest http://192.168.49.2:30000/
  •   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
    
    

PS C:\Users\ADMIN> kubectl get svc -o wide
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
hello-minikube NodePort 10.108.171.129 8080:32041/TCP 45m app=hello-minikube
kubernetes ClusterIP 10.96.0.1 443/TCP 20h
nginx-pod NodePort 10.102.83.232 8082:30000/TCP 49m app=nginx-pod

Minikube is running in a Linux VM provided by docker desktop. The node ports are exposed in there, not to Windows. Simplest way to get to the service is to do a port forward

See step 4 on this page.