• open-iscsi or iscsiadm installed on the node.

Longhorn v0.7.0 and above support k3s v0.10.0 and above only by default.

If you want to deploy these new Longhorn versions on versions before k3s v0.10.0, you need to set --kubelet-root-dir to <data-dir>/agent/kubelet for the Deployment longhorn-driver-deployer in longhorn/deploy/longhorn.yaml. data-dir is a arg and it can be set when you launch a k3s server. By default it is /var/lib/rancher/k3s.

This error is due to Longhorn cannot detect where is the root dir setup for Kubelet, so the CSI plugin installation failed.

How to find root-dir?

For K3S prior to v0.10.0

Run ps aux | grep k3s and get argument --data-dir or -d on k3s node.

e.g.

If K3S is using a configuration file, you would need to check the configuration file to locate the data-dir parameter.

For K3S v0.10.0+

It is always

Longhorn versions before v0.7.0 don’t work on K3S v0.10.0 or above