You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
40
33
41
-
42
-
43
34
<!-- steps -->
44
35
45
36
<!--
@@ -51,49 +42,51 @@ the workload can move to different CPU cores depending on
51
42
whether the pod is throttled and which CPU cores are available at
52
43
scheduling time. Many workloads are not sensitive to this migration and thus
53
44
work fine without any intervention.
54
-
--->
45
+
-->
55
46
## CPU 管理策略
56
47
57
-
默认情况下,kubelet 使用 [CFS 配额](https://en.wikipedia.org/wiki/Completely_Fair_Scheduler) 来执行 pod 的 CPU 约束。当节点上运行了很多 CPU 密集的 pod 时,工作负载可能会迁移到不同的 CPU 核,这取决于调度时 pod 是否被扼制,以及哪些 CPU 核是可用的。许多工作负载对这种迁移不敏感,因此无需任何干预即可正常工作。
The `static` policy allows containers in `Guaranteed` pods with integer CPU
115
110
`requests` access to exclusive CPUs on the node. This exclusivity is enforced
116
111
using the [cpuset cgroup controller](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt).
117
-
--->
118
-
### Static 策略
112
+
-->
113
+
### static 策略
119
114
120
-
`static` 策略针对具有整数型 CPU `requests` 的 `Guaranteed` pod ,它允许该类 pod 中的容器访问节点上的独占 CPU 资源。这种独占性是使用 [cpuset cgroup 控制器](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) 来实现的。
115
+
`static` 策略针对具有整数型 CPU `requests` 的 `Guaranteed` Pod ,它允许该类 Pod
System services such as the container runtime and the kubelet itself can continue to run on these exclusive CPUs. The exclusivity only extends to other pods.
125
-
{{< /note >}}
126
-
--->
121
+
-->
127
122
{{< note >}}
128
-
诸如容器运行时和 kubelet 本身的系统服务可以继续在这些独占 CPU 上运行。独占性仅针对其他 pod。
123
+
诸如容器运行时和 kubelet 本身的系统服务可以继续在这些独占 CPU 上运行。独占性仅针对其他 Pod。
129
124
{{< /note >}}
130
125
131
126
<!--
132
-
{{< note >}}
133
-
The alpha version of this policy does not guarantee static
134
-
exclusive allocations across Kubelet restarts.
135
-
{{< /note >}}
136
-
--->
137
-
{{< note >}}
138
-
该策略的 alpha 版本不保证 Kubelet 重启前后的静态独占性分配。
139
-
{{< /note >}}
140
-
141
-
<!--
142
-
{{< note >}}
143
127
CPU Manager doesn't support offlining and onlining of
144
128
CPUs at runtime. Also, if the set of online CPUs changes on the node,
145
129
the node must be drained and CPU manager manually reset by deleting the
146
130
state file `cpu_manager_state` in the kubelet root directory.
147
-
{{< /note >}}
148
-
--->
131
+
-->
149
132
{{< note >}}
150
-
CPU 管理器不支持运行时下线和上线 CPUs。此外,如果节点上的在线 CPUs 集合发生变化,则必须驱逐节点上的 pods,并通过删除 kubelet 根目录中的状态文件 `cpu_manager_state` 来手动重置 CPU 管理器。
@@ -194,8 +179,12 @@ affinity and decreases context switches due to throttling for the CPU-bound
194
179
workload.
195
180
196
181
Consider the containers in the following pod specs:
197
-
--->
198
-
当 `Guaranteed` pod 调度到节点上时,如果其容器符合静态分配要求,相应的 CPU 会被从共享池中移除,并放置到容器的 cpuset 中。因为这些容器所使用的 CPU 受到调度域本身的限制,所以不需要使用 CFS 配额来进行 CPU 的绑定。换言之,容器 cpuset 中的 CPU 数量与 pod 规格中指定的整数型 CPU `limit` 相等。这种静态分配增强了 CPU 亲和性,减少了 CPU 密集的工作负载在节流时引起的上下文切换。
182
+
-->
183
+
当 `Guaranteed` Pod 调度到节点上时,如果其容器符合静态分配要求,
184
+
相应的 CPU 会被从共享池中移除,并放置到容器的 cpuset 中。
185
+
因为这些容器所使用的 CPU 受到调度域本身的限制,所以不需要使用 CFS 配额来进行 CPU 的绑定。
186
+
换言之,容器 cpuset 中的 CPU 数量与 Pod 规约中指定的整数型 CPU `limit` 相等。
187
+
这种静态分配增强了 CPU 亲和性,减少了 CPU 密集的工作负载在节流时引起的上下文切换。
199
188
200
189
考虑以下 Pod 规格的容器:
201
190
@@ -209,8 +198,9 @@ spec:
209
198
<!--
210
199
This pod runs in the `BestEffort` QoS class because no resource `requests` or
211
200
`limits`are specified. It runs in the shared pool.
212
-
--->
213
-
该 pod 属于 `BestEffort` QoS 类型,因为其未指定 `requests` 或 `limits` 值。 所以该容器运行在共享 CPU 池中。
201
+
-->
202
+
该 Pod 属于 `BestEffort` QoS 类型,因为其未指定 `requests` 或 `limits` 值。
203
+
所以该容器运行在共享 CPU 池中。
214
204
215
205
```yaml
216
206
spec:
@@ -228,8 +218,9 @@ spec:
228
218
This pod runs in the `Burstable` QoS class because resource `requests` do not
229
219
equal `limits` and the `cpu` quantity is not specified. It runs in the shared
230
220
pool.
231
-
--->
232
-
该 pod 属于 `Burstable` QoS 类型,因为其资源 `requests` 不等于 `limits`, 且未指定 `cpu` 数量。所以该容器运行在共享 CPU 池中。
0 commit comments