Skip to content

Commit c4c7d1a

Browse files
authored
Merge pull request #51601 from windsonsea/nodesyh
[zh] Sync architecture/nodes.md
2 parents 2c6bec0 + 2a723fe commit c4c7d1a

File tree

1 file changed

+5
-113
lines changed
  • content/zh-cn/docs/concepts/architecture

1 file changed

+5
-113
lines changed

content/zh-cn/docs/concepts/architecture/nodes.md

Lines changed: 5 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ is valid. For example, if you try to create a Node from the following JSON manif
6868

6969
向 {{< glossary_tooltip text="API 服务器" term_id="kube-apiserver" >}}添加节点的方式主要有两种:
7070

71-
1. 节点上的 `kubelet` 向控制面执行自注册;
71+
1. 节点上的 kubelet 向控制面执行自注册;
7272
2. 你(或者别的什么人)手动添加一个 Node 对象。
7373

7474
在你创建了 Node {{< glossary_tooltip text="对象" term_id="object" >}}或者节点上的
75-
`kubelet` 执行了自注册操作之后,控制面会检查新的 Node 对象是否合法。
75+
kubelet 执行了自注册操作之后,控制面会检查新的 Node 对象是否合法。
7676
例如,如果你尝试使用下面的 JSON 对象来创建 Node 对象:
7777

7878
```json
@@ -95,7 +95,7 @@ field of the Node. If the node is healthy (i.e. all necessary services are runni
9595
then it is eligible to run a Pod. Otherwise, that node is ignored for any cluster activity
9696
until it becomes healthy.
9797
-->
98-
Kubernetes 会在内部创建一个 Node 对象作为节点的表示。Kubernetes 检查 `kubelet`
98+
Kubernetes 会在内部创建一个 Node 对象作为节点的表示。Kubernetes 检查 kubelet
9999
向 API 服务器注册节点时使用的 `metadata.name` 字段是否匹配。
100100
如果节点是健康的(即所有必要的服务都在运行中),则该节点可以用来运行 Pod。
101101
否则,直到该节点变为健康之前,所有的集群活动都会忽略该节点。
@@ -536,7 +536,7 @@ Kubernetes {{< glossary_tooltip text="调度器" term_id="kube-scheduler" >}}
536536
保证节点上有足够的资源供其上的所有 Pod 使用。
537537
它会检查节点上所有容器的请求的总和不会超过节点的容量。
538538
总的请求包括由 kubelet 启动的所有容器,但不包括由容器运行时直接启动的容器,
539-
也不包括不受 `kubelet` 控制的其他进程。
539+
也不包括不受 kubelet 控制的其他进程。
540540

541541
{{< note >}}
542542
<!--
@@ -562,117 +562,9 @@ See [Control Topology Management Policies on a Node](/docs/tasks/administer-clus
562562
for more information.
563563
-->
564564
如果启用了 `TopologyManager` [特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
565-
`kubelet` 可以在作出资源分配决策时使用拓扑提示。
565+
kubelet 可以在作出资源分配决策时使用拓扑提示。
566566
参考[控制节点上拓扑管理策略](/zh-cn/docs/tasks/administer-cluster/topology-manager/)了解详细信息。
567567

568-
<!--
569-
## Swap memory management {#swap-memory}
570-
-->
571-
## 交换内存(swap)管理 {#swap-memory}
572-
573-
{{< feature-state feature_gate_name="NodeSwap" >}}
574-
575-
<!--
576-
To enable swap on a node, the `NodeSwap` feature gate must be enabled on
577-
the kubelet (default is true), and the `--fail-swap-on` command line flag or `failSwapOn`
578-
[configuration setting](/docs/reference/config-api/kubelet-config.v1beta1/)
579-
must be set to false.
580-
To allow Pods to utilize swap, `swapBehavior` should not be set to `NoSwap` (which is the default behavior) in the kubelet config.
581-
-->
582-
要在节点上启用交换内存,必须启用 kubelet 的 `NodeSwap` 特性门控(默认启用),
583-
同时使用 `--fail-swap-on` 命令行参数或者将 `failSwapOn`
584-
[配置](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)设置为 false。
585-
为了允许 Pod 使用交换内存,在 kubelet 配置中不应将 `swapBehavior` 设置为 `NoSwap`(默认行为)。
586-
587-
{{< warning >}}
588-
<!--
589-
When the memory swap feature is turned on, Kubernetes data such as the content
590-
of Secret objects that were written to tmpfs now could be swapped to disk.
591-
-->
592-
当内存交换功能被启用后,Kubernetes 数据(如写入 tmpfs 的 Secret 对象的内容)可以被交换到磁盘。
593-
{{< /warning >}}
594-
595-
<!--
596-
A user can also optionally configure `memorySwap.swapBehavior` in order to
597-
specify how a node will use swap memory. For example,
598-
-->
599-
用户还可以选择配置 `memorySwap.swapBehavior` 以指定节点使用交换内存的方式。例如:
600-
601-
```yaml
602-
memorySwap:
603-
swapBehavior: LimitedSwap
604-
```
605-
606-
<!--
607-
- `NoSwap` (default): Kubernetes workloads will not use swap.
608-
- `LimitedSwap`: The utilization of swap memory by Kubernetes workloads is subject to limitations.
609-
Only Pods of Burstable QoS are permitted to employ swap.
610-
-->
611-
- `NoSwap`(默认):Kubernetes 工作负载不会使用交换内存。
612-
- `LimitedSwap`:Kubernetes 工作负载对交换内存的使用受到限制。
613-
只有具有 Burstable QoS 的 Pod 可以使用交换内存。
614-
615-
<!--
616-
If configuration for `memorySwap` is not specified and the feature gate is
617-
enabled, by default the kubelet will apply the same behaviour as the
618-
`NoSwap` setting.
619-
-->
620-
如果启用了特性门控但是未指定 `memorySwap` 的配置,默认情况下 kubelet 将使用与
621-
`NoSwap` 设置相同的行为。
622-
623-
<!--
624-
With `LimitedSwap`, Pods that do not fall under the Burstable QoS classification (i.e.
625-
`BestEffort`/`Guaranteed` Qos Pods) are prohibited from utilizing swap memory.
626-
To maintain the aforementioned security and node
627-
health guarantees, these Pods are not permitted to use swap memory when `LimitedSwap` is
628-
in effect.
629-
-->
630-
采用 `LimitedSwap` 时,不属于 Burstable QoS 分类的 Pod
631-
(即 `BestEffort`/`Guaranteed` QoS Pod)
632-
被禁止使用交换内存。为了保持上述的安全性和节点健康性保证,
633-
在 `LimitedSwap` 生效时,不允许这些 Pod 使用交换内存。
634-
635-
<!--
636-
Prior to detailing the calculation of the swap limit, it is necessary to define the following terms:
637-
* `nodeTotalMemory`: The total amount of physical memory available on the node.
638-
* `totalPodsSwapAvailable`: The total amount of swap memory on the node that is available for use by Pods (some swap memory may be reserved for system use).
639-
* `containerMemoryRequest`: The container's memory request.
640-
-->
641-
在详细介绍交换限制的计算之前,有必要定义以下术语:
642-
643-
* `nodeTotalMemory`:节点上可用的物理内存总量。
644-
* `totalPodsSwapAvailable`:节点上可供 Pod 使用的交换内存总量
645-
(一些交换内存可能被保留由系统使用)。
646-
* `containerMemoryRequest`:容器的内存请求。
647-
648-
<!--
649-
Swap limitation is configured as:
650-
`(containerMemoryRequest / nodeTotalMemory) * totalPodsSwapAvailable`.
651-
652-
It is important to note that, for containers within Burstable QoS Pods, it is possible to
653-
opt-out of swap usage by specifying memory requests that are equal to memory limits.
654-
Containers configured in this manner will not have access to swap memory.
655-
-->
656-
交换内存限制被配置为 `(containerMemoryRequest / nodeTotalMemory) * totalPodsSwapAvailable` 的值。
657-
658-
需要注意的是,位于 Burstable QoS Pod 中的容器可以通过将内存请求设置为与内存限制相同来选择不使用交换内存。
659-
以这种方式配置的容器将无法访问交换内存。
660-
661-
<!--
662-
Swap is supported only with **cgroup v2**, cgroup v1 is not supported.
663-
664-
For more information, and to assist with testing and provide feedback, please
665-
see the blog-post about [Kubernetes 1.28: NodeSwap graduates to Beta1](/blog/2023/08/24/swap-linux-beta/),
666-
[KEP-2400](https://github.com/kubernetes/enhancements/issues/4128) and its
667-
[design proposal](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2400-node-swap/README.md).
668-
-->
669-
只有 **Cgroup v2** 支持交换内存,Cgroup v1 不支持。
670-
671-
如需了解更多信息、协助测试和提交反馈,请参阅关于
672-
[Kubernetes 1.28:NodeSwap 进阶至 Beta1](/zh-cn/blog/2023/08/24/swap-linux-beta/) 的博客文章、
673-
[KEP-2400](https://github.com/kubernetes/enhancements/issues/4128)
674-
及其[设计提案](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2400-node-swap/README.md)。
675-
676568
## {{% heading "whatsnext" %}}
677569

678570
<!--

0 commit comments

Comments
 (0)