且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

curl:(7)无法连接到192.168.99.100端口31591:连接被拒绝

更新时间:2021-12-13 22:37:22

显然,您正在尝试在群集外部访问服务,因此您需要公开服务IP以进行外部连接.

Apparently, you are trying to reach your service outside of the cluster, thus you need to expose your service IP for external connection.

运行kubectl edit svc hello-minikube2并更改

type: NodePort

type: LoadBalancer

kubectl expose deployment hello-minikube2 --type=LoadBalancer --port=8080

在支持负载平衡器的云提供商上,将提供一个外部IP地址来访问服务.在Minikube上,LoadBalancer类型使服务可以通过minikube service命令访问.

On cloud providers that support load balancers, an external IP address would be provisioned to access the Service. On Minikube, the LoadBalancer type makes the Service accessible through the minikube service command.

运行以下命令:

minikube service hello-minikube2