简体   繁体   English

如何从Rancher的专用网络中公开docker容器?

[英]How to expose docker container from Rancher's private network?

Let's say that I have a HAProxy load-balancer inside Rancher's private network. 假设我在Rancher的专用网络中有一个HAProxy负载均衡器。 Now I'd like to expose it somehow to the world, so it could receive requests from somewhere else apart of other docker containers living next to it. 现在我想以某种方式将它暴露给世界,因此它可以接收来自其他生活在其旁边的其他码头集装箱的其他地方的请求。

If it was just a simple docker container than I probably should map port from docker container to some interface with IP address which is accessible from outside of docker network. 如果它只是一个简单的docker容器,我可能应该将docker容器中的端口映射到具有可从docker网络外部访问的IP地址的某个接口。

Probably I can do the same with container in Rancher, but this means that I have to configure network manually on every host where this container might run. 可能我可以在Rancher中对容器执行相同的操作,但这意味着我必须在可能运行此容器的每个主机上手动配置网络。 And this kind of work is exactly what I'm trying to avoid using orchestration tool like Rancher. 而这种工作正是我试图避免使用像Rancher这样的编排工具。

How do you do that? 你是怎样做的? How do you expose containers living inside of private network to the world? 如何将生活在私人网络内的容器暴露给世界?

使用Load Balancer服务,请查看文档: http//docs.rancher.com/rancher/rancher-ui/applications/stacks/adding-balancers/

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

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