pv_monitor_controller

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNodeNotReadyTimeDuration is the default time interval we need to consider node broken if it keeps NotReady
	DefaultNodeNotReadyTimeDuration = 5 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeWatcher

type NodeWatcher struct {
	// contains filtered or unexported fields
}

NodeWatcher watches nodes conditions

func NewNodeWatcher

func NewNodeWatcher(driverName string, client kubernetes.Interface, volumeLister corelisters.PersistentVolumeLister,
	pvcLister corelisters.PersistentVolumeClaimLister, nodeInformer coreinformers.NodeInformer,
	recorder record.EventRecorder, pvcToPodsCache *util.PVCToPodsCache, nodeWorkerExecuteInterval time.Duration, nodeListAndAddInterval time.Duration) *NodeWatcher

NewNodeWatcher creates a node watcher object that will watch the nodes

func (*NodeWatcher) Run

func (watcher *NodeWatcher) Run(stopCh <-chan struct{})

Run starts all of this controller's control loops

func (*NodeWatcher) WatchNodes

func (watcher *NodeWatcher) WatchNodes()

WatchNodes periodically checks if nodes break down

type PVMonitorController

type PVMonitorController struct {

	// used for updating pvEnqueue map
	sync.Mutex

	// Time interval for calling ListVolumes RPC to check volumes' health condition
	ListVolumesInterval time.Duration
	// Time interval for executing pv worker goroutines
	PVWorkerExecuteInterval time.Duration
	// Time interval for listing volumes and add them to queue
	VolumeListAndAddInterval time.Duration
	// contains filtered or unexported fields
}

PVMonitorController is the struct of pv monitor controller containing all information to perform volumes health condition checking

func NewPVMonitorController

NewPVMonitorController creates PV monitor controller

func (*PVMonitorController) AddPVsToQueue

func (ctrl *PVMonitorController) AddPVsToQueue() error

AddPVsToQueue adds PVs to queue periodically

func (*PVMonitorController) Run

func (ctrl *PVMonitorController) Run(workers int, stopCh <-chan struct{})

Run runs the volume health condition checking method

type PVMonitorOptions

type PVMonitorOptions struct {
	ContextTimeout    time.Duration
	DriverName        string
	EnableNodeWatcher bool
	SupportListVolume bool

	ListVolumesInterval      time.Duration
	PVWorkerExecuteInterval  time.Duration
	VolumeListAndAddInterval time.Duration

	NodeWorkerExecuteInterval time.Duration
	NodeListAndAddInterval    time.Duration
}

PVMonitorOptions configures PV monitor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL