Score:2

Multicast between kubernetes pods

am flag

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.

SYN avatar
hk flag
SYN
You'll probably want to investigate tools like Multus ( https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/docs/quickstart.md ).
Score:1
am flag

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.

Mikha avatar
cn flag
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!
Francisco avatar
am flag
@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.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.