Skip to content

Commit 614eccb

Browse files
authored
Merge pull request #50662 from ShaunaDiaz/BZ2103610
BZ2103610 fixing taints, 9 BZs total
2 parents 575d262 + 8d58bca commit 614eccb

3 files changed

+54
-90
lines changed

modules/nodes-scheduler-taints-tolerations-about.adoc

Lines changed: 36 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,23 @@ You apply taints to a node through the `Node` specification (`NodeSpec`) and app
1616
[source,yaml]
1717
----
1818
spec:
19-
....
20-
template:
21-
....
22-
spec:
23-
taints:
24-
- effect: NoExecute
25-
key: key1
26-
value: value1
19+
taints:
20+
- effect: NoExecute
21+
key: key1
22+
value: value1
2723
....
2824
----
2925

3026
.Example toleration in a `Pod` spec
3127
[source,yaml]
3228
----
3329
spec:
34-
....
35-
template:
36-
....
37-
spec:
38-
tolerations:
39-
- key: "key1"
40-
operator: "Equal"
41-
value: "value1"
42-
effect: "NoExecute"
43-
tolerationSeconds: 3600
30+
tolerations:
31+
- key: "key1"
32+
operator: "Equal"
33+
value: "value1"
34+
effect: "NoExecute"
35+
tolerationSeconds: 3600
4436
....
4537
----
4638

@@ -148,16 +140,12 @@ You can specify how long a pod can remain bound to a node before being evicted b
148140
[source,yaml]
149141
----
150142
spec:
151-
....
152-
template:
153-
....
154-
spec:
155-
tolerations:
156-
- key: "key1"
157-
operator: "Equal"
158-
value: "value1"
159-
effect: "NoExecute"
160-
tolerationSeconds: 3600
143+
tolerations:
144+
- key: "key1"
145+
operator: "Equal"
146+
value: "value1"
147+
effect: "NoExecute"
148+
tolerationSeconds: 3600
161149
----
162150

163151
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.
@@ -204,19 +192,15 @@ $ oc adm taint nodes node1 key2=value2:NoSchedule
204192
[source,yaml]
205193
----
206194
spec:
207-
....
208-
template:
209-
....
210-
spec:
211-
tolerations:
212-
- key: "key1"
213-
operator: "Equal"
214-
value: "value1"
215-
effect: "NoSchedule"
216-
- key: "key1"
217-
operator: "Equal"
218-
value: "value1"
219-
effect: "NoExecute"
195+
tolerations:
196+
- key: "key1"
197+
operator: "Equal"
198+
value: "value1"
199+
effect: "NoSchedule"
200+
- key: "key1"
201+
operator: "Equal"
202+
value: "value1"
203+
effect: "NoExecute"
220204
----
221205

222206
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
@@ -269,19 +253,15 @@ For more information, see link:https://kubernetes.io/docs/concepts/architecture/
269253
[source,yaml]
270254
----
271255
spec:
272-
....
273-
template:
274-
....
275-
spec:
276-
tolerations:
277-
- key: node.kubernetes.io/not-ready
278-
operator: Exists
279-
effect: NoExecute
280-
tolerationSeconds: 300 <1>
281-
- key: node.kubernetes.io/unreachable
282-
operator: Exists
283-
effect: NoExecute
284-
tolerationSeconds: 300
256+
tolerations:
257+
- key: node.kubernetes.io/not-ready
258+
operator: Exists
259+
effect: NoExecute
260+
tolerationSeconds: 300 <1>
261+
- key: node.kubernetes.io/unreachable
262+
operator: Exists
263+
effect: NoExecute
264+
tolerationSeconds: 300
285265
----
286266

287267
<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.
@@ -305,10 +285,6 @@ Pods with this toleration are not removed from a node that has taints.
305285
[source,yaml]
306286
----
307287
spec:
308-
....
309-
template:
310-
....
311-
spec:
312-
tolerations:
313-
- operator: "Exists"
288+
tolerations:
289+
- operator: "Exists"
314290
----

modules/nodes-scheduler-taints-tolerations-adding-machineset.adoc

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@ You can add taints to nodes using a machine set. All nodes associated with the `
1717
[source,yaml]
1818
----
1919
spec:
20-
....
21-
template:
22-
....
23-
spec:
24-
tolerations:
25-
- key: "key1" <1>
26-
value: "value1"
27-
operator: "Equal"
28-
effect: "NoExecute"
29-
tolerationSeconds: 3600 <2>
20+
tolerations:
21+
- key: "key1" <1>
22+
value: "value1"
23+
operator: "Equal"
24+
effect: "NoExecute"
25+
tolerationSeconds: 3600 <2>
3026
----
3127
<1> The toleration parameters, as described in the *Taint and toleration components* table.
3228
<2> The `tolerationSeconds` parameter specifies how long a pod is bound to a node before being evicted.

modules/nodes-scheduler-taints-tolerations-adding.adoc

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@ You add tolerations to pods and taints to nodes to allow the node to control whi
1717
[source,yaml]
1818
----
1919
spec:
20-
....
21-
template:
22-
....
23-
spec:
24-
tolerations:
25-
- key: "key1" <1>
26-
value: "value1"
27-
operator: "Equal"
28-
effect: "NoExecute"
29-
tolerationSeconds: 3600 <2>
20+
tolerations:
21+
- key: "key1" <1>
22+
value: "value1"
23+
operator: "Equal"
24+
effect: "NoExecute"
25+
tolerationSeconds: 3600 <2>
3026
----
3127
<1> The toleration parameters, as described in the *Taint and toleration components* table.
3228
<2> The `tolerationSeconds` parameter specifies how long a pod can remain bound to a node before being evicted.
@@ -36,16 +32,12 @@ For example:
3632
.Sample pod configuration file with an Exists operator
3733
[source,yaml]
3834
----
39-
spec:
40-
....
41-
template:
42-
....
43-
spec:
44-
tolerations:
45-
- key: "key1"
46-
operator: "Exists" <1>
47-
effect: "NoExecute"
48-
tolerationSeconds: 3600
35+
spec:
36+
tolerations:
37+
- key: "key1"
38+
operator: "Exists" <1>
39+
effect: "NoExecute"
40+
tolerationSeconds: 3600
4941
----
5042
<1> The `Exists` operator does not take a `value`.
5143
+

0 commit comments

Comments
 (0)