简体   繁体   English

Docker 通过容器主机或 Swarm-Manager 进行 Swarm 传出通信?

[英]Docker Swarm outgoing communication via Container Host or Swarm-Manager?

I have several Docker-Swarm nodes with 1 to n service-Containers.我有几个带有 1 到 n 个服务容器的 Docker-Swarm 节点。

How is external communication from those service-containers realized in Docker?在 Docker 中,这些服务容器的外部通信是如何实现的?

I do have a mail-server which is on a different network than the swarm divided by a firewall.我确实有一个邮件服务器,它与由防火墙分隔的群位于不同的网络上。 When I do wish to send mails via smtp using my mail-server which IP would I have to whitelist in the Firewall?当我确实希望使用我的邮件服务器通过 smtp 发送邮件时,我必须在防火墙中将哪个 IP 列入白名单? The manager node or all the worker nodes?管理节点还是所有工作节点? On the other hand is there any way to configure the swarm to initiate communications from the containers using the manager as gateway?另一方面,有什么方法可以配置 swarm 以使用管理器作为网关从容器发起通信?

I hope this was not too confusing and/or complicated.我希望这不会太混乱和/或复杂。

Thanks in advance.提前致谢。

Routing entire outbound traffic through the selected node kinda defeat the purpose behind swarm cluster I think.我认为,通过选定节点路由整个出站流量有点违背 swarm 集群背后的目的。 There is possibility to use external load balancer instead of swarm routing mesh, but it will affect only inbound, not outgoing connections.有可能使用外部负载均衡器而不是 swarm 路由网格,但它只会影响入站连接,而不影响出站连接。

In case of SMTP traffic you could use simple mail relay service like DavMail .对于SMTP流量,您可以使用像DavMail这样的简单邮件中继服务。 Install it on selected node of your cluster, send mail from any container to it, and then Davmail will route mail to your actual server.将它安装在集群的选定节点上,从任何容器向其发送邮件,然后Davmail会将邮件路由到您的实际服务器。 Then you will need whitelist only this node on your firewall.然后,您只需要在防火墙上将此节点列入白名单。

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

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