MDNS broadcast from within kubernetes?

11/2/2018

I am using jmdns to broadcast a service over mdns which is then running as a docker image inside a kubernetes pod. The pod yaml looks something like this:

apiVersion: v1
kind: Pod
metadata:
  name: mdns-broadcaster
spec:
  hostNetwork: true
  containers:
    - name: mdns-broadcasting-pod
      image: ...

The application will start up and broadcast some service type _example._tcp. However, running avahi-browse from the single node hosting this pod, I cannot see such a service being broadcast.

Any help would be appreciated, thanks

-- Ben C
docker
jmdns
kubernetes
mdns

1 Answer

11/5/2018

In case anybody cares, I resolved this by moving from mDNS for the kubernetes implementation to avahi. This allows you to then share the dbus directory on the host file system with the pod in order to perform mDNS announcements.

-- Ben C
Source: StackOverflow