我正在使用kubernetes
在minikube
上部署我的应用程序。使用命令部署后
minikube service helloworld-all-service --url
它显示了一些访问应用程序的URL
。类似的东西
http://192.168.49.2:32474
我要从同一网络上的另一台机器访问此应用程序。我试过port-forwarding
kubectl port-forward service/helloworld-all-service 8080:8080
这允许我使用localhost:8080/myApp
访问应用程序。但当我尝试使用我的系统IP时,它不起作用10.14.77.88:8080/myApp
。我在这里做错了什么
通常端口只绑定到localhost,为了使其在外部地址上也可用,您需要指定绑定地址(0.0.0.0绑定到机器上的所有接口(:
kubectl port-forward --address 0.0.0.0 service/helloworld-all-service 8080:8080