kubernetes: k8s.io/kubernetes/pkg/controller/volume/attachdetach Index | Files | Directories

package attachdetach

import "k8s.io/kubernetes/pkg/controller/volume/attachdetach"

Package attachdetach implements a controller to manage volume attach and detach operations.

Index

Package Files

attach_detach_controller.go

type AttachDetachController Uses

type AttachDetachController interface {
    Run(stopCh <-chan struct{})
    GetDesiredStateOfWorld() cache.DesiredStateOfWorld
}

AttachDetachController defines the operations supported by this controller.

func NewAttachDetachController Uses

func NewAttachDetachController(
    kubeClient clientset.Interface,
    podInformer coreinformers.PodInformer,
    nodeInformer coreinformers.NodeInformer,
    pvcInformer coreinformers.PersistentVolumeClaimInformer,
    pvInformer coreinformers.PersistentVolumeInformer,
    csiNodeInformer storageinformers.CSINodeInformer,
    csiDriverInformer storageinformers.CSIDriverInformer,
    cloud cloudprovider.Interface,
    plugins []volume.VolumePlugin,
    prober volume.DynamicPluginProber,
    disableReconciliationSync bool,
    reconcilerSyncDuration time.Duration,
    timerConfig TimerConfig) (AttachDetachController, error)

NewAttachDetachController returns a new instance of AttachDetachController.

type TimerConfig Uses

type TimerConfig struct {
    // ReconcilerLoopPeriod is the amount of time the reconciler loop waits
    // between successive executions
    ReconcilerLoopPeriod time.Duration

    // ReconcilerMaxWaitForUnmountDuration is the maximum amount of time the
    // attach detach controller will wait for a volume to be safely unmounted
    // from its node. Once this time has expired, the controller will assume the
    // node or kubelet are unresponsive and will detach the volume anyway.
    ReconcilerMaxWaitForUnmountDuration time.Duration

    // DesiredStateOfWorldPopulatorLoopSleepPeriod is the amount of time the
    // DesiredStateOfWorldPopulator loop waits between successive executions
    DesiredStateOfWorldPopulatorLoopSleepPeriod time.Duration

    // DesiredStateOfWorldPopulatorListPodsRetryDuration is the amount of
    // time the DesiredStateOfWorldPopulator loop waits between list pods
    // calls.
    DesiredStateOfWorldPopulatorListPodsRetryDuration time.Duration
}

TimerConfig contains configuration of internal attach/detach timers and should be used only to speed up tests. DefaultTimerConfig is the suggested timer configuration for production.

var DefaultTimerConfig TimerConfig = TimerConfig{
    ReconcilerLoopPeriod:                              100 * time.Millisecond,
    ReconcilerMaxWaitForUnmountDuration:               6 * time.Minute,
    DesiredStateOfWorldPopulatorLoopSleepPeriod:       1 * time.Minute,
    DesiredStateOfWorldPopulatorListPodsRetryDuration: 3 * time.Minute,
}

DefaultTimerConfig is the default configuration of Attach/Detach controller timers.

Directories

PathSynopsis
cachePackage cache implements data structures used by the attach/detach controller to keep track of volumes, the nodes they are attached to, and the pods that reference them.
config
config/v1alpha1
metrics
populatorPackage populator implements interfaces that monitor and keep the states of the desired_state_of_word in sync with the "ground truth" from informer.
reconcilerPackage reconciler implements interfaces that attempt to reconcile the desired state of the with the actual state of the world by triggering actions.
statusupdaterPackage statusupdater implements interfaces that enable updating the status of API objects.
testing
util

Package attachdetach imports 36 packages (graph) and is imported by 9 packages. Updated 2019-09-14. Refresh now. Tools for package owners.