Add "disable-force-detach-on-timeout" flag to kube-controller-manager

This commit is contained in:
Rohit Singh
2023-09-01 08:40:54 +00:00
parent 27ad20db35
commit 13dddca6a2
11 changed files with 225 additions and 47 deletions

View File

@@ -385,6 +385,7 @@ func startPersistentVolumeAttachDetachController(ctx context.Context, controller
GetDynamicPluginProber(controllerContext.ComponentConfig.PersistentVolumeBinderController.VolumeConfiguration),
controllerContext.ComponentConfig.AttachDetachController.DisableAttachDetachReconcilerSync,
controllerContext.ComponentConfig.AttachDetachController.ReconcilerSyncLoopPeriod.Duration,
controllerContext.ComponentConfig.AttachDetachController.DisableForceDetachOnTimeout,
attachdetach.DefaultTimerConfig,
)
if attachDetachControllerErr != nil {

View File

@@ -37,6 +37,7 @@ func (o *AttachDetachControllerOptions) AddFlags(fs *pflag.FlagSet) {
fs.BoolVar(&o.DisableAttachDetachReconcilerSync, "disable-attach-detach-reconcile-sync", false, "Disable volume attach detach reconciler sync. Disabling this may cause volumes to be mismatched with pods. Use wisely.")
fs.DurationVar(&o.ReconcilerSyncLoopPeriod.Duration, "attach-detach-reconcile-sync-period", o.ReconcilerSyncLoopPeriod.Duration, "The reconciler sync wait time between volume attach detach. This duration must be larger than one second, and increasing this value from the default may allow for volumes to be mismatched with pods.")
fs.BoolVar(&o.DisableForceDetachOnTimeout, "disable-force-detach-on-timeout", false, "Prevent force detaching volumes based on maximum unmount time and node status. If this flag is set to true, the non-graceful node shutdown feature must be used to recover from node failure. See https://k8s.io/docs/storage-disable-force-detach-on-timeout/.")
}
// ApplyTo fills up AttachDetachController config with options.
@@ -47,6 +48,7 @@ func (o *AttachDetachControllerOptions) ApplyTo(cfg *attachdetachconfig.AttachDe
cfg.DisableAttachDetachReconcilerSync = o.DisableAttachDetachReconcilerSync
cfg.ReconcilerSyncLoopPeriod = o.ReconcilerSyncLoopPeriod
cfg.DisableForceDetachOnTimeout = o.DisableForceDetachOnTimeout
return nil
}