简体   繁体   中英

Kubernetes: Using UDP broadcast to find other pods

I have a clustered legacy application that I am trying to deploy on kubernetes. The nodes in the cluster find each other using UDP broadcast. 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 ). 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. 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.

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)? The kubernetes cluster I am running on uses Calico.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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