Apple M1 minikube 无服务 URL
我正在开发 Apple Silicon M1 Max,并尝试通过 Web 浏览器访问服务,但是 minikube service nginx
打开带有某些地址的空白 Web 浏览器选项卡(例如 http:// 192.168.49.2:31542/
) 无法加载。在下面的日志中,您可以注意到 minikube service list
的输出在 URL
列中没有 URL。命令 minikube service nginx --url
也不会返回任何 URL。
$ minikube start --driver=docker
I'm working on Apple Silicon M1 Max and I'm trying to access service through web browser, but minikube service nginx
opens blank web browser tab with some address (for example http://192.168.49.2:31542/
) which fails to load. In log below you can notice output from minikube service list
has no URL in URL
column. Command minikube service nginx --url
does not return any URL as well.
$ minikube start --driver=docker
???? minikube v1.25.2 on Darwin 12.3 (arm64)
▪ MINIKUBE_ACTIVE_DOCKERD=minikube
✨ Using the docker driver based on user configuration
???? Starting control plane node minikube in cluster minikube
???? Pulling base image ...
???? Downloading Kubernetes v1.23.3 preload ...
> preloaded-images-k8s-v17-v1...: 419.07 MiB / 419.07 MiB 100.00% 22.15 Mi
???? Creating docker container (CPUs=2, Memory=7903MB) ...
???? Preparing Kubernetes v1.23.3 on Docker 20.10.12 ...
▪ kubelet.housekeeping-interval=5m
▪ Generating certificates and keys ...
▪ Booting up control plane ...
▪ Configuring RBAC rules ...
???? Verifying Kubernetes components...
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
???? Enabled addons: storage-provisioner, default-storageclass
???? Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
$ kubectl create deployment nginx --image=nginx && kubectl create service nodeport nginx --tcp=80:80
deployment.apps/nginx created
service/nginx created
$ kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 12m
nginx NodePort 10.104.191.210 <none> 80:31542/TCP 12m
$ minikube service list
|-------------|------------|--------------|-----|
| NAMESPACE | NAME | TARGET PORT | URL |
|-------------|------------|--------------|-----|
| default | kubernetes | No node port |
| default | nginx | 80-80/80 | |
| kube-system | kube-dns | No node port |
|-------------|------------|--------------|-----|
$ minikube service nginx --url
???? Starting tunnel for service nginx.
❗ Because you are using a Docker driver on darwin, the terminal needs to be open to run it.
Any ideas why there is no service URL and I am not able to access service from web browser?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果在 Darwin、Windows 或 WSL 上使用 Docker 驱动程序,网络会受到限制,并且无法直接访问节点 IP。
运行服务隧道
在另一个终端中检查 ssh 隧道
在浏览器中打开
参考:
https://minikube.sigs.k8s .io/docs/handbook/accessing/#using-minikube-service-with-tunnel
The network is limited if using the Docker driver on Darwin, Windows, or WSL, and the Node IP is not reachable directly.
Run service tunnel
Check ssh tunnel in another terminal
Open in your browser
ref:
https://minikube.sigs.k8s.io/docs/handbook/accessing/#using-minikube-service-with-tunnel