FYI for k0s: Installing a CSI driver for NFS using Helm

metadata

Published

14Apr25

📖 1 min

content

On a recent dive into k0s, I stumbled across an issue where the csi-driver-nfs was not working straight out of the box and the k0s docs don't directly demonstrate this particular driver.

The error I was getting was:

k0s MountVolume.SetUp failed for volume "pods-mount-dir" : hostPath type check failed: /var/lib/kubelet/pods is not a directory

Thanks to the microk8s docs I was able to figure out that just like microk8s, k0s has a non standard kublet path - /var/lib/k0s/kubelet.

The solution was simply to tell the csi-driver-nfs helm chart to use the non standard path by adding the following to the values.yaml file:

# values.yaml

kubeletDir: /var/lib/k0s/kubelet

or alternatively, you can pass it in as a flag to the helm install command:

helm install csi-driver-nfs csi-driver-nfs/csi-driver-nfs --namespace kube-system --set kubeletDir=/var/lib/k0s/kubelet