Multicast Discovery Stops at the Pod Overlay, So DLNA Servers Need hostNetwork
DLNA and UPnP devices find each other with multicast on the local network (SSDP on 239.255.255.250, UDP 1900). A pod on an overlay network such as Flannel lives on a separate virtual network: the LAN's multicast never reaches it, and its announcements never leave the node. A media server that works perfectly from a browser is therefore invisible to TVs. Running the pod with hostNetwork: true puts it on the node's real interface, where discovery works.
Why Services Don't Help
A LoadBalancer or NodePort Service forwards unicast traffic to known ports. Discovery is the opposite: the TV shouts to a multicast group and waits for whoever answers. Multicast is local to a network segment; routers and the overlay don't forward it into the pod network, and nothing in a Service definition makes them.
The Fix and Its Price
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet # keep cluster DNS working
The pod now uses the node's IP and network stack: it joins the LAN's multicast groups and answers discovery as if it ran directly on the machine.
After Discovery: Client Profiles
Once found, a TV may still fail to play files it claims to support. Media servers pick between streaming the file directly and transcoding it using a device profile; when the profile overstates the TV's codecs (MKV containers, HEVC video), playback fails. Removing those formats from the profile's direct-play list forces the server to transcode to H.264.
References
- Kubernetes MOC - hub for Kubernetes notes.
- Overlay Networks Encapsulate Pod Traffic Inside Node-to-Node Packets - why pod networks are separate from the LAN.
- Kubernetes documentation: Pod spec, hostNetwork -
hostNetworkanddnsPolicy.
Review cards
Flashcard Why do DLNA servers need `hostNetwork: true` in Kubernetes pods?
Because the pod's multicast traffic is isolated by the overlay network and doesn't reach the local network where DLNA clients are.
Flashcard Why can't a LoadBalancer or NodePort Service make a DLNA server discoverable?
Services forward unicast traffic to known ports. Discovery is multicast (SSDP on 239.255.255.250, UDP 1900), which stays on the LAN segment and never enters the pod network.
Quiz What does hostNetwork: true give a DLNA server pod?
- It joins the LAN's multicast groups and answers discovery
- Several such pods can share a port on the same node
- Cluster DNS keeps working without any other setting
- It can no longer reach other pods
The pod uses the node's network stack. Its ports are the node's ports, so two can't share one, and cluster DNS needs dnsPolicy: ClusterFirstWithHostNet.