2

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 (i.e. docker network create --internal mynet, leading to a subnet e.g. 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.

Fredrik
  • 21
  • 2
  • Using broadcast is really a rookie move. Multicast was designed for things like this. Broadcast interrupts _every_ host on the LAN, but multicast only interrupts the hosts listening to the multicast group.. If you software uses broadcast for this type of thing, our company is not interested in you product. – Ron Maupin May 14 '17 at 21:29
  • Multicast would work for me as well. My basic problem is more related on how to do this on k8s. – Fredrik May 15 '17 at 07:27

1 Answers1

0

Maybe you can Set label for your app pod, and try NetworkPolicy on Calico.

luke
  • 36
  • 4