Skip to content

Commit 1b04b82

Browse files
TELCODOCS-2197: Add support for user defined tolerances to modules.
1 parent 7e70160 commit 1b04b82

File tree

3 files changed

+90
-0
lines changed

3 files changed

+90
-0
lines changed

hardware_enablement/kmm-kernel-module-management.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ include::modules/kmm-building-and-signing-a-kmod-image.adoc[leveloffset=+1]
104104
.Additional resources
105105
* link:https://docs.openshift.com/container-platform/4.12/authentication/understanding-and-creating-service-accounts.html#service-accounts-managing_understanding-service-accounts[Creating service accounts]
106106
107+
// Added for TELCODOCS-2197
108+
include::modules/kmm-using-tolerations-for-kernel-module-scheduling.adoc[leveloffset=+1]
109+
include::modules/kmm-applying-tolerations-to-kernel-module-pods.adoc[leveloffset=+1]
110+
[role="_additional-resources"]
111+
.Additional resources
112+
* link:https://docs.openshift.com/container-platform/4.17/nodes/scheduling/nodes-scheduler-taints-tolerations.html#nodes-scheduler-taints-tolerations-about_nodes-scheduler-taints-tolerations[Understanding taints and tolerations]
113+
107114
// Added for TELCODOCS-1109
108115
include::modules/kmm-hub-hub-and-spoke.adoc[leveloffset=+1]
109116
[role="_additional-resources"]
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hardware_enablement/kmm-kernel-module-management.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="kmm-applying-tolerations-to-kernel-module-pods_{context}"]
7+
= Applying tolerations to kernel module pods
8+
9+
Taints and tolerations consist of `effect`, `key`, and `value` parameters. Tolerations include additional `operator` and `tolerationSeconds` parameters.
10+
11+
`effect`:: Indicates the taint effect to match. If left empty, all taint effects are matched. When you set `effect`, valid values are: `NoSchedule`, `PreferNoSchedule`, or `NoExecute`.
12+
13+
`key`:: The taint key that the toleration applies to. If left empty, all taint keys are matched. If the `key` is empty, you must set the `operator` parameter to `Exists`. This combination matches all values and all keys.
14+
15+
`value`:: The taint value the toleration matches to. If the `operator` parameter is `Exists`, the value must be empty, otherwise use a regular string.
16+
17+
`operator`:: Represents a relationship of a key to the value. Valid `operator` parameters are `Exists` and `Equal`. The default value is `Equal`. `Exists` is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.
18+
19+
`tolerationSeconds`:: Represents the period of time the toleration (which must be of effect `NoExecute`, otherwise this field is ignored) tolerates the taint. By default, it is not set and the taint is tolerated forever without eviction. Zero and negative values are treated as `0` and immediately evicted by the system.
20+
21+
.Example taint in a node specification
22+
[source,yaml]
23+
----
24+
apiVersion: v1
25+
kind: Node
26+
metadata:
27+
name: <my_node>
28+
#...
29+
spec:
30+
taints:
31+
- effect: NoSchedule
32+
key: key1
33+
value: value1
34+
#...
35+
----
36+
37+
.Example toleration in a module specification
38+
[source,yaml]
39+
----
40+
apiVersion: kmm.sigs.x-k8s.io/v1beta1
41+
kind: Module
42+
metadata:
43+
name: <my_kmod>
44+
spec:
45+
...
46+
tolerations:
47+
effect: NoSchedule
48+
key: key1
49+
operator: Equal
50+
tolerationSeconds: 36000
51+
value: value1
52+
----
53+
54+
Toleration values must match the taint that is added to the nodes. A toleration matches a taint:
55+
56+
* If the `operator` parameter is set to `Equal`:
57+
58+
** the `key` parameters are the same;
59+
60+
** the `value` parameters are the same;
61+
62+
** the `effect` parameters are the same.
63+
64+
* If the `operator` parameter is set to `Exists`:
65+
66+
** the `key` parameters are the same;
67+
68+
** the `effect` parameters are the same.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hardware_enablement/kmm-kernel-module-management.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="kmm-using-tolerations-for-kernel-module-scheduling_{context}"]
7+
= Using tolerations for kernel module scheduling
8+
9+
There are circumstances where you need to evacuate workloads on a node before upgrading a kernel module, which you can do through taints. You can use a taint to schedule only pods that contain a matching toleration on the node.
10+
11+
However, you also need to set tolerations to allow Kernel Module Management (KMM) pods that run housekeeping operations, such as kernel module upgrades. The tolerations must match the taint that is added to the nodes.
12+
13+
You can create user-defined tolerations to kernel modules to schedule selected KMM pods on a cordoned node. For example, during a device driver upgrade you cordon a node, at the same time, you can run housekeeping pods that perform the driver upgrades.
14+
15+
The `ModuleSpec` field is used to carry the tolerations to the KMM pods that are used during pod creation.

0 commit comments

Comments
 (0)