A quick and dirty hack to turn Ingress hostnames into mDNS CNAME entries
$ git clone https://github.com/hardillb/k8s-ingress-to-avahi.git
$ cd k8s-ingress-to-avahi
$ npm install
This runs on the Ingress Host machine outside of Kubernetes (might be able to get it to work in a container, but will need the DBUS socket mounting into the container)
The script take 3 arguments
- The path to the kubctl config file
- The mDNS hostname of the Ingress machine
- Optional namespace to watch (uses default if not present)
e.g.
$ node index.js /home/ubuntu/.kube/config ubuntu.local
or
$ node index.js /home/ubuntu/.kube/config ubuntu.local foo
The Ingress YAML should look something like this:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: manager-ingress
spec:
rules:
- host: "manager.ubuntu.local"
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: manager
port:
number: 3000
Might add this later, but it would require custom Certificate Authority to
issue certs for .local
domain.