Skip to content

Commit 51ffed7

Browse files
author
Marek Grabowski
committed
Add documentation for TaintNodesByCondition
1 parent a601ca7 commit 51ffed7

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

docs/concepts/architecture/nodes.md

+5
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ If the Status of the Ready condition is "Unknown" or "False" for longer than the
6767

6868
In versions of Kubernetes prior to 1.5, the node controller would [force delete](/docs/concepts/workloads/pods/pod/#force-deletion-of-pods) these unreachable pods from the apiserver. However, in 1.5 and higher, the node controller does not force delete pods until it is confirmed that they have stopped running in the cluster. One can see these pods which may be running on an unreachable node as being in the "Terminating" or "Unknown" states. In cases where Kubernetes cannot deduce from the underlying infrastructure if a node has permanently left a cluster, the cluster administrator may need to delete the node object by hand. Deleting the node object from Kubernetes causes all the Pod objects running on it to be deleted from the apiserver, freeing up their names.
6969

70+
In version 1.8 a possibility to automatically create [taints](/docs/concepts/configuration/taint-and-toleration) representing Conditions was added as an alpha feature. Enabling it makes scheduler ignore Conditions when considering a Node, instead it looks at the taints and Pod's tolerations. This allows users to decide whether they want to keep old behavior and don't schedule their Pods on Nodes with some Conditions, or rather corresponding taints, or if they want to add a toleration and allow it. Note that because of small delay (usually <1s) between time when Condition is observed and Taint is created it's possible that enabling this feature will slightly increase number of Pods that are successfully scheduled but rejected by the Kubelet.
71+
7072
### Capacity
7173

7274
Describes the resources available on the node: CPU, memory and the maximum
@@ -174,6 +176,9 @@ NodeController is responsible for adding taints corresponding to node problems l
174176
node unreachable or not ready. See [this documentation](/docs/concepts/configuration/taint-and-toleration)
175177
for details about `NoExecute` taints and the alpha feature.
176178

179+
Since Kubernetes 1.8 NodeController may be made responsible for creating taints represeting
180+
Node Conditions. This is an alpha feature as of 1.8.
181+
177182
### Self-Registration of Nodes
178183

179184
When the kubelet flag `--register-node` is true (the default), the kubelet will attempt to

docs/concepts/configuration/taint-and-toleration.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,18 @@ admission controller](https://git.k8s.io/kubernetes/plugin/pkg/admission/default
249249

250250
* `node.alpha.kubernetes.io/unreachable`
251251
* `node.alpha.kubernetes.io/notReady`
252+
253+
This ensures that DaemonSet pods are never evicted due to these problems,
254+
which matches the behavior when this feature is disabled.
255+
256+
## Taint Nodes by Condition
257+
258+
In Kuberentes 1.8 we added an alpha feature that makes NodeController create Taints matching Node Conditions and in the same time disables Condition check in scheduler. This assures that Conditions doesn't have influence on what's scheduled on the Node and that user
259+
can choose to ignore some of node's problems by adding appropriate tolerations to hers Pods.
260+
261+
To make sure that turning on this feature doesn't break Daemon sets from 1.8 DaemonSet controller will automatically add following `NoSchedule` tolerations to all deamons:
262+
252263
* `node.kubernetes.io/memoryPressure`
253264
* `node.kubernetes.io/diskPressure`
254265
* `node.kubernetes.io/outOfDisk` (*only for critical pods*)
255266

256-
This ensures that DaemonSet pods are never evicted due to these problems,
257-
which matches the behavior when this feature is disabled.

docs/concepts/workloads/controllers/daemonset.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,21 @@ but they are created with `NoExecute` tolerations for the following taints with
103103

104104
- `node.alpha.kubernetes.io/notReady`
105105
- `node.alpha.kubernetes.io/unreachable`
106-
- `node.alpha.kubernetes.io/memoryPressure`
107-
- `node.alpha.kubernetes.io/diskPressure`
108-
109-
When the support to critical pods is enabled and the pods in a DaemonSet are
110-
labelled as critical, the Daemon pods are created with an additional
111-
`NoExecute` toleration for the `node.alpha.kubernetes.io/outOfDisk` taint with
112-
no `tolerationSeconds`.
113106

114107
This ensures that when the `TaintBasedEvictions` alpha feature is enabled,
115108
they will not be evicted when there are node problems such as a network partition. (When the
116109
`TaintBasedEvictions` feature is not enabled, they are also not evicted in these scenarios, but
117110
due to hard-coded behavior of the NodeController rather than due to tolerations).
118111

112+
They also tolerate following `NoSchedule` taints:
113+
- `node.kubernetes.io/memoryPressure`
114+
- `node.kubernetes.io/diskPressure`
115+
116+
When the support to critical pods is enabled and the pods in a DaemonSet are
117+
labelled as critical, the Daemon pods are created with an additional
118+
`NoSchedule` toleration for the `node.kubernetes.io/outOfDisk` taint.
119+
120+
Note that all above `NoSchedule` taints above are created only in version 1.8 or leater if alpha feature `TaintNodesByCondition` is enabled.
119121

120122
## Communicating with Daemon Pods
121123

0 commit comments

Comments
 (0)