Nvme module not showing in docker container

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.

Cluster information:

Kubernetes version: v1.21.1
Host OS: RHEL 8.1

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.

docker run -it --rm --name=jetpack-sdk --rm=true --net=host --ipc host --privileged --cap-add SYS_ADMIN --volume="/dev/bus/usb:/dev/bus/usb" jetpack-sdk

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.

But still, Thank you @protosam

The most privileged thing I’ve ever used is probably a pod created by a plugin called node-shell that I installed with krew.

I would be curious if your tools work from the container it deploys. If it does, this seems like it would be a good starting point for comparison.

I looked at the code and it’s just a shell script. Here’s the relevant code should give you some clues to the container spec they use.

Edit: Also, just in case you might not have checked it out, this is the documentation for security policies, which might be relevant.

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.

@protosam Thankyou for helping me out