Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

tsaarni/k8s-external-mdns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Expose Kubernetes services with mDNS

This tutorial shows how to use MetalLB and ExternalDNS to expose services (and ingresses) with .local hostname in LAN using mDNS.

Note: This approach is only suitable for test clusters in local area network.

Following projects are used

Installation

Install MetalLB to assign public IP for services. The IP range should be changed to the IP address range of your network:

kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.7.3/manifests/metallb.yaml

kubectl apply -f - <<EOF
apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: default
      protocol: layer2
      addresses:
      - 192.168.1.100-192.168.1.250
EOF

Install Avahi mDNS daemon on the master node

apt-get install -y avahi-daemon

Install fork of ExternalDNS

kubectl apply -f https://raw.githubusercontent.com/tsaarni/k8s-external-mdns/master/external-dns-with-avahi-mdns.yaml

ExternalDNS listens for externally published services and writes hosts name to /etc/avahi/hosts for Avahi to pick up and serve using mDNS.

About

Expose Kubernetes services with mDNS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published