external-mdns icon indicating copy to clipboard operation
external-mdns copied to clipboard

mDNS within cluster network

Open PAI5REECHO opened this issue 2 years ago • 2 comments

How do I configure mDNS to work within the cluster itself? i.e.:

$ kubectl run -i --tty --rm  --image=alpine --restart=Never --command -- bash

If you don't see a command prompt, try pressing enter.

/ # ping pg.net.local
ping: bad address 'pg.net.local'

PAI5REECHO avatar Dec 21 '23 00:12 PAI5REECHO

Hi @PAI5REECHO, currently the container uses the scratch Docker image and only contains the external-mdns binary. This would need a different base image, such as Alpine, in order to allow you to exec into the container.

If you're simply looking to test .local DNS resolution from within the cluster, you might try out nicolaka/netshoot.

blake avatar Mar 09 '24 17:03 blake

@PAI5REECHO this project publishes MDNS announcements, it doesn't resolve them - the use cases will be hosts outside of your cluster and it does not directly cater for the scope you mentioned. What you would need is MDNS support in the DNS resolvers used by the Kubernetes nodes which the pods forward onto and this would typically mean an MDNS resolver running on each Kubernetes node by default but this again depends on the pod configuration as well as the specific Kubernetes node implementation you are using.

iamasmith avatar Mar 09 '24 18:03 iamasmith