我使用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上工作。我到底做错了什么?
发布于 2020-11-23 14:15:31
正常情况下,端口仅绑定到localhost,要使其在外部地址上也可用,您需要指定绑定地址(0.0.0.0绑定到机器上的所有接口):
kubectl port-forward --address 0.0.0.0 service/helloworld-all-service 8080:8080https://stackoverflow.com/questions/64962891
复制相似问题