@@ -513,6 +513,35 @@ During a non-graceful shutdown, Pods are terminated in the two phases:
513
513
recovered since the user was the one who originally added the taint.
514
514
{{< /note >}}
515
515
516
+ # ## Forced storage detach on timeout {#storage-force-detach-on-timeout}
517
+
518
+ In any situation where a pod deletion has not succeeded for 6 minutes, kubernetes will
519
+ force detach volumes being unmounted if the node is unhealthy at that instant. Any
520
+ workload still running on the node that uses a force-detached volume will cause a
521
+ violation of the
522
+ [CSI specification](https://github.com/container-storage-interface/spec/blob/master/spec.md#controllerunpublishvolume),
523
+ which states that `ControllerUnpublishVolume` "**must** be called after all
524
+ ` NodeUnstageVolume` and `NodeUnpublishVolume` on the volume are called and succeed".
525
+ In such circumstances, volumes on the node in question might encounter data corruption.
526
+
527
+ The forced storage detach behaviour is optional; users might opt to use the "Non-graceful
528
+ node shutdown" feature instead.
529
+
530
+ Force storage detach on timeout can be disabled by setting the `disable-force-detach-on-timeout`
531
+ config field in `kube-controller-manager`. Disabling the force detach on timeout feature means
532
+ that a volume that is hosted on a node that is unhealthy for more than 6 minutes will not have
533
+ its associated
534
+ [VolumeAttachment](/docs/reference/kubernetes-api/config-and-storage-resources/volume-attachment-v1/)
535
+ deleted.
536
+
537
+ After this setting has been applied, unhealthy pods still attached to a volumes must be recovered
538
+ via the [Non-Graceful Node Shutdown](#non-graceful-node-shutdown) procedure mentioned above.
539
+
540
+ {{< note >}}
541
+ - Caution must be taken while using the [Non-Graceful Node Shutdown](#non-graceful-node-shutdown) procedure.
542
+ - Deviation from the steps documented above can result in data corruption.
543
+ {{< /note >}}
544
+
516
545
# # Swap memory management {#swap-memory}
517
546
518
547
{{< feature-state feature_gate_name="NodeSwap" >}}
0 commit comments