Skip to content

Commit 5c06370

Browse files
authored
Merge pull request #51967 from marosset/1.34-graceful-shutdown-updates
Updating graceful node shutdown page to not assume linux
2 parents ded362d + 47c5fa7 commit 5c06370

File tree

1 file changed

+43
-30
lines changed

1 file changed

+43
-30
lines changed

content/en/docs/concepts/cluster-administration/node-shutdown.md

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,66 @@ either **graceful** or **non-graceful**.
1616

1717
## Graceful node shutdown {#graceful-node-shutdown}
1818

19-
{{< feature-state feature_gate_name="GracefulNodeShutdown" >}}
20-
2119
The kubelet attempts to detect node system shutdown and terminates pods running on the node.
2220

23-
kubelet ensures that pods follow the normal
21+
Kubelet ensures that pods follow the normal
2422
[pod termination process](/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)
2523
during the node shutdown. During node shutdown, the kubelet does not accept new
2624
Pods (even if those Pods are already bound to the node).
2725

26+
### Enabling graceful node shutdown
27+
28+
{{< tabs name="graceful_shutdown_os" >}}
29+
{{% tab name="Linux" %}}
30+
{{< feature-state feature_gate_name="GracefulNodeShutdown" >}}
31+
32+
On Linux, the graceful node shutdown feature is controlled with the `GracefulNodeShutdown`
33+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) which is
34+
enabled by default in 1.21.
35+
36+
{{< note >}}
2837
The graceful node shutdown feature depends on systemd since it takes advantage of
2938
[systemd inhibitor locks](https://www.freedesktop.org/wiki/Software/systemd/inhibit/) to
3039
delay the node shutdown with a given duration.
40+
{{</ note >}}
41+
{{% /tab %}}
3142

32-
Graceful node shutdown is controlled with the `GracefulNodeShutdown`
33-
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) which is
34-
enabled by default in 1.21.
43+
{{% tab name="Windows" %}}
44+
{{< feature-state feature_gate_name="WindowsGracefulNodeShutdown" >}}
45+
46+
On Windows, the graceful node shutdown feature is controlled with the `WindowsGracefulNodeShutdown`
47+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
48+
which is introduced in 1.32 as an alpha feature. In Kubernetes 1.34 the feature is Beta
49+
and is enabled by default.
50+
51+
{{< note >}}
52+
The Windows graceful node shutdown feature depends on kubelet running as a Windows service,
53+
it will then have a registered [service control handler](https://learn.microsoft.com/en-us/windows/win32/services/service-control-handler-function)
54+
to delay the preshutdown event with a given duration.
55+
{{</ note >}}
56+
57+
Windows graceful node shutdown can not be cancelled.
58+
59+
If kubelet is not running as a Windows service, it will not be able to set and monitor
60+
the [Preshutdown](https://learn.microsoft.com/en-us/windows/win32/api/winsvc/ns-winsvc-service_preshutdown_info) event,
61+
the node will have to go through the [Non-Graceful Node Shutdown](#non-graceful-node-shutdown) procedure mentioned above.
62+
63+
In the case where the Windows graceful node shutdown feature is enabled, but the kubelet is not
64+
running as a Windows service, the kubelet will continue running instead of failing. However,
65+
it will log an error indicating that it needs to be run as a Windows service.
66+
{{% /tab %}}
67+
68+
{{< /tabs >}}
69+
70+
### Configuring graceful node shutdown
3571

3672
Note that by default, both configuration options described below,
3773
`shutdownGracePeriod` and `shutdownGracePeriodCriticalPods`, are set to zero,
3874
thus not activating the graceful node shutdown functionality.
3975
To activate the feature, both options should be configured appropriately and
4076
set to non-zero values.
4177

42-
Once systemd detects or is notified of a node shutdown, the kubelet sets a `NotReady` condition on
78+
Once the kubelet is notified of a node shutdown, it sets a `NotReady` condition on
4379
the Node, with the `reason` set to `"node is shutting down"`. The kube-scheduler honors this condition
4480
and does not schedule any Pods onto the affected node; other third-party schedulers are
4581
expected to follow the same logic. This means that new Pods won't be scheduled onto that node
@@ -273,29 +309,6 @@ via the [Non-Graceful Node Shutdown](#non-graceful-node-shutdown) procedure ment
273309

274310
{{< /note >}}
275311

276-
## Windows Graceful node shutdown {#windows-graceful-node-shutdown}
277-
278-
{{< feature-state feature_gate_name="WindowsGracefulNodeShutdown" >}}
279-
280-
The Windows graceful node shutdown feature depends on kubelet running as a Windows service,
281-
it will then have a registered [service control handler](https://learn.microsoft.com/en-us/windows/win32/services/service-control-handler-function)
282-
to delay the preshutdown event with a given duration.
283-
284-
Windows graceful node shutdown is controlled with the `WindowsGracefulNodeShutdown`
285-
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
286-
which is introduced in 1.32 as an alpha feature. In Kubernetes 1.34 the feature is Beta
287-
and is enabled by default.
288-
289-
Windows graceful node shutdown can not be cancelled.
290-
291-
If kubelet is not running as a Windows service, it will not be able to set and monitor
292-
the [Preshutdown](https://learn.microsoft.com/en-us/windows/win32/api/winsvc/ns-winsvc-service_preshutdown_info) event,
293-
the node will have to go through the [Non-Graceful Node Shutdown](#non-graceful-node-shutdown) procedure mentioned above.
294-
295-
In the case where the Windows graceful node shutdown feature is enabled, but the kubelet is not
296-
running as a Windows service, the kubelet will continue running instead of failing. However,
297-
it will log an error indicating that it needs to be run as a Windows service.
298-
299312
## {{% heading "whatsnext" %}}
300313

301314
Learn more about the following:

0 commit comments

Comments
 (0)