{"id":15643203,"url":"https://github.com/blake/external-mdns","last_synced_at":"2025-04-06T16:11:21.754Z","repository":{"id":41139327,"uuid":"286172430","full_name":"blake/external-mdns","owner":"blake","description":"A service to advertise records for Kubernetes resources on a LAN over multicast DNS.","archived":false,"fork":false,"pushed_at":"2025-03-05T20:19:34.000Z","size":55,"stargazers_count":87,"open_issues_count":10,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T15:07:52.096Z","etag":null,"topics":["kubernetes-service","mdns"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blake.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-09T05:21:50.000Z","updated_at":"2025-03-08T02:21:09.000Z","dependencies_parsed_at":"2024-03-10T22:20:23.141Z","dependency_job_id":"b44e4f26-2dd8-4935-9490-d03aedc3b22d","html_url":"https://github.com/blake/external-mdns","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blake%2Fexternal-mdns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blake%2Fexternal-mdns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blake%2Fexternal-mdns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blake%2Fexternal-mdns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blake","download_url":"https://codeload.github.com/blake/external-mdns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509221,"owners_count":20950232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kubernetes-service","mdns"],"created_at":"2024-10-03T11:59:27.534Z","updated_at":"2025-04-06T16:11:21.724Z","avatar_url":"https://github.com/blake.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# External-mDNS\n\nExternal-mDNS advertises exposed Kubernetes Services and Ingresses addresses on a\nLAN using multicast DNS ([RFC 6762]).\n\nIt is based on \u003chttps://github.com/flix-tech/k8s-mdns/\u003e and heavily inspired by\n[External DNS].\n\n## What It Does\n\nExternal-mDNS makes Kubernetes resources discoverable on a local network via\nmulticast DNS without the need for a separate DNS server. It retrieves a list of\nresources (Services and Ingresses) from Kubernetes and serves the record to local\nclients via multicast DNS.\n\nHostnames associated with Ingress resources, or exposed services of type\nLoadBalancer, will be advertised on the local network.\n\nBy default External-mDNS will advertise hostnames for exposed resources in all\nnamespaces. Use the `-namespace` flag to restrict advertisement to a single\nnamespace, or `-without-namespace=true` for all namespaces.\n\nDNS records are advertised with the format `\u003chostname/service_name\u003e.\u003cnamespace\u003e.local`.\nIn addition, hostnames for resources in the `-default-namespace` will also be\nadvertised with a short name of `\u003chostname/service_name\u003e.local`.\n\n### Additional control for Services\n\nService discovery is automatic, however, there are some scenarios where one may wish\nto directly control names used with a more general service i.e. the service might\nbe in front of an Ingress Controller but the service you wish to use is not defined\nwith an Ingress resource such as in the case of non http/https service with nginx.\n\nOther scenarios include non Ingress types that publish a variety of services and\nact as an ingress but have configurations far more complex than can be expressed\nby an Ingress resource e.g. Istio.\n\nAdditionally, one may wish to control in finer detail which services appear directly\non .local MDNS advertisements without either moving services to the default namespace\nor enabling the global without-namespace flag.\n\nIn this case Service annotations are possible as follows - these annotations have\nno effect if applied to an Ingress resource.\n\n```yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: myservice\n  namespace: foospace\n  annotations:\n    external-mdns.blakecovarrubias.com/hostnames: foo\n    external-mdns.blakecovarrubias.com/without-namespace: \"true\"\n...\nspec:\n  type: LoadBalancer\n...\n```\n\nThis example publishes the service using the name foo which will result in the names\nfoo.foospace.local, foo-foospace.local and, because we have specified the additional\nannotation foo.local is also published (unnecessary if using the global option).\n\nWe urge you to test with the default behaviours for Services and Ingress before\nusing these annotations as the automatic nature of external-mdns is good enough\nfor most use cases.\n\n## Deploying External-mDNS\n\nExternal-mDNS is configured using argument flags. Most flags can be replaced\nwith environment variables. For instance, `--record-ttl` could be replaced with\n`EXTERNAL_MDNS_RECORD_TTL=60`, or `--namespace kube-system` could be replaced\nwith `EXTERNAL_MDNS_NAMESPACE=kube-system`.\n\nDeployment manifests are located in the [manifests/](manifests/) directory.\n\nTo deploy External-mDNS into a cluster without RBAC, use the following command.\n\n```shell\nkubectl apply --kustomize manifests/\n```\n\nTo deploy External-mDNS into a cluster with RBAC, use manifests overlay.\n\n```shell\nkubectl apply --kustomize manifests/rbac\n```\n\nVerify the External-mDNS resources have correctly been deployed using\n`kubectl get`.\n\n### Without RBAC\n\n```shell\nkubectl get --kustomize manifests\n```\n\n### With RBAC\n\n```shell\nkubectl get --kustomize manifests/rbac\n```\n\n## Verifying operation\n\nCheck that External-mDNS has created the desired DNS records for your advertised\nservices and that they resolve to the correct load balancer or ingress IP by\nusing the appropriate command for your operating system.\n\n### BSD/macOS\n\n```console\n$ dns-sd -Q example.local a in\nDATE: ---Sun 16 Aug 2020---\n22:50:37.797  ...STARTING...\nTimestamp     A/R    Flags if Name                          Type  Class   Rdata\n22:50:37.959  Add        2  4 example.local.                Addr   IN     192.0.2.10\n```\n\n### Linux\n\nResolve the hostname using the `getent` command.\n\n```console\n$ getent hosts example.local\n192.0.2.10      example.local\n```\n\nAlternatively, you may also attempt to resolve the hostname using Avahi.\n\n```console\n$ avahi-resolve-address -4 --name example.local\nexample.local 192.0.2.10\n```\n\nNote about Linux DNS lookups:\n\nIf `/etc/nsswitch.conf` is configured to use the `mdns4_minimal` module,\n`libnss-mdns` will reject the request if the request has more than two labels.\nExample: `example.default.local` is rejected.\n\nIn order to resolve hostnames that are published from non-default Kubernetes\nnamespaces, modify `/etc/nsswitch.conf` and replace `mdns4_minimal` with `mdns4`.\nAlso, create or modify `/etc/mdns.allow` and add the following contents.\n\n```text\n# /etc/mdns.allow\n.local.\n.local\n```\n\nHostnames with more than two labels should now be resolvable.\n\n```console\n$ getent hosts example.default.local\n192.0.2.10      example.default.local\n```\n\n[External DNS]: https://github.com/kubernetes-sigs/external-dns\n[RFC 6762]: https://tools.ietf.org/html/rfc6762\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblake%2Fexternal-mdns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblake%2Fexternal-mdns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblake%2Fexternal-mdns/lists"}