@@ -42,7 +42,7 @@ marks that the node should not accept any pods that do not tolerate the taints.
42
42
You add a taint to a node using [kubectl taint](/docs/reference/generated/kubectl/kubectl-commands#taint).
43
43
For example,
44
44
-->
45
- 您可以使用命令 [ kubectl taint] ( /docs/reference/generated/kubectl/kubectl-commands#taint ) 给节点增加一个污点。比如,
45
+ 你可以使用命令 [ kubectl taint] ( /docs/reference/generated/kubectl/kubectl-commands#taint ) 给节点增加一个污点。比如,
46
46
47
47
``` shell
48
48
kubectl taint nodes node1 key1=value1:NoSchedule
@@ -75,7 +75,7 @@ You specify a toleration for a pod in the PodSpec. Both of the following tolerat
75
75
taint created by the `kubectl taint` line above, and thus a pod with either toleration would be able
76
76
to schedule onto `node1`:
77
77
-->
78
- 您可以在 PodSpec 中定义 Pod 的容忍度。
78
+ 你可以在 PodSpec 中定义 Pod 的容忍度。
79
79
下面两个容忍度均与上面例子中使用 ` kubectl taint ` 命令创建的污点相匹配,
80
80
因此如果一个 Pod 拥有其中的任何一个容忍度都能够被分配到 ` node1 ` :
81
81
@@ -140,7 +140,7 @@ This is a "preference" or "soft" version of `NoSchedule` - the system will *try*
140
140
pod that does not tolerate the taint on the node, but it is not required. The third kind of `effect` is
141
141
` NoExecute` , described later.
142
142
-->
143
- 上述例子中 `effect` 使用的值为 `NoSchedule`,您也可以使用另外一个值 `PreferNoSchedule`。
143
+ 上述例子中 `effect` 使用的值为 `NoSchedule`,你也可以使用另外一个值 `PreferNoSchedule`。
144
144
这是“优化”或“软”版本的 `NoSchedule` —— 系统会 *尽量* 避免将 Pod 调度到存在其不能容忍污点的节点上,
145
145
但这不是强制的。`effect` 的值还可以设置为 `NoExecute`,下文会详细描述这个值。
146
146
@@ -150,13 +150,12 @@ The way Kubernetes processes multiple taints and tolerations is like a filter: s
150
150
with all of a node's taints, then ignore the ones for which the pod has a matching toleration; the
151
151
remaining un-ignored taints have the indicated effects on the pod. In particular,
152
152
-->
153
- 您可以给一个节点添加多个污点 ,也可以给一个 Pod 添加多个容忍度设置。
153
+ 你可以给一个节点添加多个污点 ,也可以给一个 Pod 添加多个容忍度设置。
154
154
Kubernetes 处理多个污点和容忍度的过程就像一个过滤器:从一个节点的所有污点开始遍历,
155
155
过滤掉那些 Pod 中存在与之相匹配的容忍度的污点。余下未被过滤的污点的 effect 值决定了
156
156
Pod 是否会被分配到该节点,特别是以下情况:
157
157
158
158
<!--
159
-
160
159
* if there is at least one un-ignored taint with effect `NoSchedule` then Kubernetes will not schedule
161
160
the pod onto that node
162
161
* if there is no un-ignored taint with effect `NoSchedule` but there is at least one un-ignored taint with
@@ -177,7 +176,7 @@ scheduled onto the node (if it is not yet running on the node).
177
176
<!--
178
177
For example, imagine you taint a node like this
179
178
-->
180
- 例如,假设您给一个节点添加了如下污点
179
+ 例如,假设你给一个节点添加了如下污点
181
180
182
181
` ` ` shell
183
182
kubectl taint nodes node1 key1=value1:NoSchedule
@@ -253,7 +252,7 @@ taint is removed before that time, the pod will not be evicted.
253
252
Taints and tolerations are a flexible way to steer pods *away* from nodes or evict
254
253
pods that shouldn't be running. A few of the use cases are
255
254
-->
256
- 通过污点和容忍度,可以灵活地让 Pod *避开 * 某些节点或者将 Pod 从某些节点驱逐。下面是几个使用例子:
255
+ 通过污点和容忍度,可以灵活地让 Pod **避开* * 某些节点或者将 Pod 从某些节点驱逐。下面是几个使用例子:
257
256
258
257
<!--
259
258
* **Dedicated Nodes**: If you want to dedicate a set of nodes for exclusive use by
@@ -268,13 +267,13 @@ to the taint to the same set of nodes (e.g. `dedicated=groupName`), and the admi
268
267
controller should additionally add a node affinity to require that the pods can only schedule
269
268
onto nodes labeled with `dedicated=groupName`.
270
269
-->
271
- * **专用节点**:如果您想将某些节点专门分配给特定的一组用户使用,您可以给这些节点添加一个污点 (即,
270
+ * **专用节点**:如果你想将某些节点专门分配给特定的一组用户使用,你可以给这些节点添加一个污点 (即,
272
271
` kubectl taint nodes nodename dedicated=groupName:NoSchedule` ),
273
272
然后给这组用户的 Pod 添加一个相对应的 toleration(通过编写一个自定义的
274
273
[准入控制器](/zh/docs/reference/access-authn-authz/admission-controllers/),很容易就能做到)。
275
274
拥有上述容忍度的 Pod 就能够被分配到上述专用节点,同时也能够被分配到集群中的其它节点。
276
- 如果您希望这些 Pod 只能被分配到上述专用节点,那么您还需要给这些专用节点另外添加一个和上述
277
- 污点类似的 label (例如:`dedicated=groupName`),同时 还要在上述准入控制器中给 Pod
275
+ 如果你希望这些 Pod 只能被分配到上述专用节点,那么您还需要给这些专用节点另外添加一个和上述
276
+ 污点类似的 label (例如:`dedicated=groupName`),同时 还要在上述准入控制器中给 Pod
278
277
增加节点亲和性要求上述 Pod 只能被分配到添加了 `dedicated=groupName` 标签的节点上。
279
278
280
279
<!--
@@ -316,7 +315,7 @@ manually add tolerations to your pods.
316
315
` ExtendedResourceToleration` 准入控制器会自动给 Pod 加上正确的容忍度,
317
316
这样 Pod 就会被自动调度到这些配置了特殊硬件件的节点上。
318
317
这样就能够确保这些配置了特殊硬件的节点专门用于运行需要使用这些硬件的 Pod,
319
- 并且您无需手动给这些 Pod 添加容忍度。
318
+ 并且你无需手动给这些 Pod 添加容忍度。
320
319
321
320
<!--
322
321
* **Taint based Evictions**: A per-pod-configurable eviction behavior
@@ -341,7 +340,7 @@ running on the node as follows
341
340
* pods that tolerate the taint with a specified `tolerationSeconds` remain
342
341
bound for the specified amount of time
343
342
-->
344
- 前文提到过污点的 effect 值 `NoExecute`会影响已经在节点上运行的 Pod
343
+ 前文提到过污点的 effect 值 `NoExecute` 会影响已经在节点上运行的 Pod
345
344
346
345
* 如果 Pod 不能忍受 effect 值为 `NoExecute` 的污点,那么 Pod 将马上被驱逐
347
346
* 如果 Pod 能够忍受 effect 值为 `NoExecute` 的污点,但是在容忍度定义中没有指定
@@ -507,7 +506,7 @@ onto the affected node.
507
506
-->
508
507
509
508
对于新创建的 Pod,可以通过添加相应的 Pod 容忍度来忽略节点状况。
510
- 控制平面还在具有除 `BestEffort` 之外的 {{<glossary_tooltip text="QoS 类" term_id="qos-class" >}}的 pod 上
509
+ 控制平面还在具有除 `BestEffort` 之外的 {{<glossary_tooltip text="QoS 类" term_id="qos-class" >}}的 Pod 上
511
510
添加 `node.kubernetes.io/memory-pressure` 容忍度。
512
511
这是因为 Kubernetes 将 `Guaranteed` 或 `Burstable` QoS 类中的 Pod(甚至没有设置内存请求的 Pod)
513
512
视为能够应对内存压力,而新创建的 `BestEffort` Pod 不会被调度到受影响的节点上。
@@ -530,14 +529,14 @@ DaemonSet 控制器自动为所有守护进程添加如下 `NoSchedule` 容忍
530
529
* `node.kubernetes.io/disk-pressure`
531
530
* `node.kubernetes.io/pid-pressure` (1.14 或更高版本)
532
531
* `node.kubernetes.io/unschedulable` (1.10 或更高版本)
533
- * `node.kubernetes.io/network-unavailable` (*只适合主机网络配置*)
532
+ * `node.kubernetes.io/network-unavailable` (** 只适合主机网络配置* *)
534
533
535
534
<!--
536
535
Adding these tolerations ensures backward compatibility. You can also add
537
536
arbitrary tolerations to DaemonSets.
538
537
-->
539
538
540
- 添加上述容忍度确保了向后兼容,您也可以选择自由向 DaemonSet 添加容忍度。
539
+ 添加上述容忍度确保了向后兼容,你也可以选择自由向 DaemonSet 添加容忍度。
541
540
542
541
# # {{% heading "whatsnext" %}}
543
542
0 commit comments