Enabling multicast for a project
Multicast traffic between OKD pods is disabled by default. If you are using the OVN-Kubernetes default Container Network Interface (CNI) network provider, you can enable multicast on a per-project basis.
Enabling multicast between pods
You can enable multicast between pods for your project.
Prerequisites
Install the OpenShift CLI ().
You must log in to the cluster with a user that has the
cluster-admin
role.
Run the following command to enable multicast for a project. Replace
<namespace>
with the namespace for the project you want to enable multicast for.You can alternatively apply the following YAML to add the annotation:
apiVersion: v1
kind: Namespace
metadata:
name: <namespace>
annotations:
k8s.ovn.org/multicast-enabled: “true”
Verification
To verify that multicast is enabled for a project, complete the following procedure:
Change your current project to the project that you enabled multicast for. Replace
<project>
with the project name.-
$ cat <<EOF| oc create -f -
apiVersion: v1
kind: Pod
metadata:
name: msender
labels:
app: multicast-verify
spec:
containers:
image: registry.access.redhat.com/ubi8
command: ["/bin/sh", "-c"]
["dnf -y install socat && sleep inf"]
EOF
Start the multicast listener.
Get the IP address for the Pod:
$ POD_IP=$(oc get pods mlistener -o jsonpath='{.status.podIP}')
To start the multicast listener, in a new terminal window or tab, enter the following command:
Start the multicast transmitter.
Get the pod network IP address range:
$ CIDR=$(oc get Network.config.openshift.io cluster \
-o jsonpath='{.status.clusterNetwork[0].cidr}')
To send a multicast message, enter the following command:
$ oc exec msender -i -t -- \