I have multiple disks loaded into my different nodes and they are all not the same, Hence I needed a reliable disk volume manager for my k3s kubernetes cluster. After few options like using NFS I decided to give longhorn a try. Installing longhorn was pretty simple.
Add in the longhorn helm repo.
❯ helm repo add longhorn https://charts.longhorn.io
"longhorn" has been added to your repositories
Gave it a quick update
❯ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "longhorn" chart repository
...Successfully got an update from the "qjoly" chart repository
...Successfully got an update from the "wekan" chart repository
...Successfully got an update from the "yugabytedb" chart repository
...Successfully got an update from the "traefik" chart repository
...Successfully got an update from the "k8s-at-home" chart repository
...Successfully got an update from the "truecharts" chart repository
Helm install command.
❯ helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace --version 1.4.2
NAME: longhorn
LAST DEPLOYED: Sun May 21 17:56:10 2023
NAMESPACE: longhorn-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Longhorn is now installed on the cluster!
Please wait a few minutes for other Longhorn components such as CSI deployments, Engine Images, and Instance Managers to be initialized.
Visit our documentation at https://longhorn.io/docs/
Give it a minute or two and check if pods have been created.
One immediate problem, I noticed was that longhorn-frontend was installed in ClusterIP mode, which meant it could not be accessed from ourside world. I needed it to be accessed from other devices in my VPN, So I downloaded the helm values into my computer to be able to change it.
❯ helm show values longhorn/longhorn >> values.yaml
Checking on the values file , I changed the type of UI to NodePort.
❯ helm upgrade -n longhorn-system longhorn longhorn/longhorn -f values.yaml
Release "longhorn" has been upgraded. Happy Helming!
NAME: longhorn
LAST DEPLOYED: Sun May 21 18:18:11 2023
NAMESPACE: longhorn-system
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
Longhorn is now installed on the cluster!
Please wait a few minutes for other Longhorn components such as CSI deployments, Engine Images, and Instance Managers to be initialized.
Visit our documentation at https://longhorn.io/docs/
I still have a problem though. My added external volumes are not shown yet . Which seemed to be pretty easy to just edit the node and add the mounted path manually.
Adding in mounted files
If you have any questions or would want to solve any issues with helm, k3s or longhorn , Feel free to reach out to me .