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.


Package Files


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 storageinformersv1.CSINodeInformer,
    csiDriverInformer storageinformersv1.CSIDriverInformer,
    volumeAttachmentInformer storageinformersv1.VolumeAttachmentInformer,
    cloud cloudprovider.Interface,
    plugins []volume.VolumePlugin,
    prober volume.DynamicPluginProber,
    disableReconciliationSync bool,
    reconcilerSyncDuration time.Duration,
    timerConfig TimerConfig,
    filteredDialOptions *proxyutil.FilteredDialOptions) (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.


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.
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.

Package attachdetach imports 41 packages (graph) and is imported by 10 packages. Updated 2021-01-19. Refresh now. Tools for package owners.