Β· 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.

Contents
Back to Blog