Skip to content

Commit

Permalink
sync assign-pod-node pod-scheduling-readiness taint-and-toleratio
Browse files Browse the repository at this point in the history
Update assign-pod-node.md

Update assign-pod-node.md
  • Loading branch information
asa3311 committed Sep 24, 2023
1 parent f2ef324 commit d8f9e5c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
24 changes: 21 additions & 3 deletions content/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ For example, consider the following Pod spec:
你可以使用 Pod 规约中的 `.spec.affinity.nodeAffinity` 字段来设置节点亲和性。
例如,考虑下面的 Pod 规约:

{{% code file="pods/pod-with-node-affinity.yaml" %}}
{{% code_sample file="pods/pod-with-node-affinity.yaml" %}}

<!--
In this example, the following rules apply:
Expand Down Expand Up @@ -331,7 +331,7 @@ For example, consider the following Pod spec:

例如,考虑下面的 Pod 规约:

{{% code file="pods/pod-with-affinity-anti-affinity.yaml" %}}
{{% code_sample file="pods/pod-with-affinity-anti-affinity.yaml" %}}

<!--
If there are two possible nodes that match the
Expand Down Expand Up @@ -525,6 +525,24 @@ spec.
要使用 Pod 间亲和性,可以使用 Pod 规约中的 `.affinity.podAffinity` 字段。
对于 Pod 间反亲和性,可以使用 Pod 规约中的 `.affinity.podAntiAffinity` 字段。

<!--
#### Scheduling a group of pods with inter-pod affinity to themselves
If the current Pod being scheduled is the first in a series that have affinity to themselves,
it is allowed to be scheduled if it passes all other affinity checks. This is determined by
verifying that no other pod in the cluster matches the namespace and selector of this pod,
that the pod matches its own terms, and the chosen node matches all requested topologies.
This ensures that there will not be a deadlock even if all the pods have inter-pod affinity
specified.
-->
#### 调度一组具有 Pod 间亲和性的 Pod {#scheduling-a-group-of-pods-with-inter-pod-affinity-to-themselves}

如果当前正被调度的 Pod 在具有自我亲和性的 Pod 序列中排在第一个,
那么只要它满足其他所有的亲和性规则,它就可以被成功调度。
这是通过以下方式确定的:确保集群中没有其他 Pod 与此 Pod 的命名空间和标签选择器匹配;
该 Pod 满足其自身定义的条件,并且选定的节点满足所指定的所有拓扑要求。
这确保即使所有的 Pod 都配置了 Pod 间亲和性,也不会出现调度死锁的情况。

<!--
#### Pod affinity example {#an-example-of-a-pod-that-uses-pod-affinity}
Expand All @@ -534,7 +552,7 @@ Consider the following Pod spec:

考虑下面的 Pod 规约:

{{% code file="pods/pod-with-pod-affinity.yaml" %}}
{{% code_sample file="pods/pod-with-pod-affinity.yaml" %}}

<!--
This example defines one Pod affinity rule and one Pod anti-affinity rule. The
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ To mark a Pod not-ready for scheduling, you can create it with one or more sched

要将 Pod 标记为未准备好进行调度,你可以在创建 Pod 时附带一个或多个调度门控,如下所示:

{{< codenew file="pods/pod-with-scheduling-gates.yaml" >}}
{{% code_sample file="pods/pod-with-scheduling-gates.yaml" %}}

<!--
After the Pod's creation, you can check its state using:
Expand Down Expand Up @@ -102,7 +102,7 @@ by re-applying a modified manifest:
-->
要通知调度程序此 Pod 已准备好进行调度,你可以通过重新应用修改后的清单来完全删除其 `schedulingGates`

{{< codenew file="pods/pod-without-scheduling-gates.yaml" >}}
{{% code_sample file="pods/pod-without-scheduling-gates.yaml" %}}

<!--
You can check if the `schedulingGates` is cleared by running:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Here's an example of a pod that uses tolerations:
-->
这里是一个使用了容忍度的 Pod:

{{< codenew file="pods/pod-with-toleration.yaml" >}}
{{% code_sample file="pods/pod-with-toleration.yaml" %}}

<!--
The default value for `operator` is `Equal`.
Expand Down

0 comments on commit d8f9e5c

Please sign in to comment.