|
| 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. |
0 commit comments