简体   繁体   English

Kubernetes:使用UDP广播查找其他pod

[英]Kubernetes: Using UDP broadcast to find other pods

I have a clustered legacy application that I am trying to deploy on kubernetes. 我有一个我试图在kubernetes上部署的集群遗留应用程序。 The nodes in the cluster find each other using UDP broadcast. 群集中的节点使用UDP广播找到彼此。 I cannot change this behaviour for various reasons. 我出于各种原因无法改变这种行为。

When deployed on docker, this would be done by creating a shared network (ie docker network create --internal mynet , leading to a subnet eg 172.18.0.0/16), and connecting the containers containing the clustered nodes to the same network ( docker network connect mynet instance1 and docker network connect mynet instance2 ). 当在部署搬运工,这将通过创建一个共享的网络(即,进行docker network create --internal mynet ,导致子网例如172.18.0.0/16),以及连接包含群集节点到同一网络的容器( docker network connect mynet instance1docker network connect mynet instance1 docker network connect mynet instance2 )。 Then every instance starting would broadcast it's IP address periodically on this network using 172.18.255.255 until they have formed a cluster. 然后每个实例启动将使用172.18.255.255在此网络上定期广播它的IP地址,直到它们形成一个集群。 Multiple such clusters could reside in the same kubernetes namespace, so preferrably I would like to create my own "private network" just for these pods to avoid port collisions. 多个这样的集群可以驻留在相同的kubernetes名称空间中,所以我最好只为这些pod创建我自己的“专用网络”以避免端口冲突。

Is there a way of creating such a network on kubernetes, or otherwise trick the application into believing it is connected to such a network (assuming the IP addresses of the other nodes are known)? 有没有办法在kubernetes上创建这样的网络,或者欺骗应用程序使其相信它连接到这样的网络(假设其他节点的IP地址已知)? The kubernetes cluster I am running on uses Calico. 我正在运行的kubernetes集群使用Calico。

也许您可以为您的应用程序窗格设置标签,并在Calico上尝试NetworkPolicy

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

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