简体   繁体   English

使 darwin 上的“minikube 服务”隧道绑定到特定端口

[英]Make `minikube service` tunnel on darwin bind to a specific port

On Mac, minikube needs to create a tunnel to expose services to the host machine.在 Mac 上,minikube 需要创建一个隧道来向主机公开服务。 Normally, it chooses a random port from the available port range for the host side of the tunnel.通常,它从隧道主机端的可用端口范围中选择一个随机端口。

My problem is that I am creating a web service which uses Oauth 3rd party authentication.我的问题是我正在创建一个使用 Oauth 3rd 方身份验证的 web 服务。 The authorized redirect URIs cannot contain port ranges or wildcards.授权的重定向 URI 不能包含端口范围或通配符。 So, a valid redirect URI can be http://127.0.0.1:30200/callback , but it can't be http://127.0.0.1:*/callback , or something like that.因此,有效的重定向 URI 可以是http://127.0.0.1:30200/callback ,但不能是http://127.0.0.1:*/callback或类似的东西。

Is there a way to tell minikube to tunnel through a specific port every time, or fail if the port is unavailable?有没有办法告诉 minikube 每次都通过特定端口进行隧道传输,或者如果端口不可用则失败? I'm struggling to find this option.我正在努力寻找这个选项。

I ended up changing the service type from NodePort to LoadBalancer , and then minikube tunnel "just works" and binds the load balancer to the same port on the host machine.我最终将服务类型从NodePortLoadBalancer ,然后minikube tunnel “正常工作”并将负载均衡器绑定到主机上的同一端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM