Skip to content

Commit 945ff45

Browse files
committed
[zh-cn] sync architecture/nodes.md
Signed-off-by: xin.li <[email protected]>
1 parent d68b5e9 commit 945ff45

File tree

1 file changed

+75
-30
lines changed
  • content/zh-cn/docs/concepts/architecture

1 file changed

+75
-30
lines changed

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

Lines changed: 75 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ first and re-added after the update.
138138
### Self-registration of Nodes
139139
140140
When the kubelet flag `--register-node` is true (the default), the kubelet will attempt to
141-
register itself with the API server. This is the preferred pattern, used by most distros.
141+
register itself with the API server. This is the preferred pattern, used by most distros.
142142
143143
For self-registration, the kubelet is started with the following options:
144144
-->
@@ -219,7 +219,7 @@ Pods already scheduled on the Node may misbehave or cause issues if the Node
219219
configuration will be changed on kubelet restart. For example, already running
220220
Pod may be tainted against the new labels assigned to the Node, while other
221221
Pods, that are incompatible with that Pod will be scheduled based on this new
222-
label. Node re-registration ensures all Pods will be drained and properly
222+
label. Node re-registration ensures all Pods will be drained and properly
223223
re-scheduled.
224224
-->
225225
如果在 kubelet 重启期间 Node 配置发生了变化,已经被调度到某 Node 上的 Pod
@@ -409,9 +409,9 @@ of the Node resource. For example, the following JSON structure describes a heal
409409
<!--
410410
When problems occur on nodes, the Kubernetes control plane automatically creates
411411
[taints](/docs/concepts/scheduling-eviction/taint-and-toleration/) that match the conditions
412-
affecting the node. An example of this is when the `status` of the Ready condition
412+
affecting the node. An example of this is when the `status` of the Ready condition
413413
remains `Unknown` or `False` for longer than the kube-controller-manager's `NodeMonitorGracePeriod`,
414-
which defaults to 40 seconds. This will cause either an `node.kubernetes.io/unreachable` taint, for an `Unknown` status,
414+
which defaults to 40 seconds. This will cause either an `node.kubernetes.io/unreachable` taint, for an `Unknown` status,
415415
or a `node.kubernetes.io/not-ready` taint, for a `False` status, to be added to the Node.
416416
-->
417417
当节点上出现问题时,Kubernetes 控制面会自动创建与影响节点的状况对应的
@@ -643,7 +643,7 @@ then the eviction mechanism does not take per-zone unavailability into account.
643643
A key reason for spreading your nodes across availability zones is so that the
644644
workload can be shifted to healthy zones when one entire zone goes down.
645645
Therefore, if all nodes in a zone are unhealthy, then the node controller evicts at
646-
the normal rate of `--node-eviction-rate`. The corner case is when all zones are
646+
the normal rate of `--node-eviction-rate`. The corner case is when all zones are
647647
completely unhealthy (none of the nodes in the cluster are healthy). In such a
648648
case, the node controller assumes that there is some problem with connectivity
649649
between the control plane and the nodes, and doesn't perform any evictions.
@@ -740,12 +740,14 @@ The kubelet attempts to detect node system shutdown and terminates pods running
740740
741741
Kubelet ensures that pods follow the normal
742742
[pod termination process](/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)
743-
during the node shutdown.
743+
during the node shutdown. During node shutdown, the kubelet does not accept new
744+
Pods (even if those Pods are already bound to the node).
744745
-->
745746
kubelet 会尝试检测节点系统关闭事件并终止在节点上运行的所有 Pod。
746747

747748
在节点终止期间,kubelet 保证 Pod 遵从常规的
748-
[Pod 终止流程](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)
749+
[Pod 终止流程](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)
750+
且不接受新的 Pod(即使这些 Pod 已经绑定到该节点)。
749751

750752
<!--
751753
The Graceful node shutdown feature depends on systemd since it takes advantage of
@@ -776,6 +778,36 @@ set to non-zero values.
776778
`shutdownGracePeriodCriticalPods` 都是被设置为 0 的,因此不会激活节点体面关闭功能。
777779
要激活此功能特性,这两个 kubelet 配置选项要适当配置,并设置为非零值。
778780

781+
<!--
782+
Once systemd detects or notifies node shutdown, the kubelet sets a `NotReady` condition on
783+
the Node, with the `reason` set to `"node is shutting down"`. The kube-scheduler honors this condition
784+
and does not schedule any Pods onto the affected node; other third-party schedulers are
785+
expected to follow the same logic. This means that new Pods won't be scheduled onto that node
786+
and therefore none will start.
787+
-->
788+
一旦 systemd 检测到或通知节点关闭,kubelet 就会在节点上设置一个
789+
`NotReady` 状况,并将 `reason` 设置为 `"node is shutting down"`
790+
kube-scheduler 会重视此状况,不将 Pod 调度到受影响的节点上;
791+
其他第三方调度程序也应当遵循相同的逻辑。这意味着新的 Pod 不会被调度到该节点上,
792+
因此不会有新 Pod 启动。
793+
794+
<!--
795+
The kubelet **also** rejects Pods during the `PodAdmission` phase if an ongoing
796+
node shutdown has been detected, so that even Pods with a
797+
{{< glossary_tooltip text="toleration" term_id="toleration" >}} for
798+
`node.kubernetes.io/not-ready:NoSchedule` do not start there.
799+
-->
800+
如果检测到节点关闭过程正在进行中,kubelet **也会**`PodAdmission`
801+
阶段拒绝 Pod,即使是该 Pod 带有 `node.kubernetes.io/not-ready:NoSchedule`
802+
的{{< glossary_tooltip text="容忍度" term_id="toleration" >}}。
803+
804+
<!--
805+
At the same time when kubelet is setting that condition on its Node via the API, the kubelet also begins
806+
terminating any Pods that are running locally.
807+
-->
808+
同时,当 kubelet 通过 API 在其 Node 上设置该状况时,kubelet
809+
也开始终止在本地运行的所有 Pod。
810+
779811
<!--
780812
During a graceful shutdown, kubelet terminates pods in two phases:
781813
@@ -810,6 +842,19 @@ Graceful node shutdown feature is configured with two
810842
* 在节点关闭期间指定用于终止[关键 Pod](/zh-cn/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical)
811843
的持续时间。该值应小于 `shutdownGracePeriod`
812844

845+
{{< note >}}
846+
<!--
847+
There are cases when Node termination was cancelled by the system (or perhaps manually
848+
by an administrator). In either of those situations the
849+
Node will return to the `Ready` state. However Pods which already started the process
850+
of termination
851+
will not be restored by kubelet and will need to be re-scheduled.
852+
-->
853+
在某些情况下,节点终止过程会被系统取消(或者可能由管理员手动取消)。
854+
无论哪种情况下,节点都将返回到 `Ready` 状态。然而,已经开始终止进程的
855+
Pod 将不会被 kubelet 恢复,需要被重新调度。
856+
{{< /note >}}
857+
813858
<!--
814859
For example, if `shutdownGracePeriod=30s`, and
815860
`shutdownGracePeriodCriticalPods=10s`, kubelet will delay the node shutdown by
@@ -1007,10 +1052,10 @@ kubelet 子系统中会生成 `graceful_shutdown_start_time_seconds` 和
10071052
{{< feature-state state="beta" for_k8s_version="v1.26" >}}
10081053

10091054
<!--
1010-
A node shutdown action may not be detected by kubelet's Node Shutdown Manager,
1011-
either because the command does not trigger the inhibitor locks mechanism used by
1012-
kubelet or because of a user error, i.e., the ShutdownGracePeriod and
1013-
ShutdownGracePeriodCriticalPods are not configured properly. Please refer to above
1055+
A node shutdown action may not be detected by kubelet's Node Shutdown Manager,
1056+
either because the command does not trigger the inhibitor locks mechanism used by
1057+
kubelet or because of a user error, i.e., the ShutdownGracePeriod and
1058+
ShutdownGracePeriodCriticalPods are not configured properly. Please refer to above
10141059
section [Graceful Node Shutdown](#graceful-node-shutdown) for more details.
10151060
-->
10161061
节点关闭的操作可能无法被 kubelet 的节点关闭管理器检测到,
@@ -1019,15 +1064,15 @@ section [Graceful Node Shutdown](#graceful-node-shutdown) for more details.
10191064
请参考以上[节点体面关闭](#graceful-node-shutdown)部分了解更多详细信息。
10201065

10211066
<!--
1022-
When a node is shutdown but not detected by kubelet's Node Shutdown Manager, the pods
1023-
that are part of a {{< glossary_tooltip text="StatefulSet" term_id="statefulset" >}} will be stuck in terminating status on
1024-
the shutdown node and cannot move to a new running node. This is because kubelet on
1025-
the shutdown node is not available to delete the pods so the StatefulSet cannot
1026-
create a new pod with the same name. If there are volumes used by the pods, the
1027-
VolumeAttachments will not be deleted from the original shutdown node so the volumes
1028-
used by these pods cannot be attached to a new running node. As a result, the
1029-
application running on the StatefulSet cannot function properly. If the original
1030-
shutdown node comes up, the pods will be deleted by kubelet and new pods will be
1067+
When a node is shutdown but not detected by kubelet's Node Shutdown Manager, the pods
1068+
that are part of a {{< glossary_tooltip text="StatefulSet" term_id="statefulset" >}} will be stuck in terminating status on
1069+
the shutdown node and cannot move to a new running node. This is because kubelet on
1070+
the shutdown node is not available to delete the pods so the StatefulSet cannot
1071+
create a new pod with the same name. If there are volumes used by the pods, the
1072+
VolumeAttachments will not be deleted from the original shutdown node so the volumes
1073+
used by these pods cannot be attached to a new running node. As a result, the
1074+
application running on the StatefulSet cannot function properly. If the original
1075+
shutdown node comes up, the pods will be deleted by kubelet and new pods will be
10311076
created on a different running node. If the original shutdown node does not come up,
10321077
these pods will be stuck in terminating status on the shutdown node forever.
10331078
-->
@@ -1043,13 +1088,13 @@ these pods will be stuck in terminating status on the shutdown node forever.
10431088
如果原来的已关闭节点没有被恢复,那些在已关闭节点上的 Pod 将永远滞留在终止状态。
10441089

10451090
<!--
1046-
To mitigate the above situation, a user can manually add the taint `node.kubernetes.io/out-of-service` with either `NoExecute`
1047-
or `NoSchedule` effect to a Node marking it out-of-service.
1091+
To mitigate the above situation, a user can manually add the taint `node.kubernetes.io/out-of-service` with either `NoExecute`
1092+
or `NoSchedule` effect to a Node marking it out-of-service.
10481093
If the `NodeOutOfServiceVolumeDetach`[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
10491094
is enabled on {{< glossary_tooltip text="kube-controller-manager" term_id="kube-controller-manager" >}}, and a Node is marked out-of-service with this taint, the
10501095
pods on the node will be forcefully deleted if there are no matching tolerations on it and volume
10511096
detach operations for the pods terminating on the node will happen immediately. This allows the
1052-
Pods on the out-of-service node to recover quickly on a different node.
1097+
Pods on the out-of-service node to recover quickly on a different node.
10531098
-->
10541099
为了缓解上述情况,用户可以手动将具有 `NoExecute` 或 `NoSchedule` 效果的
10551100
`node.kubernetes.io/out-of-service` 污点添加到节点上,标记其无法提供服务。
@@ -1064,7 +1109,7 @@ Pods on the out-of-service node to recover quickly on a different node.
10641109
During a non-graceful shutdown, Pods are terminated in the two phases:
10651110

10661111
1. Force delete the Pods that do not have matching `out-of-service` tolerations.
1067-
2. Immediately perform detach volume operation for such pods.
1112+
2. Immediately perform detach volume operation for such pods.
10681113
-->
10691114
在非体面关闭期间,Pod 分两个阶段终止:
10701115

@@ -1180,12 +1225,12 @@ see [KEP-2400](https://github.com/kubernetes/enhancements/issues/2400) and its
11801225

11811226
<!--
11821227
Learn more about the following:
1183-
* [Components](/docs/concepts/overview/components/#node-components) that make up a node.
1184-
* [API definition for Node](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#node-v1-core).
1185-
* [Node](https://git.k8s.io/design-proposals-archive/architecture/architecture.md#the-kubernetes-node) section of the architecture design document.
1186-
* [Taints and Tolerations](/docs/concepts/scheduling-eviction/taint-and-toleration/).
1187-
* [Node Resource Managers](/docs/concepts/policy/node-resource-managers/).
1188-
* [Resource Management for Windows nodes](/docs/concepts/configuration/windows-resource-management/).
1228+
* [Components](/docs/concepts/overview/components/#node-components) that make up a node.
1229+
* [API definition for Node](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#node-v1-core).
1230+
* [Node](https://git.k8s.io/design-proposals-archive/architecture/architecture.md#the-kubernetes-node) section of the architecture design document.
1231+
* [Taints and Tolerations](/docs/concepts/scheduling-eviction/taint-and-toleration/).
1232+
* [Node Resource Managers](/docs/concepts/policy/node-resource-managers/).
1233+
* [Resource Management for Windows nodes](/docs/concepts/configuration/windows-resource-management/).
11891234
-->
11901235
进一步了解以下资料:
11911236

0 commit comments

Comments
 (0)