2

I have an app in which there are a few tasks that communicate using publisher/subscriber. The main problem is that the pub/sub discovery works by multicasting information to the other tasks, but when I deploy those tasks in k8s, the pods can't multicast between them as they have private IPs assigned.

I have read about using services, but it didn't convince me because I would lose the peer to peer structure.

Is there a way to enable 2 pods from the same cluster to see each other using multicast? For additional info, the pub/sub I am using is Zenoh.

Francisco
  • 31
  • 5
  • You'll probably want to investigate tools like Multus ( https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/docs/quickstart.md ). – SYN Oct 25 '22 at 10:37

1 Answers1

1

Thanks to SYN comment I have been able to find a way. If you use microK8s distribution is quite straightforward, this link contains a good guide: https://microk8s.io/docs/addon-multus.

It is also supposed to be possible with K3s by installing flannel and then multus, but I haven't tried it so I can't assure it.

Francisco
  • 31
  • 5
  • 1
    Would you mind to share multus config that you used? I've got a similar task, but for the loopback interface only - I suspect I will need to go the Multus path as well, and probably there will be similarities between setting up multicast for the whole network and just for loopback. Here are details of my task: https://serverfault.com/q/1114351 Thanks! – Mikha Oct 30 '22 at 22:27
  • @Mikha For the network attachment definition I've used the one in the microk8s link. For the pod deployment file I've used the net configuration in the example, didn't configure much more than the name of the network. – Francisco Oct 31 '22 at 23:11