Loading Kernel Modules

Since RancherOS v0.8, we build our own kernels using an unmodified kernel.org LTS kernel.
We provide both loading kernel modules with parameters and loading extra kernel modules for you.

Loading Kernel Modules with parameters

Available as of v1.4

The rancher.modules can help you to set kernel modules or module parameters.

As an example, I’m going to set a parameter for kernel module ndb

sudo ros config set rancher.modules "['nbd nbds_max=1024', 'nfs']"

Or

#cloud-config
rancher:
modules: [nbd nbds_max=1024, nfs]

After rebooting, you can check that ndbs_max parameter has been updated.

# cat /sys/module/nbd/parameters/nbds_max
1024

Loading Extra Kernel Modules

We also build almost all optional extras as modules - so most in-tree modules are available
in the kernel-extras service.

If you do need to build kernel modules for RancherOS, there are 4 options:

Try the kernel-extras service

Ask us to add it into the next release

If its out of tree, copy the methods used for the zfs and open-iscsi services

Build it yourself.

Try the kernel-extras service

We build the RancherOS kernel with most of the optional drivers as kernel modules, packaged
into an optional RancherOS service.

To install these, run:

sudo ros service enable kernel-extras
sudo ros service up kernel-extras

The modules should now be available for you to modprobe

Ask us to do it

Open a GitHub issue in the https://github.com/rancher/os repository - we’ll probably add
it to the kernel-extras next time we build a kernel. Tell us if you need the module at initial
configuration or boot, and we can add it to the default kernel modules.