metal-stack / csi-driver-lvm

MIT License
121 stars 26 forks source link

csi-driver-lvm-plugin fails to mount /lib/modules directory #40

Closed electrical closed 3 years ago

electrical commented 3 years ago

After deployment, the pods for csi-driver-lvm-plugin are unable to mount /lib/modules directory. I found it was a symlink, which should work i expect, so changed it to the full actual path to test but still hitting the same error

MountVolume.SetUp failed for volume "mod-dir" : hostPath type check failed: /usr/lib/modules is not a directory

The directory does exist on the host systems.

Versions of things: OS: Ubuntu 20.04.1 LTS Kubernetes: v1.19.7 ( deployed via Rancher )

Deployed using helm chart version

mwennrich commented 3 years ago

This is strange, since every path to modules in the code points to /lib/modules, not /usr/lib/modules:

https://github.com/metal-stack/csi-driver-lvm/blob/011447b803079a24dbbf43069021a85f1128852c/helm/csi-driver-lvm/templates/csi-lvm-plugin-deployment.yaml#L117-L118

https://github.com/metal-stack/csi-driver-lvm/blob/011447b803079a24dbbf43069021a85f1128852c/helm/csi-driver-lvm/templates/csi-lvm-plugin-deployment.yaml#L166-L168

https://github.com/metal-stack/csi-driver-lvm/blob/ea4e2f31b6b793b999166ee7d46bccb3d0cd0148/pkg/lvm/lvm.go#L280-L282

https://github.com/metal-stack/csi-driver-lvm/blob/ea4e2f31b6b793b999166ee7d46bccb3d0cd0148/pkg/lvm/lvm.go#L333-L336

electrical commented 3 years ago

The helm files indeed point to that originally. As i mentioned I changed it in the helm deployment to /usr/lib/modules to test it out if that would fix the issue since /lib/modules is symlinked but that didn't work. Sorry for the confusion.

electrical commented 3 years ago

After a few hours of googling i found more projects that have the issues with the /lib/modules directory ( https://github.com/cilium/cilium/pull/7794 for example ) Removing the type: Directory seems to solve it for me.

Gerrit91 commented 3 years ago

Hey. Would you like to create a PR for this? We are willing to merge it. :)

electrical commented 3 years ago

More than happy to :-) Will send a PR shortly