Skip to content

Commit 8301bef

Browse files
authored
Merge pull request #35980 from ydFu/update-pod-priority-preemption
[zh] Update concepts\scheduling-eviction\pod-priority-preemption.md
2 parents 2aa3cc3 + e98657a commit 8301bef

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

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

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ importance of a Pod relative to other Pods. If a Pod cannot be scheduled, the
2323
scheduler tries to preempt (evict) lower priority Pods to make scheduling of the
2424
pending Pod possible.
2525
-->
26-
[Pod](/zh-cn/docs/concepts/workloads/pods/) 可以有 _优先级_
26+
[Pod](/zh-cn/docs/concepts/workloads/pods/) 可以有**优先级**
2727
优先级表示一个 Pod 相对于其他 Pod 的重要性。
2828
如果一个 Pod 无法被调度,调度程序会尝试抢占(驱逐)较低优先级的 Pod,
2929
以使悬决 Pod 可以被调度。
@@ -62,7 +62,7 @@ To use priority and preemption:
6262
6363
Keep reading for more information about these steps.
6464
-->
65-
## 如何使用优先级和抢占
65+
## 如何使用优先级和抢占 {#how-to-use-priority-and-preemption}
6666

6767
要使用优先级和抢占:
6868

@@ -99,7 +99,7 @@ and it cannot be prefixed with `system-`.
9999
-->
100100
## PriorityClass {#priorityclass}
101101

102-
PriorityClass 是一个无名称空间对象,它定义了从优先级类名称到优先级整数值的映射。
102+
PriorityClass 是一个无命名空间对象,它定义了从优先级类名称到优先级整数值的映射。
103103
名称在 PriorityClass 对象元数据的 `name` 字段中指定。
104104
值在必填的 `value` 字段中指定。值越大,优先级越高。
105105
PriorityClass 对象的名称必须是有效的
@@ -149,7 +149,7 @@ PriorityClass 还有两个可选字段:`globalDefault` 和 `description`。
149149
deleted PriorityClass remain unchanged, but you cannot create more Pods that
150150
use the name of the deleted PriorityClass.
151151
-->
152-
### 关于 PodPriority 和现有集群的注意事项
152+
### 关于 PodPriority 和现有集群的注意事项 {#notes-about-podpriority-and-existing-clusters}
153153

154154
- 如果你升级一个已经存在的但尚未使用此特性的集群,该集群中已经存在的 Pod 的优先级等效于零。
155155

@@ -159,8 +159,10 @@ PriorityClass 还有两个可选字段:`globalDefault` 和 `description`。
159159
- 如果你删除了某个 PriorityClass 对象,则使用被删除的 PriorityClass 名称的现有 Pod 保持不变,
160160
但是你不能再创建使用已删除的 PriorityClass 名称的 Pod。
161161

162-
<!-- ### Example PriorityClass -->
163-
### PriorityClass 示例
162+
<!--
163+
### Example PriorityClass
164+
-->
165+
### PriorityClass 示例 {#example-priorityclass}
164166

165167
```yaml
166168
apiVersion: scheduling.k8s.io/v1
@@ -228,8 +230,10 @@ as soon as sufficient cluster resources "naturally" become free.
228230
设置为 `preemptionPolicy: Never` 的高优先级作业将在其他排队的 Pod 之前被调度,
229231
只要足够的集群资源“自然地”变得可用。
230232

231-
<!-- ### Example Non-preempting PriorityClass -->
232-
### 非抢占式 PriorityClass 示例
233+
<!--
234+
### Example Non-preempting PriorityClass
235+
-->
236+
### 非抢占式 PriorityClass 示例 {#example-non-preempting-priorityclass}
233237

234238
```yaml
235239
apiVersion: scheduling.k8s.io/v1
@@ -290,7 +294,7 @@ priority Pod may be scheduled sooner than Pods with lower priority if
290294
its scheduling requirements are met. If such Pod cannot be scheduled,
291295
scheduler will continue and tries to schedule other lower priority Pods.
292296
-->
293-
### Pod 优先级对调度顺序的影响
297+
### Pod 优先级对调度顺序的影响 {#effect-of-pod-priority-on-scheduling-order}
294298

295299
当启用 Pod 优先级时,调度程序会按优先级对悬决 Pod 进行排序,
296300
并且每个悬决的 Pod 会被放置在调度队列中其他优先级较低的悬决 Pod 之前。
@@ -338,7 +342,7 @@ arrives, scheduler may give Node N to the new higher priority Pod. In such a
338342
case, scheduler clears `nominatedNodeName` of Pod P. By doing this, scheduler
339343
makes Pod P eligible to preempt Pods on another Node.
340344
-->
341-
### 用户暴露的信息
345+
### 用户暴露的信息 {#user-exposed-information}
342346

343347
当 Pod P 抢占节点 N 上的一个或多个 Pod 时,
344348
Pod P 状态的 `nominatedNodeName` 字段被设置为节点 N 的名称。
@@ -372,7 +376,7 @@ point that scheduler preempts victims and the time that Pod P is scheduled. In
372376
order to minimize this gap, one can set graceful termination period of lower
373377
priority Pods to zero or a small number.
374378
-->
375-
### 抢占的限制
379+
### 抢占的限制 {#limitations-of-preemption}
376380

377381
#### 被抢占牺牲者的体面终止
378382

@@ -411,21 +415,20 @@ Kubernetes 在抢占 Pod 时支持 PDB,但对 PDB 的支持是基于尽力而
411415
A Node is considered for preemption only when the answer to this question is
412416
yes: "If all the Pods with lower priority than the pending Pod are removed from
413417
the Node, can the pending Pod be scheduled on the Node?"
418+
-->
419+
#### 与低优先级 Pod 之间的 Pod 间亲和性
420+
421+
只有当这个问题的答案是肯定的时,才考虑在一个节点上执行抢占操作:
422+
“如果从此节点上删除优先级低于悬决 Pod 的所有 Pod,悬决 Pod 是否可以在该节点上调度?”
414423

415424
{{< note >}}
425+
<!--
416426
Preemption does not necessarily remove all lower-priority
417427
Pods. If the pending Pod can be scheduled by removing fewer than all
418428
lower-priority Pods, then only a portion of the lower-priority Pods are removed.
419429
Even so, the answer to the preceding question must be yes. If the answer is no,
420430
the Node is not considered for preemption.
421-
{{< /note >}}
422431
-->
423-
#### 与低优先级 Pod 之间的 Pod 间亲和性
424-
425-
只有当这个问题的答案是肯定的时,才考虑在一个节点上执行抢占操作:
426-
“如果从此节点上删除优先级低于悬决 Pod 的所有 Pod,悬决 Pod 是否可以在该节点上调度?”
427-
428-
{{< note >}}
429432
抢占并不一定会删除所有较低优先级的 Pod。
430433
如果悬决 Pod 可以通过删除少于所有较低优先级的 Pod 来调度,
431434
那么只有一部分较低优先级的 Pod 会被删除。
@@ -500,7 +503,7 @@ enough demand and if we find an algorithm with reasonable performance.
500503
Pod priority and pre-emption can have unwanted side effects. Here are some
501504
examples of potential problems and ways to deal with them.
502505
-->
503-
## 故障排除
506+
## 故障排除 {#troubleshooting}
504507

505508
Pod 优先级和抢占可能会产生不必要的副作用。以下是一些潜在问题的示例以及处理这些问题的方法。
506509

@@ -630,7 +633,7 @@ to get evicted. The kubelet ranks pods for eviction based on the following facto
630633
1. Pod Priority
631634
1. Amount of resource usage relative to requests
632635

633-
See [evicting end-user pods](/docs/concepts/scheduling-eviction/node-pressure-eviction/#pod-selection-for-kubelet-eviction)
636+
See [Pod selection for kubelet eviction](/docs/concepts/scheduling-eviction/node-pressure-eviction/#pod-selection-for-kubelet-eviction)
634637
for more details.
635638

636639
kubelet node-pressure eviction does not evict Pods when their
@@ -656,8 +659,7 @@ kubelet 使用优先级来确定
656659
## {{% heading "whatsnext" %}}
657660

658661
<!--
659-
* Read about using ResourceQuotas in connection with PriorityClasses:
660-
[limit Priority Class consumption by default](/docs/concepts/policy/resource-quotas/#limit-priority-class-consumption-by-default)
662+
* Read about using ResourceQuotas in connection with PriorityClasses: [limit Priority Class consumption by default](/docs/concepts/policy/resource-quotas/#limit-priority-class-consumption-by-default)
661663
* Learn about [Pod Disruption](/docs/concepts/workloads/pods/disruptions/)
662664
* Learn about [API-initiated Eviction](/docs/concepts/scheduling-eviction/api-eviction/)
663665
* Learn about [Node-pressure Eviction](/docs/concepts/scheduling-eviction/node-pressure-eviction/)

0 commit comments

Comments
 (0)