@@ -11,42 +11,25 @@ weight: 100
11
11
12
12
{{<glossary_definition term_id="node-pressure-eviction" length="short">}}</br >
13
13
14
- {{<note >}}
15
- {{< feature-state feature_gate_name="KubeletSeparateDiskGC" >}}
16
- <!--
17
- {{< feature-state feature_gate_name="KubeletSeparateDiskGC" >}}
18
- The _split image filesystem_ feature, which enables support for the `containerfs`
19
- filesystem, adds several new eviction signals, thresholds and metrics. To use
20
- `containerfs`, the Kubernetes release v{{< skew currentVersion >}} requires the
21
- `KubeletSeparateDiskGC` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
22
- to be enabled. Currently, only CRI-O (v1.29 or higher) offers the `containerfs`
23
- filesystem support.
24
- -->
25
- {{< feature-state feature_gate_name="KubeletSeparateDiskGC" >}}
26
- ** 拆分镜像文件系统** 功能支持 ` containerfs ` 文件系统,并增加了几个新的驱逐信号、阈值和指标。
27
- 要使用 ` containerfs ` ,Kubernetes 版本 v{{< skew currentVersion >}} 需要启用 ` KubeletSeparateDiskGC `
28
- [ 特性门控] ( /zh-cn/docs/reference/command-line-tools-reference/feature-gates/ ) 。
29
- 目前,只有 CRI-O(v1.29 或更高版本)提供对 ` containerfs ` 文件系统的支持。
30
- {{</note >}}
31
-
32
14
<!--
33
15
The {{<glossary_tooltip term_id="kubelet" text="kubelet">}} monitors resources
34
16
like memory, disk space, and filesystem inodes on your cluster's nodes.
35
17
When one or more of these resources reach specific consumption levels, the
36
18
kubelet can proactively fail one or more pods on the node to reclaim resources
37
19
and prevent starvation.
20
+ -->
21
+ {{<glossary_tooltip term_id="kubelet" text="kubelet">}}
22
+ 监控集群节点的内存、磁盘空间和文件系统的 inode 等资源。
23
+ 当这些资源中的一个或者多个达到特定的消耗水平,
24
+ kubelet 可以主动地使节点上一个或者多个 Pod 失效,以回收资源防止饥饿。
38
25
26
+ <!--
39
27
During a node-pressure eviction, the kubelet sets the [phase](/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase) for the
40
28
selected pods to `Failed`, and terminates the Pod.
41
29
42
30
Node-pressure eviction is not the same as
43
31
[API-initiated eviction](/docs/concepts/scheduling-eviction/api-eviction/).
44
32
-->
45
- {{<glossary_tooltip term_id="kubelet" text="kubelet">}}
46
- 监控集群节点的内存、磁盘空间和文件系统的 inode 等资源。
47
- 当这些资源中的一个或者多个达到特定的消耗水平,
48
- kubelet 可以主动地使节点上一个或者多个 Pod 失效,以回收资源防止饥饿。
49
-
50
33
在节点压力驱逐期间,kubelet 将所选 Pod
51
34
的[ 阶段] ( /zh-cn/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase ) 设置为
52
35
` Failed ` 并终止 Pod。
@@ -116,7 +99,7 @@ when there is resource pressure on a node.
116
99
创建替代 Pod 时,kubelet 会考虑静态 Pod 的优先级。如果静态 Pod 清单指定了低优先级,
117
100
并且集群的控制平面内定义了优先级更高的 Pod,并且节点面临资源压力,则 kubelet
118
101
可能无法为该静态 Pod 腾出空间。
119
- 即使节点上存在资源压力,kubelet 也会继续尝试运行所有静态 pod 。
102
+ 即使节点上存在资源压力,kubelet 也会继续尝试运行所有静态 Pod 。
120
103
121
104
<!--
122
105
## Eviction signals and thresholds
@@ -202,12 +185,12 @@ memory is reclaimable under pressure.
202
185
-->
203
186
#### 内存信号 {#memory-signals}
204
187
205
- 在 Linux 节点上,` memory.available ` 的值来自 cgroupfs ,而不是像 ` free -m ` 这样的工具。
188
+ 在 Linux 节点上,` memory.available ` 的值来自 CGroupFs ,而不是像 ` free -m ` 这样的工具。
206
189
这很重要,因为 ` free -m ` 在容器中不起作用,
207
190
如果用户使用[ 节点可分配资源] ( /zh-cn/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable ) 这一功能特性,
208
- 资源不足的判定是基于 cgroup 层次结构中的用户 Pod 所处的局部及 cgroup 根节点作出的。
191
+ 资源不足的判定是基于 CGroup 层次结构中的用户 Pod 所处的局部及 CGroup 根节点作出的。
209
192
这个[ 脚本] ( /zh-cn/examples/admin/resource/memory-available.sh ) 或者
210
- [ cgroupv2 脚本] ( /zh-cn/examples/admin/resource/memory-available-cgroupv2.sh ) 重现了
193
+ [ CGroupv2 脚本] ( /zh-cn/examples/admin/resource/memory-available-cgroupv2.sh ) 重现了
211
194
kubelet 为计算 ` memory.available ` 而执行的相同步骤。
212
195
kubelet 在其计算中排除了 inactive_file(非活动 LRU 列表上基于文件来虚拟的内存的字节数),
213
196
因为它假定在压力下内存是可回收的。
@@ -218,10 +201,10 @@ memory commit levels (queried through the [`GetPerformanceInfo()`](https://learn
218
201
system call) by subtracting the node's global [`CommitTotal`](https://learn.microsoft.com/windows/win32/api/psapi/ns-psapi-performance_information) from the node's [`CommitLimit`](https://learn.microsoft.com/windows/win32/api/psapi/ns-psapi-performance_information). Please note that `CommitLimit` can change if the node's page-file size changes!
219
202
-->
220
203
在 Windows 节点上,` memory.available ` 的值来自节点的全局内存提交级别
221
- (通过 [ ` GetPerformanceInfo() ` ] ( https://learn.microsoft.com/windows/win32/api/psapi/nf-psapi-getperformanceinfo ) 系统调用查询),
222
- 方法是从节点的 [ ` CommitLimit ` ] ( https://learn.microsoft.com/windows/win32/api/psapi/ns-psapi-performance_information )
223
- 减去节点的全局
224
- [ ` CommitTotal ` ] ( https://learn.microsoft.com/windows/win32/api/psapi/ns-psapi-performance_information ) 。
204
+ (通过 [ ` GetPerformanceInfo() ` ] ( https://learn.microsoft.com/windows/win32/api/psapi/nf-psapi-getperformanceinfo )
205
+ 系统调用查询), 方法是从节点的
206
+ [ ` CommitLimit ` ] ( https://learn.microsoft.com/windows/win32/api/psapi/ns-psapi-performance_information )
207
+ 减去节点的全局 [ ` CommitTotal ` ] ( https://learn.microsoft.com/windows/win32/api/psapi/ns-psapi-performance_information ) 。
225
208
请注意,如果节点的页面文件大小发生变化,` CommitLimit ` 也会发生变化!
226
209
227
210
<!--
@@ -233,7 +216,17 @@ eviction signals (`<identifier>.inodesFree` or `<identifier>.available`):
233
216
1. `nodefs`: The node's main filesystem, used for local disk volumes,
234
217
emptyDir volumes not backed by memory, log storage, ephemeral storage,
235
218
and more. For example, `nodefs` contains `/var/lib/kubelet`.
219
+ -->
220
+ #### 文件系统信号 {#filesystem-signals}
221
+
222
+ kubelet 可识别三个可与驱逐信号一起使用的特定文件系统标识符(` <identifier>.inodesFree ` 或
223
+ ` <identifier>.available ` ):
224
+
225
+ 1 . ` nodefs ` :节点的主文件系统,用于本地磁盘卷、
226
+ 非内存介质的 ` emptyDir ` 卷、日志存储、临时存储等。
227
+ 例如,` nodefs ` 包含 ` /var/lib/kubelet ` 。
236
228
229
+ <!--
237
230
1. `imagefs`: An optional filesystem that container runtimes can use to store
238
231
container images (which are the read-only layers) and container writable
239
232
layers.
@@ -245,22 +238,31 @@ eviction signals (`<identifier>.inodesFree` or `<identifier>.available`):
245
238
`containerfs` is used, the `imagefs` filesystem can be split to only store
246
239
images (read-only layers) and nothing else.
247
240
-->
248
- #### 文件系统信号 {#filesystem-signals}
249
-
250
- kubelet 可识别三个可与驱逐信号一起使用的特定文件系统标识符(` <identifier>.inodesFree ` 或 ` <identifier>.available ` ):
241
+ 2 . ` imagefs ` :可供容器运行时存储容器镜像(只读层)和容器可写层的可选文件系统。
251
242
252
- 1 . ` nodefs ` :节点的主文件系统,用于本地磁盘卷、
253
- 非内存介质的 emptyDir 卷、日志存储、临时存储等。
254
- 例如,` nodefs ` 包含 ` /var/lib/kubelet ` 。
255
-
256
- 1 . ` imagefs ` :可供容器运行时存储容器镜像(只读层)和容器可写层的可选文件系统。
257
-
258
- 1 . ` containerfs ` :可供容器运行时存储可写层的可选文件系统。
243
+ 3 . ` containerfs ` :可供容器运行时存储可写层的可选文件系统。
259
244
与主文件系统(参见 ` nodefs ` )类似,
260
- 它用于存储本地磁盘卷、非内存介质的 emptyDir 卷、
245
+ 它用于存储本地磁盘卷、非内存介质的 ` emptyDir ` 卷、
261
246
日志存储和临时存储,但容器镜像除外。
262
247
当使用 ` containerfs ` 时,` imagefs ` 文件系统可以分割为仅存储镜像(只读层)而不存储其他任何内容。
263
248
249
+ {{<note >}}
250
+ <!--
251
+ {{< feature-state feature_gate_name="KubeletSeparateDiskGC" >}}
252
+ The _split image filesystem_ feature, which enables support for the `containerfs`
253
+ filesystem, adds several new eviction signals, thresholds and metrics. To use
254
+ `containerfs`, the Kubernetes release v{{< skew currentVersion >}} requires the
255
+ `KubeletSeparateDiskGC` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
256
+ to be enabled. Currently, only CRI-O (v1.29 or higher) offers the `containerfs`
257
+ filesystem support.
258
+ -->
259
+ {{< feature-state feature_gate_name="KubeletSeparateDiskGC" >}}
260
+ ** 拆分镜像文件系统** 功能支持 ` containerfs ` 文件系统,并增加了几个新的驱逐信号、阈值和指标。
261
+ 要使用 ` containerfs ` ,Kubernetes 版本 v{{< skew currentVersion >}} 需要启用 ` KubeletSeparateDiskGC `
262
+ [ 特性门控] ( /zh-cn/docs/reference/command-line-tools-reference/feature-gates/ ) 。
263
+ 目前,只有 CRI-O(v1.29 或更高版本)提供对 ` containerfs ` 文件系统的支持。
264
+ {{</note >}}
265
+
264
266
<!--
265
267
As such, kubelet generally allows three options for container filesystems:
266
268
@@ -278,15 +280,15 @@ As such, kubelet generally allows three options for container filesystems:
278
280
-->
279
281
因此,kubelet 通常允许三种容器文件系统选项:
280
282
281
- - 所有内容都位于单个 ` nodefs ` 上,也称为 “ rootfs” 或简称为 “ root” ,
283
+ - 所有内容都位于单个 ` nodefs ` 上,也称为 ` rootfs ` 或简称为 ` root ` ,
282
284
并且没有专用镜像文件系统。
283
285
284
286
- 容器存储(参见 ` nodefs ` )位于专用磁盘上,
285
287
而 ` imagefs ` (可写和只读层)与根文件系统分开。
286
288
这通常称为“分割磁盘”(或“单独磁盘”)文件系统。
287
289
288
290
- 容器文件系统 ` containerfs ` (与 ` nodefs ` 加上可写层相同)位于根文件系统上,
289
- 容器镜像(只读层)存储在单独的 ` imagefs ` 上。 这通常称为“分割镜像”文件系统。
291
+ 容器镜像(只读层)存储在单独的 ` imagefs ` 上。这通常称为“分割镜像”文件系统。
290
292
291
293
<!--
292
294
The kubelet will attempt to auto-discover these filesystems with their current
@@ -316,7 +318,7 @@ Some kubelet garbage collection features are deprecated in favor of eviction:
316
318
一些 kubelet 垃圾收集功能已被弃用,以鼓励使用驱逐机制。
317
319
318
320
| 现有标志 | 原因 |
319
- | ----------------------------------------- | ----------------------------------- |
321
+ | ----------------------------------------- | - ----------------------------------- |
320
322
| ` --maximum-dead-containers ` | 一旦旧的日志存储在容器的上下文之外就会被弃用 |
321
323
| ` --maximum-dead-containers-per-container ` | 一旦旧的日志存储在容器的上下文之外就会被弃用 |
322
324
| ` --minimum-container-ttl-duration ` | 一旦旧的日志存储在容器的上下文之外就会被弃用 |
@@ -360,7 +362,7 @@ You can configure soft and hard eviction thresholds.
360
362
-->
361
363
例如,如果一个节点的总内存为 10GiB 并且你希望在可用内存低于 1GiB 时触发驱逐,
362
364
则可以将驱逐条件定义为 ` memory.available<10% ` 或
363
- ` memory.available< 1G ` (你不能同时使用二者)。
365
+ ` memory.available<1Gi ` (你不能同时使用二者)。
364
366
365
367
你可以配置软和硬驱逐条件。
366
368
@@ -421,7 +423,7 @@ thresholds like `memory.available<1Gi`.
421
423
#### 硬驱逐条件 {#hard-eviction-thresholds}
422
424
423
425
硬驱逐条件没有宽限期。当达到硬驱逐条件时,
424
- kubelet 会立即杀死 pod ,而不会正常终止以回收紧缺的资源。
426
+ kubelet 会立即杀死 Pod ,而不会正常终止以回收紧缺的资源。
425
427
426
428
你可以使用 ` eviction-hard ` 标志来配置一组硬驱逐条件,
427
429
例如 ` memory.available<1Gi ` 。
@@ -716,13 +718,14 @@ The kubelet sorts pods differently based on whether the node has a dedicated
716
718
当 kubelet 因 inode 或 进程 ID 不足而驱逐 Pod 时,
717
719
它使用 Pod 的相对优先级来确定驱逐顺序,因为 inode 和 PID 没有对应的请求字段。
718
720
719
- kubelet 根据节点是否具有专用的 ` imagefs ` 文件系统 或者 ` containerfs ` 文件系统对 Pod 进行不同的排序:
721
+ kubelet 根据节点是否具有专用的 ` imagefs ` 文件系统或者 ` containerfs `
722
+ 文件系统对 Pod 进行不同的排序:
720
723
721
724
<!--
722
725
#### Without `imagefs` or `containerfs` (`nodefs` and `imagefs` use the same filesystem) {#without-imagefs}
723
726
724
727
- If `nodefs` triggers evictions, the kubelet sorts pods based on their
725
- total disk usage (`local volumes + logs and a writable layer of all containers`).
728
+ total disk usage (`local volumes + logs ** and** a writable layer of all containers`).
726
729
727
730
#### With `imagefs` (`nodefs` and `imagefs` filesystems are separate) {#with-imagefs}
728
731
@@ -960,7 +963,7 @@ enough priority by specifying a suitable `priorityClassName` in the pod spec.
960
963
You can also use a lower priority, or the default, to only allow pods from that
961
964
DaemonSet to run when there are enough resources.
962
965
-->
963
- # ## DaemonSets 和节点压力驱逐 {#daemonset}
966
+ # ## DaemonSet 和节点压力驱逐 {#daemonset}
964
967
965
968
Pod 优先级是做出驱逐决定的主要因素。
966
969
如果你不希望 kubelet 驱逐属于 DaemonSet 的 Pod,
@@ -1051,6 +1054,6 @@ to estimate or measure an optimal memory limit value for that container.
1051
1054
-->
1052
1055
- 了解 [API 发起的驱逐](/zh-cn/docs/concepts/scheduling-eviction/api-eviction/)
1053
1056
- 了解 [Pod 优先级和抢占](/zh-cn/docs/concepts/scheduling-eviction/pod-priority-preemption/)
1054
- - 了解 [PodDisruptionBudgets ](/zh-cn/docs/tasks/run-application/configure-pdb/)
1057
+ - 了解 [PodDisruptionBudget ](/zh-cn/docs/tasks/run-application/configure-pdb/)
1055
1058
- 了解[服务质量](/zh-cn/docs/tasks/configure-pod-container/quality-service-pod/)(QoS)
1056
1059
- 查看[驱逐 API](/docs/reference/generated/kubernetes-api/{{<param "version">}}/#create-eviction-pod-v1-core)
0 commit comments