Skip to content

Commit 7019777

Browse files
authored
Merge pull request #43143 from asa3311/sync-zh-65
[zh] sync assign-pod-node pod-scheduling-readiness taint-and-toleration
2 parents 7e6d538 + d8f9e5c commit 7019777

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

content/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ For example, consider the following Pod spec:
231231
你可以使用 Pod 规约中的 `.spec.affinity.nodeAffinity` 字段来设置节点亲和性。
232232
例如,考虑下面的 Pod 规约:
233233

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

236236
<!--
237237
In this example, the following rules apply:
@@ -331,7 +331,7 @@ For example, consider the following Pod spec:
331331

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

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

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

528+
<!--
529+
#### Scheduling a group of pods with inter-pod affinity to themselves
530+
531+
If the current Pod being scheduled is the first in a series that have affinity to themselves,
532+
it is allowed to be scheduled if it passes all other affinity checks. This is determined by
533+
verifying that no other pod in the cluster matches the namespace and selector of this pod,
534+
that the pod matches its own terms, and the chosen node matches all requested topologies.
535+
This ensures that there will not be a deadlock even if all the pods have inter-pod affinity
536+
specified.
537+
-->
538+
#### 调度一组具有 Pod 间亲和性的 Pod {#scheduling-a-group-of-pods-with-inter-pod-affinity-to-themselves}
539+
540+
如果当前正被调度的 Pod 在具有自我亲和性的 Pod 序列中排在第一个,
541+
那么只要它满足其他所有的亲和性规则,它就可以被成功调度。
542+
这是通过以下方式确定的:确保集群中没有其他 Pod 与此 Pod 的命名空间和标签选择器匹配;
543+
该 Pod 满足其自身定义的条件,并且选定的节点满足所指定的所有拓扑要求。
544+
这确保即使所有的 Pod 都配置了 Pod 间亲和性,也不会出现调度死锁的情况。
545+
528546
<!--
529547
#### Pod affinity example {#an-example-of-a-pod-that-uses-pod-affinity}
530548

@@ -534,7 +552,7 @@ Consider the following Pod spec:
534552

535553
考虑下面的 Pod 规约:
536554

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

539557
<!--
540558
This example defines one Pod affinity rule and one Pod anti-affinity rule. The

content/zh-cn/docs/concepts/scheduling-eviction/pod-scheduling-readiness.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ To mark a Pod not-ready for scheduling, you can create it with one or more sched
5757

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

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

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

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

107107
<!--
108108
You can check if the `schedulingGates` is cleared by running:

content/zh-cn/docs/concepts/scheduling-eviction/taint-and-toleration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Here's an example of a pod that uses tolerations:
105105
-->
106106
这里是一个使用了容忍度的 Pod:
107107
108-
{{< codenew file="pods/pod-with-toleration.yaml" >}}
108+
{{% code_sample file="pods/pod-with-toleration.yaml" %}}
109109
110110
<!--
111111
The default value for `operator` is `Equal`.

0 commit comments

Comments
 (0)