blake / external-mdns

A service to advertise records for Kubernetes resources on a LAN over multicast DNS.
Apache License 2.0
71 stars 9 forks source link

mDNS within cluster network #18

Open PAI5REECHO opened 11 months ago

PAI5REECHO commented 11 months ago

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'
blake commented 8 months ago

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.

iamasmith commented 8 months ago

@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.