Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 36 additions & 60 deletions modules/nodes-scheduler-taints-tolerations-about.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,23 @@ You apply taints to a node through the `Node` specification (`NodeSpec`) and app
[source,yaml]
----
spec:
....
template:
....
spec:
taints:
- effect: NoExecute
key: key1
value: value1
taints:
- effect: NoExecute
key: key1
value: value1
....
----

.Example toleration in a `Pod` spec
[source,yaml]
----
spec:
....
template:
....
spec:
tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoExecute"
tolerationSeconds: 3600
tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoExecute"
tolerationSeconds: 3600
....
----

Expand Down Expand Up @@ -148,16 +140,12 @@ You can specify how long a pod can remain bound to a node before being evicted b
[source,yaml]
----
spec:
....
template:
....
spec:
tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoExecute"
tolerationSeconds: 3600
tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoExecute"
tolerationSeconds: 3600
----

Here, if this pod is running but does not have a matching toleration, the pod stays bound to the node for 3,600 seconds and then be evicted. If the taint is removed before that time, the pod is not evicted.
Expand Down Expand Up @@ -204,19 +192,15 @@ $ oc adm taint nodes node1 key2=value2:NoSchedule
[source,yaml]
----
spec:
....
template:
....
spec:
tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoSchedule"
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoExecute"
tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoSchedule"
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoExecute"
----

In this case, the pod cannot be scheduled onto the node, because there is no toleration matching the third taint. The pod continues running if it is already running on the node when the taint is added, because the third taint is the only
Expand Down Expand Up @@ -269,19 +253,15 @@ For more information, see link:https://kubernetes.io/docs/concepts/architecture/
[source,yaml]
----
spec:
....
template:
....
spec:
tolerations:
- key: node.kubernetes.io/not-ready
operator: Exists
effect: NoExecute
tolerationSeconds: 300 <1>
- key: node.kubernetes.io/unreachable
operator: Exists
effect: NoExecute
tolerationSeconds: 300
tolerations:
- key: node.kubernetes.io/not-ready
operator: Exists
effect: NoExecute
tolerationSeconds: 300 <1>
- key: node.kubernetes.io/unreachable
operator: Exists
effect: NoExecute
tolerationSeconds: 300
----

<1> These tolerations ensure that the default pod behavior is to remain bound for five minutes after one of these node conditions problems is detected.
Expand All @@ -305,10 +285,6 @@ Pods with this toleration are not removed from a node that has taints.
[source,yaml]
----
spec:
....
template:
....
spec:
tolerations:
- operator: "Exists"
tolerations:
- operator: "Exists"
----
16 changes: 6 additions & 10 deletions modules/nodes-scheduler-taints-tolerations-adding-machineset.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ You can add taints to nodes using a machine set. All nodes associated with the `
[source,yaml]
----
spec:
....
template:
....
spec:
tolerations:
- key: "key1" <1>
value: "value1"
operator: "Equal"
effect: "NoExecute"
tolerationSeconds: 3600 <2>
tolerations:
- key: "key1" <1>
value: "value1"
operator: "Equal"
effect: "NoExecute"
tolerationSeconds: 3600 <2>
----
<1> The toleration parameters, as described in the *Taint and toleration components* table.
<2> The `tolerationSeconds` parameter specifies how long a pod is bound to a node before being evicted.
Expand Down
32 changes: 12 additions & 20 deletions modules/nodes-scheduler-taints-tolerations-adding.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ You add tolerations to pods and taints to nodes to allow the node to control whi
[source,yaml]
----
spec:
....
template:
....
spec:
tolerations:
- key: "key1" <1>
value: "value1"
operator: "Equal"
effect: "NoExecute"
tolerationSeconds: 3600 <2>
tolerations:
- key: "key1" <1>
value: "value1"
operator: "Equal"
effect: "NoExecute"
tolerationSeconds: 3600 <2>
----
<1> The toleration parameters, as described in the *Taint and toleration components* table.
<2> The `tolerationSeconds` parameter specifies how long a pod can remain bound to a node before being evicted.
Expand All @@ -36,16 +32,12 @@ For example:
.Sample pod configuration file with an Exists operator
[source,yaml]
----
spec:
....
template:
....
spec:
tolerations:
- key: "key1"
operator: "Exists" <1>
effect: "NoExecute"
tolerationSeconds: 3600
spec:
tolerations:
- key: "key1"
operator: "Exists" <1>
effect: "NoExecute"
tolerationSeconds: 3600
----
<1> The `Exists` operator does not take a `value`.
+
Expand Down