I am running a Pod on my Kubernetes cluster with root privilege, hostNetwork: true and a few resources like shm, hughpages. And I am using a image that has a Fedora 33 base OS image and on top of it I have installed a few additional dependencies. And I wish to use nvme module for nvme discover and nvme connect commands inside my container.
So after my pod is scheduled, I tried loading nvme module (modprobe nvme) but it is giving my error that ‘modprobe: command not found’. So I installed kmod (sudo dnf install kmod).
So now that I tried ‘modprobe nvme’, it is giving me this error
modprobe: FATAL: Module nvme not found in directory /lib/modules/4.18.0-147.el8.x86_64
Can someone please help me out, I am unable to diagnose why it is giving me this error.
With Docker alone, I needed all these extra flags on to have access to a USB device and use some modules inside the container in this project I did. Might be helpful in checking if you figured out the 1:1 equivalents for Kubernetes to make those containers.
Previously I was using ’ --net=host --privileged’ only and I tried using ’ --ipc host --cap-add SYS_ADMIN’ this along with all the previous and still I am getting same error.
Actually I was using a few libraries which require python 3.6 and fedora:33 have python 3.9 preinstalled. So in my image I had to install python 3.6 and replace /bin/python3 with /bin/python3.6 in order for the libraries to work.
I tried figuring out where actually was the origin for the problem and maybe it is with the installation that I am carrying out for python3.6, as after that I am not able to use dnf (it seems to be broken).
So I installed nvme-cli in my image before I deal with the python versions and it is working that way. I am able to use nvme module in the container.