Skip to content

Commit 0fe824c

Browse files
Add docs for imageRebuildTriggerGeneration field
Document the new imageRebuildTriggerGeneration field that allows users to force KMM to re-verify and rebuild module images when using ephemeral image registries. Ref: #1206
1 parent d00f2d7 commit 0fe824c

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

docs/mkdocs/documentation/deploy_kmod.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,39 @@ spec:
115115
The worker Pod will first try to unload the in-tree `mod_b` before loading `mod_a` from the kmod image.
116116
When the worker Pod is terminated and `mod_a` is unloaded, `mod_b` will not be loaded again.
117117

118+
### Forcing module image rebuilds
119+
120+
When KMM builds a kmod image in-cluster, it first checks if the target image already exists in the registry.
121+
If it does, the build is skipped.
122+
However, in some situations the images may no longer exist in the registry even though KMM believes they do.
123+
This can happen when using an image registry with ephemeral storage: registry contents are lost on restart, node drain,
124+
or rollout, but KMM still believes the images exist and attempts to use them, causing failures on the nodes.
125+
126+
To force KMM to re-verify image existence and rebuild images if necessary, set or change the
127+
`.spec.imageRebuildTriggerGeneration` field in the `Module` resource:
128+
129+
```yaml
130+
apiVersion: kmm.sigs.x-k8s.io/v1beta1
131+
kind: Module
132+
metadata:
133+
name: my-kmod
134+
spec:
135+
imageRebuildTriggerGeneration: 1 # Change this value, or set it if it is not set, to trigger a rebuild
136+
moduleLoader:
137+
# ...
138+
```
139+
140+
When KMM detects that the value of `.spec.imageRebuildTriggerGeneration` differs from the value stored in
141+
`.status.imageRebuildTriggerGeneration`, it will:
142+
143+
1. re-verify image existence for all kernel mappings;
144+
2. trigger builds for images that need to be rebuilt.
145+
146+
After the rebuild process completes, KMM updates `.status.imageRebuildTriggerGeneration` to match the spec value.
147+
148+
!!! note
149+
This field is optional. If not set, KMM behaves as before and only builds images that do not exist in the registry.
150+
118151
### Supporting Modules without OOT kmods
119152
In some cases, there is a need to configure the KMM Module to avoid loading an out-of-tree kernel module and
120153
instead use the in-tree one, running only the device plugin.
@@ -239,6 +272,10 @@ spec:
239272
imageRepoSecret: # Optional. Used to pull kmod and device plugin images
240273
name: secret-name
241274

275+
# Optional. Change this value to force KMM to re-verify and potentially rebuild all module images.
276+
# See "Forcing module image rebuilds" section for details.
277+
imageRebuildTriggerGeneration: 1
278+
242279
selector:
243280
node-role.kubernetes.io/worker: ""
244281
```

docs/mkdocs/documentation/hub_spoke.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ metadata:
7474
spec:
7575
moduleSpec:
7676
# Contains moduleLoader and devicePlugin sections, just like in a Module resource.
77+
# Optional. Change this value to force image re-verification and rebuilds.
78+
imageRebuildTriggerGeneration: 1
7779
selector:
7880
node-wants-my-mcm: 'true' # Selects nodes within the ManagedCluster.
7981

0 commit comments

Comments
 (0)