@@ -70,7 +70,7 @@ To activate the feature, the two kubelet config settings should be configured ap
70
70
set to non-zero values.
71
71
-->
72
72
注意,默认情况下,下面描述的两个配置选项,` shutdownGracePeriod ` 和
73
- ` shutdownGracePeriodCriticalPods ` 都是被设置为 0 的,因此不会激活节点体面关闭功能 。
73
+ ` shutdownGracePeriodCriticalPods ` 都是被设置为 0 的,因此不会激活节点体面关闭特性 。
74
74
要激活此功能特性,这两个 kubelet 配置选项要适当配置,并设置为非零值。
75
75
76
76
<!--
@@ -110,7 +110,7 @@ During a graceful shutdown, kubelet terminates pods in two phases:
110
110
2. Terminate [critical pods](/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical)
111
111
running on the node.
112
112
-->
113
- 在体面关闭节点过程中 ,kubelet 分两个阶段来终止 Pod:
113
+ 在体面关闭过程中 ,kubelet 分两个阶段来终止 Pod:
114
114
115
115
1 . 终止在节点上运行的常规 Pod。
116
116
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
158
158
reserved for terminating [critical pods](/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical).
159
159
-->
160
160
例如,如果设置了 ` shutdownGracePeriod=30s ` 和 ` shutdownGracePeriodCriticalPods=10s ` ,
161
- 则 kubelet 将延迟 30 秒关闭节点。
162
- 在关闭期间,将保留前 20(30 - 10)秒用于体面终止常规 Pod,
161
+ 则 kubelet 将延迟 30 秒关闭节点。在关闭期间,将保留前 20(30 - 10)秒用于体面终止常规 Pod,
163
162
而保留最后 10 秒用于终止[ 关键 Pod] ( /zh-cn/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical ) 。
164
163
165
164
{{< note >}}
@@ -295,7 +294,7 @@ example, you could instead use these settings:
295
294
上面的表格表明,所有 `priority` 值大于等于 100000 的 Pod 停止期限只有 10 秒,
296
295
所有 `priority` 值介于 10000 和 100000 之间的 Pod 停止期限是 180 秒,
297
296
所有 `priority` 值介于 1000 和 10000 之间的 Pod 停止期限是 120 秒,
298
- 其他所有 Pod 停止期限是 60 秒。
297
+ 其他所有 Pod 停止期限是 60 秒。
299
298
300
299
用户不需要为所有的优先级类都设置数值。例如,你也可以使用下面这种配置:
301
300
@@ -341,8 +340,8 @@ their respective shutdown periods.
341
340
342
341
使用此功能特性需要启用 `GracefulNodeShutdownBasedOnPodPriority`
343
342
[特性门控](/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` 设置为期望的配置,
346
345
其中包含 Pod 的优先级类数值以及对应的关闭期限。
347
346
348
347
{{< note >}}
@@ -351,8 +350,8 @@ The ability to take Pod priority into account during graceful node shutdown was
351
350
as an Alpha feature in Kubernetes v1.23. In Kubernetes {{< skew currentVersion >}}
352
351
the feature is Beta and is enabled by default.
353
352
-->
354
- 在节点体面关闭期间考虑 Pod 优先级的能力是作为 Kubernetes v1.23 中的 Alpha 功能引入的 。
355
- 在 Kubernetes {{< skew currentVersion >}} 中该功能是 Beta 版 ,默认启用。
353
+ 在节点体面关闭期间考虑 Pod 优先级的能力是作为 Kubernetes v1.23 中的 Alpha 特性引入的 。
354
+ 在 Kubernetes {{< skew currentVersion >}} 中此特性处于 Beta 阶段 ,默认启用。
356
355
{{< /note >}}
357
356
358
357
<!--
@@ -406,21 +405,17 @@ these pods will be stuck in terminating status on the shutdown node forever.
406
405
如果原来的已关闭节点没有被恢复,那些在已关闭节点上的 Pod 将永远滞留在终止状态。
407
406
408
407
<!--
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.
416
414
-->
417
415
为了缓解上述情况,用户可以手动将具有 `NoExecute` 或 `NoSchedule` 效果的
418
416
` 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 将立即进行卷分离操作。
424
419
这样就允许那些在无法提供服务节点上的 Pod 能在其他节点上快速恢复。
425
420
426
421
<!--
@@ -505,6 +500,50 @@ via the [Non-Graceful Node Shutdown](#non-graceful-node-shutdown) procedure ment
505
500
- 偏离上述步骤可能会导致数据损坏。
506
501
{{< /note >}}
507
502
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
+
508
547
# # {{% heading "whatsnext" %}}
509
548
510
549
<!--
0 commit comments