diff --git a/content/zh-cn/docs/concepts/scheduling-eviction/taint-and-toleration.md b/content/zh-cn/docs/concepts/scheduling-eviction/taint-and-toleration.md index a3c403081a..981656fa6f 100644 --- a/content/zh-cn/docs/concepts/scheduling-eviction/taint-and-toleration.md +++ b/content/zh-cn/docs/concepts/scheduling-eviction/taint-and-toleration.md @@ -4,6 +4,7 @@ content_type: concept weight: 40 --- + -**容忍度(Toleration)** 是应用于 Pod 上的。容忍度允许调度器调度带有对应污点的节点。 +**容忍度(Toleration)** 是应用于 Pod 上的。容忍度允许调度器调度带有对应污点的 Pod。 容忍度允许调度但并不保证调度:作为其功能的一部分, 调度器也会[评估其他参数](/zh-cn/docs/concepts/scheduling-eviction/pod-priority-preemption/)。 @@ -89,7 +90,7 @@ tolerations: ``` 这里是一个使用了容忍度的 Pod: @@ -104,7 +105,7 @@ The default value for `operator` is `Equal`. A toleration "matches" a taint if the keys are the same and the effects are the same, and: * the `operator` is `Exists` (in which case no `value` should be specified), or -* the `operator` is `Equal` and the `value`s are equal +* the `operator` is `Equal` and the `value`s are equal. --> 一个容忍度和一个污点相“匹配”是指它们有一样的键名和效果,并且: @@ -112,6 +113,7 @@ A toleration "matches" a taint if the keys are the same and the effects are the * 如果 `operator` 是 `Equal` ,则它们的 `value` 应该相等 {{< note >}} + @@ -147,7 +149,7 @@ remaining un-ignored taints have the indicated effects on the pod. In particular 你可以给一个节点添加多个污点,也可以给一个 Pod 添加多个容忍度设置。 Kubernetes 处理多个污点和容忍度的过程就像一个过滤器:从一个节点的所有污点开始遍历, 过滤掉那些 Pod 中存在与之相匹配的容忍度的污点。余下未被过滤的污点的 effect 值决定了 -Pod 是否会被分配到该节点,特别是以下情况: +Pod 是否会被分配到该节点。需要注意以下情况: -假定有一个 Pod,它有两个容忍度: +假定某个 Pod 有两个容忍度: ```yaml tolerations: @@ -207,7 +209,7 @@ one of the three that is not tolerated by the pod. -* **专用节点**:如果你想将某些节点专门分配给特定的一组用户使用,你可以给这些节点添加一个污点(即, +* **专用节点**:如果想将某些节点专门分配给特定的一组用户使用,你可以给这些节点添加一个污点(即, `kubectl taint nodes nodename dedicated=groupName:NoSchedule`), 然后给这组用户的 Pod 添加一个相对应的容忍度 (通过编写一个自定义的[准入控制器](/zh-cn/docs/reference/access-authn-authz/admission-controllers/), @@ -282,7 +284,7 @@ toleration to pods that use the special hardware. As in the dedicated nodes use it is probably easiest to apply the tolerations using a custom [admission controller](/docs/reference/access-authn-authz/admission-controllers/). For example, it is recommended to use [Extended -Resources](/docs/concepts/configuration/manage-compute-resources-container/#extended-resources) +Resources](/docs/concepts/configuration/manage-resources-containers/#extended-resources) to represent the special hardware, taint your special hardware nodes with the extended resource name and run the [ExtendedResourceToleration](/docs/reference/access-authn-authz/admission-controllers/#extendedresourcetoleration) @@ -326,7 +328,7 @@ when there are node problems, which is described in the next section. {{< feature-state for_k8s_version="v1.18" state="stable" >}} 前文提到过污点的效果值 `NoExecute` 会影响已经在节点上运行的 Pod,如下 -* 如果 Pod 不能忍受这类污点,Pod 会马上被驱逐 +* 如果 Pod 不能忍受这类污点,Pod 会马上被驱逐。 * 如果 Pod 能够忍受这类污点,但是在容忍度定义中没有指定 `tolerationSeconds`, 则 Pod 还会一直在这个节点上运行。 * 如果 Pod 能够忍受这类污点,而且指定了 `tolerationSeconds`, 则 Pod 还能在这个节点上继续运行这个指定的时间长度。 @@ -457,7 +459,8 @@ This ensures that DaemonSet pods are never evicted due to these problems. ## Taint Nodes by Condition The control plane, using the node {{}}, -automatically creates taints with a `NoSchedule` effect for [node conditions](/docs/concepts/scheduling-eviction/node-pressure-eviction/#node-conditions). +automatically creates taints with a `NoSchedule` effect for +[node conditions](/docs/concepts/scheduling-eviction/node-pressure-eviction/#node-conditions). --> ## 基于节点状态添加污点 {#taint-nodes-by-condition} @@ -496,9 +499,8 @@ onto the affected node. 视为能够应对内存压力,而新创建的 `BestEffort` Pod 不会被调度到受影响的节点上。 -DaemonSet 控制器自动为所有守护进程添加如下 `NoSchedule` 容忍度以防 DaemonSet 崩溃: +DaemonSet 控制器自动为所有守护进程添加如下 `NoSchedule` 容忍度,以防 DaemonSet 崩溃: * `node.kubernetes.io/memory-pressure` * `node.kubernetes.io/disk-pressure` @@ -525,7 +527,8 @@ arbitrary tolerations to DaemonSets. ## {{% heading "whatsnext" %}} * 阅读[节点压力驱逐](/zh-cn/docs/concepts/scheduling-eviction/node-pressure-eviction/),