Skip to content

Commit bc130d9

Browse files
committed
[zh-cn]sync manage-resources-containers assign-pod-node
Signed-off-by: xin.li <[email protected]>
1 parent 06ce4cb commit bc130d9

File tree

3 files changed

+75
-25
lines changed

3 files changed

+75
-25
lines changed

content/zh-cn/docs/concepts/configuration/manage-resources-containers.md

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,21 +211,24 @@ resource requests/limits of that type for each container in the Pod.
211211
{{< feature-state feature_gate_name="PodLevelResources" >}}
212212

213213
<!--
214-
Starting in Kubernetes 1.32, you can also specify resource requests and limits at
214+
Provided your cluster has the `PodLevelResources`
215+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) enabled,
216+
you can specify resource requests and limits at
215217
the Pod level. At Pod level, Kubernetes {{< skew currentVersion >}}
216218
only supports resource requests or limits for specific resource types: `cpu` and /
217-
or `memory`. This feature is currently in alpha and with the feature enabled,
218-
Kubernetes allows you to declare an overall resource budget for the Pod, which is
219-
especially helpful when dealing with a large number of containers where it can be
220-
difficult to accurately gauge individual resource needs. Additionally, it enables
221-
containers within a Pod to share idle resources with each other, improving resource
222-
utilization.
223-
-->
224-
从 Kubernetes 1.32 开始,你还可以在 Pod 级别指定资源请求和限制。
219+
or `memory` and / or `hugepages`. With this feature, Kubernetes allows you to declare an overall resource
220+
budget for the Pod, which is especially helpful when dealing with a large number of
221+
containers where it can be difficult to accurately gauge individual resource needs.
222+
Additionally, it enables containers within a Pod to share idle resources with each
223+
other, improving resource utilization.
224+
-->
225+
如果你的集群启用了 `PodLevelResources`
226+
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
227+
你可以在 Pod 级别指定资源请求和限制。
225228
在 Pod 级别,Kubernetes {{< skew currentVersion >}} 仅支持为特定资源类型设置资源请求或限制:
226-
`cpu` 和/或 `memory`。此特性目前处于 Alpha 阶段。在启用该特性后,Kubernetes
227-
允许你声明 Pod 的总体资源预算,这在处理大量容器时特别有用
228-
因为在这种情况下准确评估单个容器的资源需求可能会很困难
229+
`cpu` 和/或 `memory` 和/或 `hugepages`
230+
通过此特性,Kubernetes 允许你为 Pod 申领一个资源总预算
231+
这在处理大量容器时特别有用,因为在这种情况下很难准确评估各个容器的资源需求
229232
此外,它还允许 Pod 内的容器之间共享空闲资源,从而提高资源利用率。
230233

231234
<!--
@@ -235,8 +238,10 @@ For a Pod, you can specify resource limits and requests for CPU and memory by in
235238

236239
* `spec.resources.limits.cpu`
237240
* `spec.resources.limits.memory`
241+
* `spec.resources.limits.hugepages-<size>`
238242
* `spec.resources.requests.cpu`
239243
* `spec.resources.requests.memory`
244+
* `spec.resources.requests.hugepages-<size>`
240245

241246
<!--
242247
## Resource units in Kubernetes
@@ -1278,6 +1283,21 @@ extender.
12781283
}
12791284
```
12801285

1286+
<!--
1287+
#### Extended resources allocation by DRA
1288+
1289+
Extended resources allocation by DRA allows cluster administrators to specify an `extendedResourceName`
1290+
in DeviceClass, then the devices matching the DeviceClass can be requested from a pod's extended
1291+
resource requests. Read more about
1292+
[Extended Resource allocation by DRA](/docs/concepts/scheduling-eviction/dynamic-resource-allocation/#extended-resource).
1293+
-->
1294+
#### DRA 扩展资源分配
1295+
1296+
DRA 扩展资源分配允许集群管理员在 DeviceClass 中指定一个
1297+
`extendedResourceName`,然后与所指定 DeviceClass 匹配的设备可以使用
1298+
Pod 的扩展资源请求来获取。
1299+
进一步阅读关于[使用 DRA 进行扩展资源分配](/zh-cn/docs/concepts/scheduling-eviction/dynamic-resource-allocation/#extended-resource)的内容。
1300+
12811301
<!--
12821302
### Consuming extended resources
12831303

@@ -1606,6 +1626,7 @@ memory limit (and possibly request) for that container.
16061626
* Read about [project quotas](https://www.linux.org/docs/man8/xfs_quota.html) in XFS
16071627
* Read more about the [kube-scheduler configuration reference (v1)](/docs/reference/config-api/kube-scheduler-config.v1/)
16081628
* Read more about [Quality of Service classes for Pods](/docs/concepts/workloads/pods/pod-qos/)
1629+
* Read more about [Extended Resource allocation by DRA](/docs/concepts/scheduling-eviction/dynamic-resource-allocation/#extended-resource)
16091630
-->
16101631
* 获取[分配内存资源给容器和 Pod](/zh-cn/docs/tasks/configure-pod-container/assign-memory-resource/) 的实践经验
16111632
* 获取[分配 CPU 资源给容器和 Pod](/zh-cn/docs/tasks/configure-pod-container/assign-cpu-resource/) 的实践经验
@@ -1614,3 +1635,4 @@ memory limit (and possibly request) for that container.
16141635
* 阅读 XFS 中[项目配额](https://www.linux.org/docs/man8/xfs_quota.html)的文档
16151636
* 进一步阅读 [kube-scheduler 配置参考(v1)](/zh-cn/docs/reference/config-api/kube-scheduler-config.v1/)
16161637
* 进一步阅读 [Pod 的服务质量等级](/zh-cn/docs/concepts/workloads/pods/pod-qos/)
1638+
* 进一步阅读[使用 DRA 进行扩展资源分配](/zh-cn/docs/concepts/scheduling-eviction/dynamic-resource-allocation/#extended-resource)

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

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ types, then the Pod can be scheduled onto a node if one of the specified terms
290290
can be satisfied (terms are ORed).
291291
-->
292292
如果你在与 nodeAffinity 类型关联的 nodeSelectorTerms 中指定多个条件,
293-
只要其中一个 `nodeSelectorTerms` 满足(各个条件按逻辑或操作组合)的话,Pod 就可以被调度到节点上。
293+
只要其中一个 `nodeSelectorTerms` 满足(各个条件按逻辑或操作组合)的话,
294+
Pod 就可以被调度到节点上。
294295

295296
<!--
296297
If you specify multiple expressions in a single `matchExpressions` field associated with a
@@ -1150,6 +1151,44 @@ The above Pod will only run on the node `kube-01`.
11501151
-->
11511152
上面的 Pod 只能运行在节点 `kube-01` 之上。
11521153

1154+
## nominatedNodeName
1155+
1156+
{{< feature-state feature_gate_name="NominatedNodeNameForExpectation" >}}
1157+
1158+
<!--
1159+
`nominatedNodeName` can be used for external components to nominate node for a pending pod.
1160+
This nomination is best effort: it might be ignored if the scheduler determines the pod cannot go to a nominated node.
1161+
-->
1162+
外部组件可以使用 `nominatedNodeName` 为待处理的 Pod 提名节点。
1163+
这种提名是尽力而为的:如果调度器确定 Pod 不能进入被提名的节点,
1164+
那么这个提名可能会被忽略。
1165+
1166+
<!--
1167+
Also, this field can be (over)written by the scheduler:
1168+
- If the scheduler finds a node to nominate via the preemption.
1169+
- If the scheduler decides where the pod is going, and move it to the binding cycle.
1170+
- Note that, in this case, `nominatedNodeName` is put only when the pod has to go through `WaitOnPermit` or `PreBind` extension points.
1171+
1172+
Here is an example of a Pod status using the `nominatedNodeName` field:
1173+
-->
1174+
此外,此字段可以由调度器(重新)写入:
1175+
- 如果调度器通过抢占找到一个可提名的节点。
1176+
- 如果调度器决定了 Pod 的去向,并将其移至绑定阶段。
1177+
- 注意,在这种情况下,仅当 Pod 必须经过 `WaitOnPermit` 或
1178+
`PreBind` 扩展点时,才会设置 `nominatedNodeName`。
1179+
1180+
以下是使用 `nominatedNodeName` 字段的 Pod 状态示例:
1181+
1182+
```yaml
1183+
apiVersion: v1
1184+
kind: Pod
1185+
metadata:
1186+
name: nginx
1187+
...
1188+
status:
1189+
nominatedNodeName: kube-01
1190+
```
1191+
11531192
<!--
11541193
## Pod topology spread constraints
11551194

content/zh-cn/docs/concepts/scheduling-eviction/scheduling-framework.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Pod。实现 PreEnqueue、PreFilter、Filter、Reserve 或 Permit 的插件应
141141

142142
### QueueingHint
143143

144-
{{< feature-state for_k8s_version="v1.32" state="beta" >}}
144+
{{< feature-state feature_gate_name="SchedulerQueueingHints" >}}
145145

146146
<!--
147147
QueueingHint is a callback function for deciding whether a Pod can be requeued to the active queue or backoff queue.
@@ -155,17 +155,6 @@ QueueingHint 作为一个回调函数,用于决定是否将 Pod 重新排队
155155
当 QueueingHint 发现事件可能使 Pod 可调度时,Pod 将被放入活跃队列或回退队列,
156156
以便调度器可以重新尝试调度 Pod。
157157

158-
{{< note >}}
159-
<!--
160-
In Kubernetes {{< skew currentVersion >}}, this feature gate is enabled by default,
161-
and you can disable it via the
162-
`SchedulerQueueingHints` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/).
163-
-->
164-
在 Kubernetes 的 {{< skew currentVersion >}} 版本中,此特性门控默认启用,
165-
你可以通过 `SchedulerQueueingHints`
166-
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)来禁用它。
167-
{{< /note >}}
168-
169158
<!--
170159
### QueueSort {#queue-sort}
171160
-->

0 commit comments

Comments
 (0)