From c311b81b024d9189c9813eb222620dd0eea66a68 Mon Sep 17 00:00:00 2001 From: Shauna Diaz Date: Wed, 21 Sep 2022 13:30:36 -0400 Subject: [PATCH] BZ2103610 fixing taints, 9 BZs total --- ...es-scheduler-taints-tolerations-about.adoc | 96 +++++++------------ ...-taints-tolerations-adding-machineset.adoc | 16 ++-- ...s-scheduler-taints-tolerations-adding.adoc | 32 +++---- 3 files changed, 54 insertions(+), 90 deletions(-) diff --git a/modules/nodes-scheduler-taints-tolerations-about.adoc b/modules/nodes-scheduler-taints-tolerations-about.adoc index a940d5a67bcf..b5d290f130e2 100644 --- a/modules/nodes-scheduler-taints-tolerations-about.adoc +++ b/modules/nodes-scheduler-taints-tolerations-about.adoc @@ -16,14 +16,10 @@ 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 .... ---- @@ -31,16 +27,12 @@ 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 .... ---- @@ -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. @@ -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 @@ -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. @@ -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" ---- diff --git a/modules/nodes-scheduler-taints-tolerations-adding-machineset.adoc b/modules/nodes-scheduler-taints-tolerations-adding-machineset.adoc index 1972d932ced5..9a6de10b3f17 100644 --- a/modules/nodes-scheduler-taints-tolerations-adding-machineset.adoc +++ b/modules/nodes-scheduler-taints-tolerations-adding-machineset.adoc @@ -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. diff --git a/modules/nodes-scheduler-taints-tolerations-adding.adoc b/modules/nodes-scheduler-taints-tolerations-adding.adoc index 58f0c2075765..43f3c24f3f40 100644 --- a/modules/nodes-scheduler-taints-tolerations-adding.adoc +++ b/modules/nodes-scheduler-taints-tolerations-adding.adoc @@ -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. @@ -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`. +