Longhorn and Tailscale
TLDR;#
How to expose the Longhorn UI through Tailscale.
Context#
Longhorn is a cloud native distributed block storage system for Kubernetes. To access their web UI, we have to create an Ingress to allow external traffic to reach the Longhorn UI. The documentation uses the Nginx Ingress Controller, but as I’m using Tailscale instead, I wanted to see if it’s possible to expose the Longhorn UI to my tailnet. It turns out it is possible, and here is how to do it.
Documentation#
First, you have to setup the Tailscale Kubernetes operator.
Follow the Longhorn documentation to create an Ingress, and change the ingressClassName
from nginx to tailscale, as explained in Exposing cluster workloads using a Kubernetes Ingress:
- ingressClassName: nginx
+ ingressClassName: tailscale
Create the Ingress with:
kubectl -n longhorn-system apply -f longhorn-ingress.yml
Wait a few moment for the Ingress to be created, and then run:
kubectl get ingress -n longhorn-system
NAME CLASS HOSTS ADDRESS PORTS AGE
longhorn-ingress tailscale * longhorn-system-longhorn-ingress-ingress.tailxxxxxx.ts.net 80 2d5h
You can now access the Longhorn UI at the address shown above (to be replaced, this is a template response) 🎉