Vigyata.AI
Is this your channel?

How to Set Up Longhorn in Kubernetes for Seamless Storage Volume Provisioning

2.0K views· 34 likes· 20:39· Mar 26, 2025

🛍️ Products Mentioned (1)

In this tutorial, we'll walk you through the process of setting up Longhorn in Kubernetes to easily provision and manage persistent storage volumes. Longhorn is a powerful, cloud-native distributed block storage solution designed specifically for Kubernetes environments. By the end of this video, you'll have a fully functioning Longhorn setup for your Kubernetes cluster, allowing you to efficiently handle storage needs for your applications. Whether you're new to Kubernetes or looking to enhance your storage capabilities, this guide will help you get up and running quickly. NOTE for replica counts you'll want to update both these values defaultReplicaCount defaultClassReplicaCount Install Instructions: https://github.com/sassdrew/homelab/tree/main/40-Kubernetes-Longhorn Interested in other Homelab videos? Check out this playlist: https://www.youtube.com/playlist?list=PLhkW8M2MBf-H33LeTrVMc0LwN3EuOqGQV Wanting to automate your builds with Gitlab and Ansible? Check out this playlist: https://www.youtube.com/playlist?list=PLhkW8M2MBf-Gjb5qI-f1vPbXN530Hd1-3 For Business Inquiries you can email me at: sassdrew501@gmail.com

About This Video

In this video I’m continuing my Kubernetes homelab journey, and we’re finally fixing one of the most annoying parts: storage. When you’re running a barebones cluster (like mine) you end up manually provisioning volumes, fighting mount paths, permissions, and user IDs—especially when you’re deploying apps like Uptime Kuma. So I’m switching to Longhorn, which auto-provisions persistent volumes whenever you create a PVC, and gives you a clean UI so you’re not constantly correlating PVs and PVCs in kubectl. I walk through the setup end-to-end: installing the iSCSI initiator utilities on every node, deploying Longhorn with Helm into a dedicated namespace, and then exposing the Longhorn frontend through MetalLB by patching the service to a LoadBalancer with a specific IP. I also show the important homelab-specific bits: updating both replica settings (defaultReplicaCount and defaultClassReplicaCount) so you don’t accidentally request more replicas than your node count can support, and adding dedicated disks per node (I used LVM-backed mounts) instead of letting Longhorn fill up your root filesystem. To prove it works, I redeploy Uptime Kuma and let Longhorn dynamically create the PVC/PV—plus I cover a webhook/backup target hiccup I hit and how I worked around it.

Frequently Asked Questions

🎬 More from sass drew