Chrome 通过 localhost 访问 kubernetes 服务失败

Access to kubernetes service through localhost fails on Chrome

我一直在 docker docs 学习教程。当 运行 作为独立容器时,使用 localhost 访问容器化应用程序工作正常。但是,一旦我通过 Kuberbetes 或 Swarm 部署它,它就会失败。

在本教程的第 3 部分,我成功部署到 Kubernetes(使用 micro8s.kuberbetis)

kubectl apply -f bb.yaml

然后我得到

deployment.apps/bb-demo created
service/bb-entrypoint created

但是,我无法使用Chrome访问应用程序页面。使用 localhost:30001 和 Chrome,它说 "Waiting on cache..." 然后 "Waiting on localhost..." 永远。

我尝试通过 Firefox 访问它,它工作正常。

避免使用 localhost 访问 Chrome 中的本地页面。在我的例子中,一旦我们切换到 http://127.0.0.1:30001 or using the IP-address or name of the host computer, i.e. http://frodo:30001,它就可以正常工作。