Skip to content

Commit 8b1235e

Browse files
authored
Merge pull request #49126 from windsonsea/nodown
[zh] Sync cluster-administration/node-shutdown.md and its feature gate
2 parents 2098a6d + 222f7b3 commit 8b1235e

File tree

2 files changed

+84
-21
lines changed

2 files changed

+84
-21
lines changed

content/zh-cn/docs/concepts/cluster-administration/node-shutdown.md

Lines changed: 60 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ To activate the feature, the two kubelet config settings should be configured ap
7070
set to non-zero values.
7171
-->
7272
注意,默认情况下,下面描述的两个配置选项,`shutdownGracePeriod`
73-
`shutdownGracePeriodCriticalPods` 都是被设置为 0 的,因此不会激活节点体面关闭功能
73+
`shutdownGracePeriodCriticalPods` 都是被设置为 0 的,因此不会激活节点体面关闭特性
7474
要激活此功能特性,这两个 kubelet 配置选项要适当配置,并设置为非零值。
7575

7676
<!--
@@ -110,7 +110,7 @@ During a graceful shutdown, kubelet terminates pods in two phases:
110110
2. Terminate [critical pods](/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical)
111111
running on the node.
112112
-->
113-
在体面关闭节点过程中,kubelet 分两个阶段来终止 Pod:
113+
在体面关闭过程中,kubelet 分两个阶段来终止 Pod:
114114

115115
1. 终止在节点上运行的常规 Pod。
116116
2. 终止在节点上运行的[关键 Pod](/zh-cn/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical)
@@ -158,8 +158,7 @@ for gracefully terminating normal pods, and the last 10 seconds would be
158158
reserved for terminating [critical pods](/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical).
159159
-->
160160
例如,如果设置了 `shutdownGracePeriod=30s``shutdownGracePeriodCriticalPods=10s`
161-
则 kubelet 将延迟 30 秒关闭节点。
162-
在关闭期间,将保留前 20(30 - 10)秒用于体面终止常规 Pod,
161+
则 kubelet 将延迟 30 秒关闭节点。在关闭期间,将保留前 20(30 - 10)秒用于体面终止常规 Pod,
163162
而保留最后 10 秒用于终止[关键 Pod](/zh-cn/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical)
164163

165164
{{< note >}}
@@ -295,7 +294,7 @@ example, you could instead use these settings:
295294
上面的表格表明,所有 `priority` 值大于等于 100000 的 Pod 停止期限只有 10 秒,
296295
所有 `priority` 值介于 10000 和 100000 之间的 Pod 停止期限是 180 秒,
297296
所有 `priority` 值介于 1000 和 10000 之间的 Pod 停止期限是 120 秒,
298-
其他所有 Pod 停止期限是 60 秒。
297+
其他所有 Pod 停止期限是 60 秒。
299298

300299
用户不需要为所有的优先级类都设置数值。例如,你也可以使用下面这种配置:
301300

@@ -341,8 +340,8 @@ their respective shutdown periods.
341340

342341
使用此功能特性需要启用 `GracefulNodeShutdownBasedOnPodPriority`
343342
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/),
344-
并将 [kubelet 配置](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)
345-
中的 `shutdownGracePeriodByPodPriority` 设置为期望的配置,
343+
并将 [kubelet 配置](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)中的
344+
`shutdownGracePeriodByPodPriority` 设置为期望的配置,
346345
其中包含 Pod 的优先级类数值以及对应的关闭期限。
347346

348347
{{< note >}}
@@ -351,8 +350,8 @@ The ability to take Pod priority into account during graceful node shutdown was
351350
as an Alpha feature in Kubernetes v1.23. In Kubernetes {{< skew currentVersion >}}
352351
the feature is Beta and is enabled by default.
353352
-->
354-
在节点体面关闭期间考虑 Pod 优先级的能力是作为 Kubernetes v1.23 中的 Alpha 功能引入的
355-
在 Kubernetes {{< skew currentVersion >}} 中该功能是 Beta ,默认启用。
353+
在节点体面关闭期间考虑 Pod 优先级的能力是作为 Kubernetes v1.23 中的 Alpha 特性引入的
354+
在 Kubernetes {{< skew currentVersion >}} 中此特性处于 Beta 阶段,默认启用。
356355
{{< /note >}}
357356

358357
<!--
@@ -406,21 +405,17 @@ these pods will be stuck in terminating status on the shutdown node forever.
406405
如果原来的已关闭节点没有被恢复,那些在已关闭节点上的 Pod 将永远滞留在终止状态。
407406

408407
<!--
409-
To mitigate the above situation, a user can manually add the taint `node.kubernetes.io/out-of-service` with either `NoExecute`
410-
or `NoSchedule` effect to a Node marking it out-of-service.
411-
If the `NodeOutOfServiceVolumeDetach`[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
412-
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
413-
pods on the node will be forcefully deleted if there are no matching tolerations on it and volume
414-
detach operations for the pods terminating on the node will happen immediately. This allows the
415-
Pods on the out-of-service node to recover quickly on a different node.
408+
To mitigate the above situation, a user can manually add the taint `node.kubernetes.io/out-of-service`
409+
with either `NoExecute` or `NoSchedule` effect to a Node marking it out-of-service.
410+
If a Node is marked out-of-service with this taint, the pods on the node will be forcefully deleted
411+
if there are no matching tolerations on it and volume detach operations for the pods terminating on
412+
the node will happen immediately. This allows the Pods on the out-of-service node to recover quickly
413+
on a different node.
416414
-->
417415
为了缓解上述情况,用户可以手动将具有 `NoExecute` 或 `NoSchedule` 效果的
418416
`node.kubernetes.io/out-of-service` 污点添加到节点上,标记其无法提供服务。
419-
如果在 {{< glossary_tooltip text="kube-controller-manager" term_id="kube-controller-manager" >}}
420-
上启用了 `NodeOutOfServiceVolumeDetach`
421-
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/),
422-
并且节点被污点标记为无法提供服务,如果节点 Pod 上没有设置对应的容忍度,
423-
那么这样的 Pod 将被强制删除,并且该在节点上被终止的 Pod 将立即进行卷分离操作。
417+
如果 Node 被污点标记为无法提供服务,且节点上的 Pod 没有设置对应的容忍度,
418+
那么这样的 Pod 将被强制删除,并且在节点上被终止的 Pod 将立即进行卷分离操作。
424419
这样就允许那些在无法提供服务节点上的 Pod 能在其他节点上快速恢复。
425420

426421
<!--
@@ -505,6 +500,50 @@ via the [Non-Graceful Node Shutdown](#non-graceful-node-shutdown) procedure ment
505500
- 偏离上述步骤可能会导致数据损坏。
506501
{{< /note >}}
507502

503+
<!--
504+
## Windows Graceful node shutdown {#windows-graceful-node-shutdown}
505+
-->
506+
## Windows 体面节点关闭 {#windows-graceful-node-shutdown}
507+
508+
{{< feature-state feature_gate_name="WindowsGracefulNodeShutdown" >}}
509+
510+
<!--
511+
The Windows graceful node shutdown feature depends on kubelet running as a Windows service,
512+
it will then have a registered [service control handler](https://learn.microsoft.com/en-us/windows/win32/services/service-control-handler-function)
513+
to delay the presshutdown event with a given duration.
514+
-->
515+
此服务会使用一个注册的[服务控制处理程序函数](https://learn.microsoft.com/zh-cn/windows/win32/services/service-control-handler-function)将
516+
preshutdown 事件延迟一段时间。
517+
518+
<!--
519+
Windows graceful node shutdown is controlled with the `WindowsGracefulNodeShutdown`
520+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
521+
which is introduced in 1.32 as an alpha feature.
522+
523+
Windows graceful node shutdown can not be cancelled.
524+
-->
525+
Windows 体面节点关闭是通过 1.32 中作为 Alpha 特性所引入的 `WindowsGracefulNodeShutdown`
526+
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)进行控制的。
527+
528+
Windows 体面节点关闭无法被取消。
529+
530+
<!--
531+
If Kubelet is not running as a Windows service, it will not be able to set and monitor
532+
the [Preshutdown](https://learn.microsoft.com/en-us/windows/win32/api/winsvc/ns-winsvc-service_preshutdown_info) event,
533+
the node will have to go through the [Non-Graceful Node Shutdown](#non-graceful-node-shutdown) procedure mentioned above.
534+
-->
535+
如果 kubelet 不是作为 Windows 服务运行,它将不能设置和监控
536+
[Preshutdown](https://learn.microsoft.com/zh-cn/windows/win32/api/winsvc/ns-winsvc-service_preshutdown_info)
537+
事件,对应节点将不得不跑完上述[非体面节点关闭](#non-graceful-node-shutdown)的流程。
538+
539+
<!--
540+
In the case where the Windows graceful node shutdown feature is enabled, but the kubelet is not
541+
running as a Windows service, the kubelet will continue running instead of failing. However,
542+
it will log an error indicating that it needs to be run as a Windows service.
543+
-->
544+
在启用 Windows 体面节点关闭特性但 kubelet 未作为 Windows 服务运行的情况下,kubelet 将继续运行而不会失败。
545+
但是,kubelet 将在日志中记录一个错误,表明它需要作为一个 Windows 服务来运行。
546+
508547
## {{% heading "whatsnext" %}}
509548

510549
<!--
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: WindowsGracefulNodeShutdown
3+
content_type: feature_gate
4+
_build:
5+
list: never
6+
render: false
7+
8+
stages:
9+
- stage: alpha
10+
defaultValue: false
11+
fromVersion: "1.32"
12+
13+
---
14+
15+
<!--
16+
Enables support for windows node graceful shutdown in kubelet.
17+
During a system shutdown, kubelet will attempt to detect the shutdown event
18+
and gracefully terminate pods running on the node. See
19+
[Graceful Node Shutdown](/docs/concepts/architecture/nodes/#graceful-node-shutdown)
20+
for more details.
21+
-->
22+
在 kubelet 中启用对 Windows 节点体面关闭的支持。
23+
在系统关闭期间,kubelet 将尝试检测关闭事件并体面终止节点上正运行的 Pod。
24+
细节参见[体面节点关闭](/zh-cn/docs/concepts/architecture/nodes/#graceful-node-shutdown)

0 commit comments

Comments
 (0)