@@ -142,13 +142,51 @@ An empty `effect` matches all effects with key `key1`.
142
142
143
143
<!--
144
144
The above example used `effect` of `NoSchedule`. Alternatively, you can use `effect` of `PreferNoSchedule`.
145
- This is a "preference" or "soft" version of `NoSchedule` -- the system will *try* to avoid placing a
146
- pod that does not tolerate the taint on the node, but it is not required. The third kind of `effect` is
147
- ` NoExecute` , described later.
148
145
-->
149
146
上述例子中 `effect` 使用的值为 `NoSchedule`,你也可以使用另外一个值 `PreferNoSchedule`。
150
- 这是“优化”或“软”版本的 `NoSchedule` —— 系统会 **尽量** 避免将 Pod 调度到存在其不能容忍污点的节点上,
151
- 但这不是强制的。`effect` 的值还可以设置为 `NoExecute`,下文会详细描述这个值。
147
+
148
+ <!--
149
+ The allowed values for the `effect` field are :
150
+ -->
151
+ ` effect` 字段的允许值包括:
152
+
153
+ <!--
154
+ ` NoExecute`
155
+ : This affects pods that are already running on the node as follows :
156
+ * Pods that do not tolerate the taint are evicted immediately
157
+ * Pods that tolerate the taint without specifying `tolerationSeconds` in
158
+ their toleration specification remain bound forever
159
+ * Pods that tolerate the taint with a specified `tolerationSeconds` remain
160
+ bound for the specified amount of time. After that time elapses, the node
161
+ lifecycle controller evicts the Pods from the node.
162
+ -->
163
+ ` NoExecute`
164
+ : 这会影响已在节点上运行的 Pod,具体影响如下:
165
+ * 如果 Pod 不能容忍这类污点,会马上被驱逐。
166
+ * 如果 Pod 能够容忍这类污点,但是在容忍度定义中没有指定 `tolerationSeconds`,
167
+ 则 Pod 还会一直在这个节点上运行。
168
+ * 如果 Pod 能够容忍这类污点,而且指定了 `tolerationSeconds`,
169
+ 则 Pod 还能在这个节点上继续运行这个指定的时间长度。
170
+ 这段时间过去后,节点生命周期控制器从节点驱除这些 Pod。
171
+
172
+ <!--
173
+ ` NoSchedule`
174
+ : No new Pods will be scheduled on the tainted node unless they have a matching
175
+ toleration. Pods currently running on the node are **not** evicted.
176
+ -->
177
+ ` NoSchedule`
178
+ : 除非具有匹配的容忍度规约,否则新的 Pod 不会被调度到带有污点的节点上。
179
+ 当前正在节点上运行的 Pod **不会**被驱逐。
180
+
181
+ <!--
182
+ ` PreferNoSchedule`
183
+ : `PreferNoSchedule` is a "preference" or "soft" version of `NoSchedule`.
184
+ The control plane will *try* to avoid placing a Pod that does not tolerate
185
+ the taint on the node, but it is not guaranteed.
186
+ -->
187
+ ` PreferNoSchedule`
188
+ : `PreferNoSchedule` 是“偏好”或“软性”的 `NoSchedule`。
189
+ 控制平面将**尝试**避免将不能容忍污点的 Pod 调度到的节点上,但不能保证完全避免。
152
190
153
191
<!--
154
192
You can put multiple taints on the same node and multiple tolerations on the same pod.
@@ -225,7 +263,7 @@ an optional `tolerationSeconds` field that dictates how long the pod will stay b
225
263
to the node after the taint is added. For example,
226
264
-->
227
265
通常情况下,如果给一个节点添加了一个 effect 值为 `NoExecute` 的污点,
228
- 则任何不能忍受这个污点的 Pod 都会马上被驱逐,任何可以忍受这个污点的 Pod 都不会被驱逐。
266
+ 则任何不能容忍这个污点的 Pod 都会马上被驱逐,任何可以容忍这个污点的 Pod 都不会被驱逐。
229
267
但是,如果 Pod 存在一个 effect 值为 `NoExecute` 的容忍度指定了可选属性
230
268
` tolerationSeconds` 的值,则表示在给节点添加了上述污点之后,
231
269
Pod 还能继续在节点上运行的时间。例如,
@@ -327,7 +365,7 @@ manually add tolerations to your pods.
327
365
* **Taint based Evictions**: A per-pod-configurable eviction behavior
328
366
when there are node problems, which is described in the next section.
329
367
-->
330
- * **基于污点的驱逐**: 这是在每个 Pod 中配置的在节点出现问题时的驱逐行为,
368
+ * **基于污点的驱逐**: 这是在每个 Pod 中配置的在节点出现问题时的驱逐行为,
331
369
接下来的章节会描述这个特性。
332
370
333
371
<!--
@@ -337,24 +375,6 @@ when there are node problems, which is described in the next section.
337
375
338
376
{{< feature-state for_k8s_version="v1.18" state="stable" >}}
339
377
340
- <!--
341
- The `NoExecute` taint effect, mentioned above, affects pods that are already
342
- running on the node as follows
343
-
344
- * pods that do not tolerate the taint are evicted immediately
345
- * pods that tolerate the taint without specifying `tolerationSeconds` in
346
- their toleration specification remain bound forever
347
- * pods that tolerate the taint with a specified `tolerationSeconds` remain
348
- bound for the specified amount of time
349
- -->
350
- 前文提到过污点的效果值 `NoExecute` 会影响已经在节点上运行的如下 Pod:
351
-
352
- * 如果 Pod 不能忍受这类污点,Pod 会马上被驱逐。
353
- * 如果 Pod 能够忍受这类污点,但是在容忍度定义中没有指定 `tolerationSeconds`,
354
- 则 Pod 还会一直在这个节点上运行。
355
- * 如果 Pod 能够忍受这类污点,而且指定了 `tolerationSeconds`,
356
- 则 Pod 还能在这个节点上继续运行这个指定的时间长度。
357
-
358
378
<!--
359
379
The node controller automatically taints a Node when certain conditions
360
380
are true. The following taints are built in :
@@ -380,19 +400,22 @@ are true. The following taints are built in:
380
400
的值为 "`Unknown`"。
381
401
* `node.kubernetes.io/memory-pressure`:节点存在内存压力。
382
402
* `node.kubernetes.io/disk-pressure`:节点存在磁盘压力。
383
- * `node.kubernetes.io/pid-pressure`: 节点的 PID 压力。
403
+ * `node.kubernetes.io/pid-pressure`: 节点的 PID 压力。
384
404
* `node.kubernetes.io/network-unavailable`:节点网络不可用。
385
- * `node.kubernetes.io/unschedulable`: 节点不可调度。
405
+ * `node.kubernetes.io/unschedulable`: 节点不可调度。
386
406
* `node.cloudprovider.kubernetes.io/uninitialized`:如果 kubelet 启动时指定了一个“外部”云平台驱动,
387
407
它将给当前节点添加一个污点将其标志为不可用。在 cloud-controller-manager
388
408
的一个控制器初始化这个节点后,kubelet 将删除这个污点。
389
409
390
410
<!--
391
411
In case a node is to be drained, the node controller or the kubelet adds relevant taints
392
- with `NoExecute` effect. If the fault condition returns to normal the kubelet or node
412
+ with `NoExecute` effect. This effect is added by default for the
413
+ ` node.kubernetes.io/not-ready` and `node.kubernetes.io/unreachable` taints.
414
+ If the fault condition returns to normal, the kubelet or node
393
415
controller can remove the relevant taint(s).
394
416
-->
395
417
在节点被排空时,节点控制器或者 kubelet 会添加带有 `NoExecute` 效果的相关污点。
418
+ 此效果被默认添加到 `node.kubernetes.io/not-ready` 和 `node.kubernetes.io/unreachable` 污点中。
396
419
如果异常状态恢复正常,kubelet 或节点控制器能够移除相关的污点。
397
420
398
421
<!--
@@ -532,9 +555,9 @@ DaemonSet 控制器自动为所有守护进程添加如下 `NoSchedule` 容忍
532
555
533
556
* `node.kubernetes.io/memory-pressure`
534
557
* `node.kubernetes.io/disk-pressure`
535
- * `node.kubernetes.io/pid-pressure` ( 1.14 或更高版本)
536
- * `node.kubernetes.io/unschedulable` ( 1.10 或更高版本)
537
- * `node.kubernetes.io/network-unavailable` ( **只适合主机网络配置**)
558
+ * `node.kubernetes.io/pid-pressure`( 1.14 或更高版本)
559
+ * `node.kubernetes.io/unschedulable`( 1.10 或更高版本)
560
+ * `node.kubernetes.io/network-unavailable`( **只适合主机网络配置**)
538
561
539
562
<!--
540
563
Adding these tolerations ensures backward compatibility. You can also add
0 commit comments