gpt4 book ai didi

ubuntu - 从主机操作系统访问在 Virtualbox 上运行的 Kubernetes 中运行的网站

转载 作者:行者123 更新时间:2023-12-02 11:49:37 24 4
gpt4 key购买 nike

我正在通过在 Windows 10 主机上的 VirtualBox VM 中运行的 Ubuntu 16.04 上的 Kubernetes 快速入门。

它有一个静态 IP 地址为 192.168.133.75 的 NAT 网络适配器。我可以从我的主机 ping 这个地址。

我有运行我的虚拟机的“ socks 店”。这是我运行 kubectl describe svc front-end -n sock-shop 时得到的结果:

Name:               front-end
Namespace: sock-shop
Labels: name=front-end
Selector: name=front-end
Type: NodePort
IP: 10.104.66.95
Port: <unset> 80/TCP
NodePort: <unset> 30001/TCP
Endpoints: 10.32.0.18:8079
Session Affinity: None

所以当我去 10.104.66.95在我的虚拟机上,我看到了网站,一切都很好,在我的主机上没有那么多。

我在网络适配器上设置了端口转发,如下所示(我知道 IP 地址是选项,我也尝试过不使用它们,但它不起作用):

Port Forwarding

我究竟做错了什么?

最佳答案

尝试访问 NodePort在您的主机上,通过以下方式访问该站点:192.168.133.75:30001
引用:https://kubernetes.io/docs/user-guide/services/#type-nodeport

关于ubuntu - 从主机操作系统访问在 Virtualbox 上运行的 Kubernetes 中运行的网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41699924/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com