Use qualified hostname to access minikube service instead of localhost/127.0.0.1?

6/28/2021

I am running minikube on Windows. I am starting a pod and NodePort like this:

minikube start
kubectl apply -f pod.yml
kubectl apply -f service.yml
kubectl port-forward service/sample-web-service 31111:80

At this point, I can access my sample web service in a browser using:

localhost:31111

and

127.0.0.1:31111

Note, I get no response trying to access the service using the ip returned by minikube ip described here:

https://minikube.sigs.k8s.io/docs/handbook/accessing/#getting-the-nodeport-using-kubectl

Is it possible to also access my sample web service using a qualified hostname (i.e. the Full Computer Name found in Control Panel\All Control Panel Items\System)? I tried the following in a browser but didn't get a response:

my-windows-pc-name.mydomain.com:31111

I am on a VPN and tried turning it off but to no avail.

-- rmf
docker
ip
kubernetes
localhost
minikube

1 Answer

6/28/2021
kubectl port-forward service/sample-web-service --address 0.0.0.0 31111:80
-- rmf
Source: StackOverflow