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

Types

type AttachDetachController

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

AttachDetachController defines the operations supported by this controller.

func NewAttachDetachController

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) (AttachDetachController, error)

NewAttachDetachController returns a new instance of AttachDetachController.

type TimerConfig

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.

Source Files

attach_detach_controller.go

Directories

PathSynopsis
pkg/controller/volume/attachdetach/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.
pkg/controller/volume/attachdetach/config
pkg/controller/volume/attachdetach/config/v1alpha1
pkg/controller/volume/attachdetach/metrics
pkg/controller/volume/attachdetach/populatorPackage populator implements interfaces that monitor and keep the states of the desired_state_of_word in sync with the "ground truth" from informer.
pkg/controller/volume/attachdetach/reconcilerPackage reconciler implements interfaces that attempt to reconcile the desired state of the with the actual state of the world by triggering actions.
pkg/controller/volume/attachdetach/statusupdaterPackage statusupdater implements interfaces that enable updating the status of API objects.
pkg/controller/volume/attachdetach/testing
pkg/controller/volume/attachdetach/util
Version
v1.19.6
Published
Dec 18, 2020
Platform
js/wasm
Imports
40 packages
Last checked
2 minutes ago

Tools for package owners.