Skip to content

Commit e3771a1

Browse files
committed
[zh-cn]sync node-pressure-eviction.md
Signed-off-by: xin.li <[email protected]>
1 parent 398cc2b commit e3771a1

File tree

1 file changed

+54
-51
lines changed

1 file changed

+54
-51
lines changed

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

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,25 @@ weight: 100
1111

1212
{{<glossary_definition term_id="node-pressure-eviction" length="short">}}</br>
1313

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-
3214
<!--
3315
The {{<glossary_tooltip term_id="kubelet" text="kubelet">}} monitors resources
3416
like memory, disk space, and filesystem inodes on your cluster's nodes.
3517
When one or more of these resources reach specific consumption levels, the
3618
kubelet can proactively fail one or more pods on the node to reclaim resources
3719
and prevent starvation.
20+
-->
21+
{{<glossary_tooltip term_id="kubelet" text="kubelet">}}
22+
监控集群节点的内存、磁盘空间和文件系统的 inode 等资源。
23+
当这些资源中的一个或者多个达到特定的消耗水平,
24+
kubelet 可以主动地使节点上一个或者多个 Pod 失效,以回收资源防止饥饿。
3825

26+
<!--
3927
During a node-pressure eviction, the kubelet sets the [phase](/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase) for the
4028
selected pods to `Failed`, and terminates the Pod.
4129
4230
Node-pressure eviction is not the same as
4331
[API-initiated eviction](/docs/concepts/scheduling-eviction/api-eviction/).
4432
-->
45-
{{<glossary_tooltip term_id="kubelet" text="kubelet">}}
46-
监控集群节点的内存、磁盘空间和文件系统的 inode 等资源。
47-
当这些资源中的一个或者多个达到特定的消耗水平,
48-
kubelet 可以主动地使节点上一个或者多个 Pod 失效,以回收资源防止饥饿。
49-
5033
在节点压力驱逐期间,kubelet 将所选 Pod
5134
[阶段](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase)设置为
5235
`Failed` 并终止 Pod。
@@ -116,7 +99,7 @@ when there is resource pressure on a node.
11699
创建替代 Pod 时,kubelet 会考虑静态 Pod 的优先级。如果静态 Pod 清单指定了低优先级,
117100
并且集群的控制平面内定义了优先级更高的 Pod,并且节点面临资源压力,则 kubelet
118101
可能无法为该静态 Pod 腾出空间。
119-
即使节点上存在资源压力,kubelet 也会继续尝试运行所有静态 pod
102+
即使节点上存在资源压力,kubelet 也会继续尝试运行所有静态 Pod
120103

121104
<!--
122105
## Eviction signals and thresholds
@@ -202,12 +185,12 @@ memory is reclaimable under pressure.
202185
-->
203186
#### 内存信号 {#memory-signals}
204187

205-
在 Linux 节点上,`memory.available` 的值来自 cgroupfs,而不是像 `free -m` 这样的工具。
188+
在 Linux 节点上,`memory.available` 的值来自 CGroupFs,而不是像 `free -m` 这样的工具。
206189
这很重要,因为 `free -m` 在容器中不起作用,
207190
如果用户使用[节点可分配资源](/zh-cn/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable)这一功能特性,
208-
资源不足的判定是基于 cgroup 层次结构中的用户 Pod 所处的局部及 cgroup 根节点作出的。
191+
资源不足的判定是基于 CGroup 层次结构中的用户 Pod 所处的局部及 CGroup 根节点作出的。
209192
这个[脚本](/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)重现了
211194
kubelet 为计算 `memory.available` 而执行的相同步骤。
212195
kubelet 在其计算中排除了 inactive_file(非活动 LRU 列表上基于文件来虚拟的内存的字节数),
213196
因为它假定在压力下内存是可回收的。
@@ -218,10 +201,10 @@ memory commit levels (queried through the [`GetPerformanceInfo()`](https://learn
218201
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!
219202
-->
220203
在 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)
225208
请注意,如果节点的页面文件大小发生变化,`CommitLimit` 也会发生变化!
226209

227210
<!--
@@ -233,7 +216,17 @@ eviction signals (`<identifier>.inodesFree` or `<identifier>.available`):
233216
1. `nodefs`: The node's main filesystem, used for local disk volumes,
234217
emptyDir volumes not backed by memory, log storage, ephemeral storage,
235218
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`
236228

229+
<!--
237230
1. `imagefs`: An optional filesystem that container runtimes can use to store
238231
container images (which are the read-only layers) and container writable
239232
layers.
@@ -245,22 +238,31 @@ eviction signals (`<identifier>.inodesFree` or `<identifier>.available`):
245238
`containerfs` is used, the `imagefs` filesystem can be split to only store
246239
images (read-only layers) and nothing else.
247240
-->
248-
#### 文件系统信号 {#filesystem-signals}
249-
250-
kubelet 可识别三个可与驱逐信号一起使用的特定文件系统标识符(`<identifier>.inodesFree``<identifier>.available`):
241+
2. `imagefs`:可供容器运行时存储容器镜像(只读层)和容器可写层的可选文件系统。
251242

252-
1. `nodefs`:节点的主文件系统,用于本地磁盘卷、
253-
非内存介质的 emptyDir 卷、日志存储、临时存储等。
254-
例如,`nodefs` 包含 `/var/lib/kubelet`
255-
256-
1. `imagefs`:可供容器运行时存储容器镜像(只读层)和容器可写层的可选文件系统。
257-
258-
1. `containerfs`:可供容器运行时存储可写层的可选文件系统。
243+
3. `containerfs`:可供容器运行时存储可写层的可选文件系统。
259244
与主文件系统(参见 `nodefs`)类似,
260-
它用于存储本地磁盘卷、非内存介质的 emptyDir 卷、
245+
它用于存储本地磁盘卷、非内存介质的 `emptyDir` 卷、
261246
日志存储和临时存储,但容器镜像除外。
262247
当使用 `containerfs` 时,`imagefs` 文件系统可以分割为仅存储镜像(只读层)而不存储其他任何内容。
263248

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+
264266
<!--
265267
As such, kubelet generally allows three options for container filesystems:
266268
@@ -278,15 +280,15 @@ As such, kubelet generally allows three options for container filesystems:
278280
-->
279281
因此,kubelet 通常允许三种容器文件系统选项:
280282

281-
- 所有内容都位于单个 `nodefs` 上,也称为 rootfs 或简称为 root
283+
- 所有内容都位于单个 `nodefs` 上,也称为 `rootfs` 或简称为 `root`
282284
并且没有专用镜像文件系统。
283285

284286
- 容器存储(参见 `nodefs`)位于专用磁盘上,
285287
`imagefs`(可写和只读层)与根文件系统分开。
286288
这通常称为“分割磁盘”(或“单独磁盘”)文件系统。
287289

288290
- 容器文件系统 `containerfs`(与 `nodefs` 加上可写层相同)位于根文件系统上,
289-
容器镜像(只读层)存储在单独的 `imagefs` 上。 这通常称为“分割镜像”文件系统。
291+
容器镜像(只读层)存储在单独的 `imagefs` 上。这通常称为“分割镜像”文件系统。
290292

291293
<!--
292294
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:
316318
一些 kubelet 垃圾收集功能已被弃用,以鼓励使用驱逐机制。
317319

318320
| 现有标志 | 原因 |
319-
| ----------------------------------------- | ----------------------------------- |
321+
| ----------------------------------------- | ------------------------------------ |
320322
| `--maximum-dead-containers` | 一旦旧的日志存储在容器的上下文之外就会被弃用 |
321323
| `--maximum-dead-containers-per-container` | 一旦旧的日志存储在容器的上下文之外就会被弃用 |
322324
| `--minimum-container-ttl-duration` | 一旦旧的日志存储在容器的上下文之外就会被弃用 |
@@ -360,7 +362,7 @@ You can configure soft and hard eviction thresholds.
360362
-->
361363
例如,如果一个节点的总内存为 10GiB 并且你希望在可用内存低于 1GiB 时触发驱逐,
362364
则可以将驱逐条件定义为 `memory.available<10%`
363-
`memory.available< 1G`(你不能同时使用二者)。
365+
`memory.available<1Gi`(你不能同时使用二者)。
364366

365367
你可以配置软和硬驱逐条件。
366368

@@ -421,7 +423,7 @@ thresholds like `memory.available<1Gi`.
421423
#### 硬驱逐条件 {#hard-eviction-thresholds}
422424

423425
硬驱逐条件没有宽限期。当达到硬驱逐条件时,
424-
kubelet 会立即杀死 pod,而不会正常终止以回收紧缺的资源。
426+
kubelet 会立即杀死 Pod,而不会正常终止以回收紧缺的资源。
425427

426428
你可以使用 `eviction-hard` 标志来配置一组硬驱逐条件,
427429
例如 `memory.available<1Gi`
@@ -716,13 +718,14 @@ The kubelet sorts pods differently based on whether the node has a dedicated
716718
当 kubelet 因 inode 或 进程 ID 不足而驱逐 Pod 时,
717719
它使用 Pod 的相对优先级来确定驱逐顺序,因为 inode 和 PID 没有对应的请求字段。
718720

719-
kubelet 根据节点是否具有专用的 `imagefs` 文件系统 或者 `containerfs` 文件系统对 Pod 进行不同的排序:
721+
kubelet 根据节点是否具有专用的 `imagefs` 文件系统或者 `containerfs`
722+
文件系统对 Pod 进行不同的排序:
720723

721724
<!--
722725
#### Without `imagefs` or `containerfs` (`nodefs` and `imagefs` use the same filesystem) {#without-imagefs}
723726
724727
- 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`).
726729
727730
#### With `imagefs` (`nodefs` and `imagefs` filesystems are separate) {#with-imagefs}
728731
@@ -960,7 +963,7 @@ enough priority by specifying a suitable `priorityClassName` in the pod spec.
960963
You can also use a lower priority, or the default, to only allow pods from that
961964
DaemonSet to run when there are enough resources.
962965
-->
963-
### DaemonSets 和节点压力驱逐 {#daemonset}
966+
### DaemonSet 和节点压力驱逐 {#daemonset}
964967

965968
Pod 优先级是做出驱逐决定的主要因素。
966969
如果你不希望 kubelet 驱逐属于 DaemonSet 的 Pod,
@@ -1051,6 +1054,6 @@ to estimate or measure an optimal memory limit value for that container.
10511054
-->
10521055
- 了解 [API 发起的驱逐](/zh-cn/docs/concepts/scheduling-eviction/api-eviction/)
10531056
- 了解 [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/)
10551058
- 了解[服务质量](/zh-cn/docs/tasks/configure-pod-container/quality-service-pod/)(QoS)
10561059
- 查看[驱逐 API](/docs/reference/generated/kubernetes-api/{{<param "version">}}/#create-eviction-pod-v1-core)

0 commit comments

Comments
 (0)