forked from kubernetes-sigs/kernel-module-management
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding documentation for pre-building driver-containers. (kubernetes-…
…sigs#85) KMMO is mounting /lib/modules/$(KVER) from the node to the driver-container in order to use potential in-tree dependencies, therefore, some adjustment are needed for the driver-container so KMMO don't override the *.ko files of the user. MGMT-10194 Signed-off-by: Yoni Bettan <yonibettan@gmail.com>
- Loading branch information
Showing
9 changed files
with
204 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# How to build driver-containers to be used by KMMO | ||
|
||
### Pre-build driver-containers | ||
|
||
When a `Module` CR is applied to the cluster, KMMO will create a DaemonSet to run the driver-container specified in it. | ||
|
||
In order for driver-containers that depend on in-tree kernel-modules to work, KMMO is mounting `/lib/modules/${KVER}` from the node to the container, which means that it will override all files located in `/lib/modules/${KVER}` inside the driver-container. | ||
|
||
Therefore, when building a driver-container that is going to be used by KMMO, there are few things that needs to be done in the driver-container: | ||
* Put the `*.ko` files in `/opt/lib/modules/${KVER}` instead of `/lib/modules/${KVER}` | ||
* Link `/lib/modules/${KVER}` inside `/opt/lib/modules/$(KVER)/system` in case the driver-container depend on in-tree kernel-modules | ||
* Run `depmod -b /opt` in order to generate the dependency file correctly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
|
||
|
||
<link rel="shortcut icon" href="../img/favicon.ico"> | ||
<title>How to build driver-containers to be used by KMMO - Out-Of-Tree operator</title> | ||
<link href="../css/bootstrap.min.css" rel="stylesheet"> | ||
<link href="../css/font-awesome.min.css" rel="stylesheet"> | ||
<link href="../css/base.css" rel="stylesheet"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/github.min.css"> | ||
|
||
<script src="../js/jquery-1.10.2.min.js" defer></script> | ||
<script src="../js/bootstrap.min.js" defer></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script> | ||
<script>hljs.initHighlightingOnLoad();</script> | ||
</head> | ||
|
||
<body> | ||
<div class="navbar fixed-top navbar-expand-lg navbar-dark bg-primary"> | ||
<div class="container"> | ||
<a class="navbar-brand" href="..">Out-Of-Tree operator</a> | ||
<!-- Expander button --> | ||
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar-collapse"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
|
||
<!-- Expanded navigation --> | ||
<div id="navbar-collapse" class="navbar-collapse collapse"> | ||
<!-- Main navigation --> | ||
<ul class="nav navbar-nav"> | ||
<li class="navitem"> | ||
<a href=".." class="nav-link">Home</a> | ||
</li> | ||
<li class="navitem active"> | ||
<a href="./" class="nav-link">How to build driver-containers to be used by KMMO</a> | ||
</li> | ||
<li class="dropdown"> | ||
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">Developer <b class="caret"></b></a> | ||
<ul class="dropdown-menu"> | ||
|
||
<li> | ||
<a href="../developer/" class="dropdown-item">Design notes</a> | ||
</li> | ||
|
||
<li> | ||
<a href="../developer/reconciliation_loops/" class="dropdown-item">Reconciliation loop</a> | ||
</li> | ||
|
||
<li> | ||
<a href="../developer/use_cases/" class="dropdown-item">Use cases</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
|
||
<ul class="nav navbar-nav ml-auto"> | ||
<li class="nav-item"> | ||
<a rel="prev" href=".." class="nav-link"> | ||
<i class="fa fa-arrow-left"></i> Previous | ||
</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a rel="next" href="../developer/" class="nav-link"> | ||
Next <i class="fa fa-arrow-right"></i> | ||
</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a href="https://github.com/qbarrand/oot-operator/edit/main/docs/driver_containers.md" class="nav-link"><i class="fa fa-github"></i> Edit on GitHub</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-3"><div class="navbar-light navbar-expand-md bs-sidebar hidden-print affix" role="complementary"> | ||
<div class="navbar-header"> | ||
<button type="button" class="navbar-toggler collapsed" data-toggle="collapse" data-target="#toc-collapse" title="Table of Contents"> | ||
<span class="fa fa-angle-down"></span> | ||
</button> | ||
</div> | ||
|
||
|
||
<div id="toc-collapse" class="navbar-collapse collapse card bg-secondary"> | ||
<ul class="nav flex-column"> | ||
|
||
<li class="nav-item" data-level="1"><a href="#how-to-build-driver-containers-to-be-used-by-kmmo" class="nav-link">How to build driver-containers to be used by KMMO</a> | ||
<ul class="nav flex-column"> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
</div></div> | ||
<div class="col-md-9" role="main"> | ||
|
||
<h1 id="how-to-build-driver-containers-to-be-used-by-kmmo">How to build driver-containers to be used by KMMO</h1> | ||
<h3 id="pre-build-driver-containers">Pre-build driver-containers</h3> | ||
<p>When a <code>Module</code> CR is applied to the cluster, KMMO will create a DaemonSet to run the driver-container specified in it.</p> | ||
<p>In order for driver-containers that depend on in-tree kernel-modules to work, KMMO is mounting <code>/lib/modules/${KVER}</code> from the node to the container, which means that it will override all files located in <code>/lib/modules/${KVER}</code> inside the driver-container.</p> | ||
<p>Therefore, when building a driver-container that is going to be used by KMMO, there are few things that needs to be done in the driver-container: | ||
* Put the <code>*.ko</code> files in <code>/opt/lib/modules/${KVER}</code> instead of <code>/lib/modules/${KVER}</code> | ||
* Link <code>/lib/modules/${KVER}</code> inside <code>/opt/lib/modules/$(KVER)/system</code> in case the driver-container depend on in-tree kernel-modules | ||
* Run <code>depmod -b /opt</code> in order to generate the dependency file correctly</p></div> | ||
</div> | ||
</div> | ||
|
||
<footer class="col-md-12"> | ||
<hr> | ||
<p>Documentation built with <a href="https://www.mkdocs.org/">MkDocs</a>.</p> | ||
</footer> | ||
<script> | ||
var base_url = "..", | ||
shortcuts = {"help": 191, "next": 78, "previous": 80, "search": 83}; | ||
</script> | ||
<script src="../js/base.js" defer></script> | ||
|
||
<div class="modal" id="mkdocs_keyboard_modal" tabindex="-1" role="dialog" aria-labelledby="keyboardModalLabel" aria-hidden="true"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4> | ||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | ||
</div> | ||
<div class="modal-body"> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th style="width: 20%;">Keys</th> | ||
<th>Action</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td class="help shortcut"><kbd>?</kbd></td> | ||
<td>Open this help</td> | ||
</tr> | ||
<tr> | ||
<td class="next shortcut"><kbd>n</kbd></td> | ||
<td>Next page</td> | ||
</tr> | ||
<tr> | ||
<td class="prev shortcut"><kbd>p</kbd></td> | ||
<td>Previous page</td> | ||
</tr> | ||
<tr> | ||
<td class="search shortcut"><kbd>s</kbd></td> | ||
<td>Search</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="modal-footer"> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.