ยท Steve Grice ยท self hosting  ยท 1 min read

How to: Kubernetes Storage with Longhorn

Letโ€™s wrangle us some Longhorn and install it on our cluster.

Installing Longhorn

Source: https://docs.k3s.io/storage

K3s comes with PVC support out of the box, but we want Longhorn because itโ€™s better. Itโ€™s easy to instlal - just run this:

kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.5.1/deploy/longhorn.yaml

Then make sure all of the Longhorn pods come up without issue. Make sure they all show โ€œRunningโ€ as their status.

kubectl get pod -n longhorn-system

Accessing the Longhorn UI

Check the video for exact details on this. To access the Longhorn UI, we have to expose a NodePort for it. Run this to edit the frontend service:

kubectl edit service -n longhorn-system longhorn-frontend

Change the line that says type: ClusterIP to type: NodePort. Then add a nodePort: 30080 under the only entry in the ports: list.

Finally, access the UI by going to your clusterโ€™s public IP on that port. For example, if you cluster is accessible on your network via the IP address 10.0.0.184, youโ€™d visit http://10.0.0.184:30080 in your browser to see the UI.

Back to Blog