Skip to content

Commit 98a6ab8

Browse files
authored
Merge pull request #56093 from lpettyjo/OSDOCS-3790
OSDOCS-3790:CSI driver vol detach w/ non-graceful node shutdown
2 parents 9d09ac3 + b86bcb9 commit 98a6ab8

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,8 @@ Topics:
15171517
File: persistent-storage-csi-cloning
15181518
- Name: CSI automatic migration
15191519
File: persistent-storage-csi-migration
1520+
- Name: Detach CSI volumes after non-graceful node shutdown
1521+
File: persistent-storage-csi-vol-detach-non-graceful-shutdown
15201522
- Name: AliCloud Disk CSI Driver Operator
15211523
File: persistent-storage-csi-alicloud-disk
15221524
- Name: AWS Elastic Block Store CSI Driver Operator
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * storage/container_storage_interface/persistent-storage-csi-vol-detach-non-graceful-shutdown.adoc
4+
//
5+
6+
:_content-type: CONCEPT
7+
[id="persistent-storage-csi-vol-detach-non-graceful-overview_{context}"]
8+
= Overview
9+
10+
A graceful node shutdown occurs when the kubelet's node shutdown manager detects the upcoming node shutdown action. Non-graceful shutdowns occur when the kubelet does not detect a node shutdown action, which can occur because of system or hardware failures. Also, the kubelet may not detect a node shutdown action when the shutdown command does not trigger the Inhibitor Locks mechanism used by the kubelet on Linux, or because of a user error, for example, if the shutdownGracePeriod and shutdownGracePeriodCriticalPods details are not configured correctly for that node.
11+
12+
With this feature, when a non-graceful node shutdown occurs, you can manually add an `out-of-service` taint on the node to allow volumes to automatically detach from the node.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * storage/container_storage_interface/persistent-storage-csi-vol-detach-non-graceful-shutdown.adoc
4+
//
5+
6+
:_content-type: PROCEDURE
7+
[id="persistent-storage-csi-vol-detach-non-graceful-shutdown-procedure_{context}"]
8+
= Adding an out-of-service taint manually for automatic volume detachment
9+
10+
.Prerequisites
11+
12+
* Access to the cluster with cluster-admin privileges.
13+
14+
.Procedure
15+
16+
To allow volumes to detach automatically from a node after a non-graceful node shutdown:
17+
18+
. After a node is detected as unhealthy, shut down the worker node.
19+
20+
. Ensure that the node is shutdown by running the following command and checking the status:
21+
+
22+
[source, terminal]
23+
----
24+
oc get node <node name> <1>
25+
----
26+
<1> <node name> = name of the non-gracefully shutdown node
27+
28+
. Taint the corresponding node object by running the following command:
29+
+
30+
[source, terminal]
31+
----
32+
oc adm taint node <node name> node.kubernetes.io/out-of-service=nodeshutdown:NoExecute <1>
33+
----
34+
<1> <node name> = name of the non-gracefully shutdown node
35+
+
36+
After the taint is applied, the volumes detach from the shutdown node allowing their disks to be attached to a different node.
37+
+
38+
.Example
39+
+
40+
The resulting YAML file resembles the following:
41+
+
42+
[source, yaml]
43+
----
44+
spec:
45+
taints:
46+
- effect: NoExecute
47+
key: node.kubernetes.io/out-of-service
48+
value: nodeshutdown
49+
----
50+
51+
. Restart the node.
52+
53+
. Remove the taint.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
:_content-type: ASSEMBLY
2+
[id="ephemeral-storage-csi-vol-detach-non-graceful-shutdown"]
3+
= Detach CSI volumes after non-graceful node shutdown
4+
include::_attributes/common-attributes.adoc[]
5+
:context: ephemeral-storage-csi-vol-detach-non-graceful-shutdown
6+
7+
toc::[]
8+
9+
This feature allows Container Storage Interface (CSI) drivers to automatically detach volumes when a node goes down non-gracefully.
10+
11+
:FeatureName: Detach CSI volumes after non-graceful node shutdown
12+
include::snippets/technology-preview.adoc[leveloffset=+1]
13+
14+
include::modules/persistent-storage-csi-vol-detach-non-graceful-shutdown-overview.adoc[leveloffset=+1]
15+
16+
include::modules/persistent-storage-csi-vol-detach-non-graceful-shutdown-procedure.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)