Skip to content

Commit 592a97e

Browse files
authored
Merge pull request #39997 from asa3311/zh]-sync-assign-pod-node.md
[zh] sync assign-pod-node.md
2 parents 91f537a + 56377d3 commit 592a97e

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

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

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ Pod 被部署到哪个节点。例如,确保 Pod 最终落在连接了 SSD 的
4545
You can use any of the following methods to choose where Kubernetes schedules
4646
specific Pods:
4747
48-
* [nodeSelector](#nodeselector) field matching against [node labels](#built-in-node-labels)
49-
* [Affinity and anti-affinity](#affinity-and-anti-affinity)
50-
* [nodeName](#nodename) field
51-
* [Pod topology spread constraints](#pod-topology-spread-constraints)
48+
- [nodeSelector](#nodeselector) field matching against [node labels](#built-in-node-labels)
49+
- [Affinity and anti-affinity](#affinity-and-anti-affinity)
50+
- [nodeName](#nodename) field
51+
- [Pod topology spread constraints](#pod-topology-spread-constraints)
5252
-->
5353
你可以使用下列方法中的任何一种来选择 Kubernetes 对特定 Pod 的调度:
5454

55-
*[节点标签](#built-in-node-labels)匹配的 [nodeSelector](#nodeSelector)
56-
* [亲和性与反亲和性](#affinity-and-anti-affinity)
57-
* [nodeName](#nodename) 字段
58-
* [Pod 拓扑分布约束](#pod-topology-spread-constraints)
55+
-[节点标签](#built-in-node-labels)匹配的 [nodeSelector](#nodeSelector)
56+
- [亲和性与反亲和性](#affinity-and-anti-affinity)
57+
- [nodeName](#nodename) 字段
58+
- [Pod 拓扑分布约束](#pod-topology-spread-constraints)
5959

6060
<!--
6161
## Node labels {#built-in-node-labels}
@@ -162,33 +162,33 @@ define. Some of the benefits of affinity and anti-affinity include:
162162
亲和性和反亲和性扩展了你可以定义的约束类型。使用亲和性与反亲和性的一些好处有:
163163

164164
<!--
165-
* The affinity/anti-affinity language is more expressive. `nodeSelector` only
165+
- The affinity/anti-affinity language is more expressive. `nodeSelector` only
166166
selects nodes with all the specified labels. Affinity/anti-affinity gives you
167167
more control over the selection logic.
168-
* You can indicate that a rule is *soft* or *preferred*, so that the scheduler
168+
- You can indicate that a rule is *soft* or *preferred*, so that the scheduler
169169
still schedules the Pod even if it can't find a matching node.
170-
* You can constrain a Pod using labels on other Pods running on the node (or other topological domain),
170+
- You can constrain a Pod using labels on other Pods running on the node (or other topological domain),
171171
instead of just node labels, which allows you to define rules for which Pods
172172
can be co-located on a node.
173173
-->
174-
* 亲和性、反亲和性语言的表达能力更强。`nodeSelector` 只能选择拥有所有指定标签的节点。
174+
- 亲和性、反亲和性语言的表达能力更强。`nodeSelector` 只能选择拥有所有指定标签的节点。
175175
亲和性、反亲和性为你提供对选择逻辑的更强控制能力。
176-
* 你可以标明某规则是“软需求”或者“偏好”,这样调度器在无法找到匹配节点时仍然调度该 Pod。
177-
* 你可以使用节点上(或其他拓扑域中)运行的其他 Pod 的标签来实施调度约束,
176+
- 你可以标明某规则是“软需求”或者“偏好”,这样调度器在无法找到匹配节点时仍然调度该 Pod。
177+
- 你可以使用节点上(或其他拓扑域中)运行的其他 Pod 的标签来实施调度约束,
178178
而不是只能使用节点本身的标签。这个能力让你能够定义规则允许哪些 Pod 可以被放置在一起。
179179

180180
<!--
181181
The affinity feature consists of two types of affinity:
182182
183-
* *Node affinity* functions like the `nodeSelector` field but is more expressive and
183+
- *Node affinity* functions like the `nodeSelector` field but is more expressive and
184184
allows you to specify soft rules.
185-
* *Inter-pod affinity/anti-affinity* allows you to constrain Pods against labels
185+
- *Inter-pod affinity/anti-affinity* allows you to constrain Pods against labels
186186
on other Pods.
187187
-->
188188
亲和性功能由两种类型的亲和性组成:
189189

190-
* **节点亲和性**功能类似于 `nodeSelector` 字段,但它的表达能力更强,并且允许你指定软规则。
191-
* Pod 间亲和性/反亲和性允许你根据其他 Pod 的标签来约束 Pod。
190+
- **节点亲和性**功能类似于 `nodeSelector` 字段,但它的表达能力更强,并且允许你指定软规则。
191+
- Pod 间亲和性/反亲和性允许你根据其他 Pod 的标签来约束 Pod。
192192

193193
<!--
194194
### Node affinity
@@ -204,17 +204,17 @@ affinity:
204204
节点亲和性有两种:
205205

206206
<!--
207-
* `requiredDuringSchedulingIgnoredDuringExecution`: The scheduler can't
207+
- `requiredDuringSchedulingIgnoredDuringExecution`: The scheduler can't
208208
schedule the Pod unless the rule is met. This functions like `nodeSelector`,
209209
but with a more expressive syntax.
210-
* `preferredDuringSchedulingIgnoredDuringExecution`: The scheduler tries to
210+
- `preferredDuringSchedulingIgnoredDuringExecution`: The scheduler tries to
211211
find a node that meets the rule. If a matching node is not available, the
212212
scheduler still schedules the Pod.
213213
-->
214-
* `requiredDuringSchedulingIgnoredDuringExecution`
214+
- `requiredDuringSchedulingIgnoredDuringExecution`
215215
调度器只有在规则被满足的时候才能执行调度。此功能类似于 `nodeSelector`
216216
但其语法表达能力更强。
217-
* `preferredDuringSchedulingIgnoredDuringExecution`
217+
- `preferredDuringSchedulingIgnoredDuringExecution`
218218
调度器会尝试寻找满足对应规则的节点。如果找不到匹配的节点,调度器仍然会调度该 Pod。
219219

220220
{{<note>}}
@@ -240,16 +240,16 @@ For example, consider the following Pod spec:
240240
<!--
241241
In this example, the following rules apply:
242242
243-
* The node *must* have a label with the key `topology.kubernetes.io/zone` and
243+
- The node *must* have a label with the key `topology.kubernetes.io/zone` and
244244
the value of that label *must* be either `antarctica-east1` or `antarctica-west1`.
245-
* The node *preferably* has a label with the key `another-node-label-key` and
245+
- The node *preferably* has a label with the key `another-node-label-key` and
246246
the value `another-node-label-value`.
247247
-->
248248
在这一示例中,所应用的规则如下:
249249

250-
* 节点**必须**包含一个键名为 `topology.kubernetes.io/zone` 的标签,
250+
- 节点**必须**包含一个键名为 `topology.kubernetes.io/zone` 的标签,
251251
并且该标签的取值**必须**`antarctica-east1``antarctica-west1`
252-
* 节点**最好**具有一个键名为 `another-node-label-key` 且取值为
252+
- 节点**最好**具有一个键名为 `another-node-label-key` 且取值为
253253
`another-node-label-value` 的标签。
254254

255255
<!--
@@ -499,8 +499,8 @@ anti-affinity as follows:
499499

500500
与[节点亲和性](#node-affinity)类似,Pod 的亲和性与反亲和性也有两种类型:
501501

502-
* `requiredDuringSchedulingIgnoredDuringExecution`
503-
* `preferredDuringSchedulingIgnoredDuringExecution`
502+
- `requiredDuringSchedulingIgnoredDuringExecution`
503+
- `preferredDuringSchedulingIgnoredDuringExecution`
504504

505505
<!--
506506
For example, you could use
@@ -590,17 +590,17 @@ exceptions for performance and security reasons:
590590
有一些限制:
591591

592592
<!--
593-
* For Pod affinity and anti-affinity, an empty `topologyKey` field is not allowed in both `requiredDuringSchedulingIgnoredDuringExecution`
593+
- For Pod affinity and anti-affinity, an empty `topologyKey` field is not allowed in both `requiredDuringSchedulingIgnoredDuringExecution`
594594
and `preferredDuringSchedulingIgnoredDuringExecution`.
595-
* For `requiredDuringSchedulingIgnoredDuringExecution` Pod anti-affinity rules,
595+
- For `requiredDuringSchedulingIgnoredDuringExecution` Pod anti-affinity rules,
596596
the admission controller `LimitPodHardAntiAffinityTopology` limits
597597
`topologyKey` to `kubernetes.io/hostname`. You can modify or disable the
598598
admission controller if you want to allow custom topologies.
599599
-->
600-
* 对于 Pod 亲和性而言,在 `requiredDuringSchedulingIgnoredDuringExecution`
600+
- 对于 Pod 亲和性而言,在 `requiredDuringSchedulingIgnoredDuringExecution`
601601
和 `preferredDuringSchedulingIgnoredDuringExecution` 中,`topologyKey`
602602
不允许为空。
603-
* 对于 `requiredDuringSchedulingIgnoredDuringExecution` 要求的 Pod 反亲和性,
603+
- 对于 `requiredDuringSchedulingIgnoredDuringExecution` 要求的 Pod 反亲和性,
604604
准入控制器 `LimitPodHardAntiAffinityTopology` 要求 `topologyKey` 只能是
605605
`kubernetes.io/hostname`。如果你希望使用其他定制拓扑逻辑,
606606
你可以更改准入控制器或者禁用之。
@@ -758,10 +758,10 @@ where each web server is co-located with a cache, on three separate nodes.
758758
创建前面两个 Deployment 会产生如下的集群布局,每个 Web 服务器与一个缓存实例并置,
759759
并分别运行在三个独立的节点上。
760760

761-
| node-1 | node-2 | node-3 |
762-
|:--------------------:|:-------------------:|:------------------:|
763-
| *webserver-1* | *webserver-2* | *webserver-3* |
764-
| *cache-1* | *cache-2* | *cache-3* |
761+
| node-1 | node-2 | node-3 |
762+
|:-------------:|:-------------:|:-------------:|
763+
| *webserver-1* | *webserver-2* | *webserver-3* |
764+
| *cache-1* | *cache-2* | *cache-3* |
765765

766766
<!--
767767
The overall effect is that each cache instance is likely to be accessed by a single client, that
@@ -872,18 +872,18 @@ to learn more about how these work.
872872
## {{% heading "whatsnext" %}}
873873

874874
<!--
875-
* Read more about [taints and tolerations](/docs/concepts/scheduling-eviction/taint-and-toleration/) .
876-
* Read the design docs for [node affinity](https://git.k8s.io/design-proposals-archive/scheduling/nodeaffinity.md)
875+
- Read more about [taints and tolerations](/docs/concepts/scheduling-eviction/taint-and-toleration/) .
876+
- Read the design docs for [node affinity](https://git.k8s.io/design-proposals-archive/scheduling/nodeaffinity.md)
877877
and for [inter-pod affinity/anti-affinity](https://git.k8s.io/design-proposals-archive/scheduling/podaffinity.md).
878-
* Learn about how the [topology manager](/docs/tasks/administer-cluster/topology-manager/) takes part in node-level
878+
- Learn about how the [topology manager](/docs/tasks/administer-cluster/topology-manager/) takes part in node-level
879879
resource allocation decisions.
880-
* Learn how to use [nodeSelector](/docs/tasks/configure-pod-container/assign-pods-nodes/).
881-
* Learn how to use [affinity and anti-affinity](/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/).
880+
- Learn how to use [nodeSelector](/docs/tasks/configure-pod-container/assign-pods-nodes/).
881+
- Learn how to use [affinity and anti-affinity](/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/).
882882
-->
883-
* 进一步阅读[污点与容忍度](/zh-cn/docs/concepts/scheduling-eviction/taint-and-toleration/)文档。
884-
* 阅读[节点亲和性](https://git.k8s.io/design-proposals-archive/scheduling/nodeaffinity.md)
883+
- 进一步阅读[污点与容忍度](/zh-cn/docs/concepts/scheduling-eviction/taint-and-toleration/)文档。
884+
- 阅读[节点亲和性](https://git.k8s.io/design-proposals-archive/scheduling/nodeaffinity.md)
885885
和[Pod 间亲和性与反亲和性](https://git.k8s.io/design-proposals-archive/scheduling/podaffinity.md)
886886
的设计文档。
887-
* 了解[拓扑管理器](/zh-cn/docs/tasks/administer-cluster/topology-manager/)如何参与节点层面资源分配决定。
888-
* 了解如何使用 [nodeSelector](/zh-cn/docs/tasks/configure-pod-container/assign-pods-nodes/)。
887+
- 了解[拓扑管理器](/zh-cn/docs/tasks/administer-cluster/topology-manager/)如何参与节点层面资源分配决定。
888+
- 了解如何使用 [nodeSelector](/zh-cn/docs/tasks/configure-pod-container/assign-pods-nodes/)。
889889
* 了解如何使用[亲和性和反亲和性](/zh-cn/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/)。

0 commit comments

Comments
 (0)