Skip to content

Commit 1b83bb7

Browse files
TELCODOCS-1279: First draft
1 parent 35d5e36 commit 1b83bb7

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

hardware_enablement/kmm-kernel-module-management.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ include::modules/kmm-security.adoc[leveloffset=+2]
2424

2525
* xref:../authentication/understanding-and-managing-pod-security-admission.adoc#understanding-and-managing-pod-security-admission[Understanding and managing pod security admission].
2626
27+
// Added for TELCODOCS-1279
28+
include::modules/kmm-replacing-in-tree-modules-with-out-of-tree-modules.adoc[leveloffset=+1]
29+
30+
[role="_additional-resources"]
31+
.Additional resources
32+
33+
* link:https://fastbitlab.com/building-a-linux-kernel-module/[Building a linux kernel module]
34+
2735
include::modules/kmm-example-module-cr.adoc[leveloffset=+2]
2836
include::modules/kmm-creating-moduleloader-image.adoc[leveloffset=+1]
2937
include::modules/kmm-running-depmod.adoc[leveloffset=+2]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hardware_enablement/kmm-kernel-module-management.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="kmm-replacing-in-tree-modules-with-out-of-tree-modules_{context}"]
7+
= Replacing in-tree modules with out-of-tree modules
8+
9+
You can use Kernel Module Management (KMM) to build kernel modules that can be loaded or unloaded into the kernel on demand. These modules extend the functionality of the kernel without the need to reboot the system. Modules can be configured as built-in or dynamically loaded.
10+
11+
Dynamically loaded modules include in-tree modules and out-of-tree (OOT) modules. In-tree modules are internal to the Linux kernel tree, that is, they are already part of the kernel. Out-of-tree modules are external to the Linux kernel tree. They are generally written for development and testing purposes, such as testing the new version of a kernel module that is shipped in-tree, or to deal with incompatibilities.
12+
13+
Some modules loaded by KMM could replace in-tree modules already loaded on the node. To unload an in-tree module before loading your module, set the `.spec.moduleLoader.container.inTreeModuleToRemove` field. The following is an example for module replacement for all kernel mappings:
14+
15+
[source,yaml]
16+
----
17+
# ...
18+
spec:
19+
moduleLoader:
20+
container:
21+
modprobe:
22+
moduleName: mod_a
23+
24+
inTreeModuleToRemove: mod_b
25+
----
26+
27+
In this example, the `moduleLoader` pod uses `inTreeModuleToRemove` to unload the in-tree `mod_b` before loading `mod_a`
28+
from the `moduleLoader` image.
29+
When the `moduleLoader`pod is terminated and `mod_a` is unloaded, `mod_b` is not loaded again.
30+
31+
The following is an example for module replacement for specific kernel mappings:
32+
33+
[source,yaml]
34+
----
35+
# ...
36+
spec:
37+
moduleLoader:
38+
container:
39+
kernelMappings:
40+
- literal: 6.0.15-300.fc37.x86_64
41+
containerImage: some.registry/org/my-kmod:6.0.15-300.fc37.x86_64
42+
inTreeModuleToRemove: <module_name>
43+
----

0 commit comments

Comments
 (0)