Documentation ¶
Index ¶
- func ExponentialBackoff(task func() (bool, error), baseDuration, maxBackoffDuration time.Duration, ...) (done bool, err error)
- func InitNodeAnnotationListener(ctx context.Context, informerManager *k8s.InformerManager, ...) error
- func InitStoragePoolService(ctx context.Context, configInfo *commonconfig.ConfigurationInfo, ...) error
- func ReconcileAllStoragePools(ctx context.Context, scWatchCntlr *StorageClassWatch, spCtl *SpController) error
- func ResetVC(ctx context.Context, vc *cnsvsphere.VirtualCenter)
- func RetryOnError(task func() error, baseDuration, maxBackoffDuration time.Duration, ...) error
- type DiskDecommController
- type NodeAnnotationListener
- type Service
- type SpController
- type StorageClassWatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExponentialBackoff ¶
func ExponentialBackoff(task func() (bool, error), baseDuration, maxBackoffDuration time.Duration, multiplier float64, retries int) (done bool, err error)
ExponentialBackoff is an algorithm which is used to spread out repeated execution of task (usually reconnection or packet sending task to avoid network congestion or to decrease server load). In exponential backoff, wait time is increased exponentially till maxBackoffDuration. We have introduced jitter here to avoid thundering herd problem in future.
func InitNodeAnnotationListener ¶
func InitNodeAnnotationListener(ctx context.Context, informerManager *k8s.InformerManager, scWatch *StorageClassWatch, spController *SpController) error
InitNodeAnnotationListener initializes a listener that listens to Nodes in a WCP cluster.
func InitStoragePoolService ¶
func InitStoragePoolService(ctx context.Context, configInfo *commonconfig.ConfigurationInfo, coInitParams *interface{}) error
InitStoragePoolService initializes the StoragePool service that updates vSphere Datastore information into corresponding k8s StoragePool resources.
func ReconcileAllStoragePools ¶
func ReconcileAllStoragePools(ctx context.Context, scWatchCntlr *StorageClassWatch, spCtl *SpController) error
ReconcileAllStoragePools creates/updates/deletes StoragePool instances for datastores found in this k8s cluster. This should be invoked when there is a potential change in the list of datastores in the cluster.
func ResetVC ¶
func ResetVC(ctx context.Context, vc *cnsvsphere.VirtualCenter)
ResetVC will be called whenever the connection to vCenter is recycled. This will renew the PropertyCollector listener of StoragePool as well as update the controllers with the new refreshed VC connection.
func RetryOnError ¶
func RetryOnError(task func() error, baseDuration, maxBackoffDuration time.Duration, multiplier float64, maxRetries int) error
RetryOnError retries the given task function in case of error till it succeeds. Each retried is exponentially backed off as per the parameter provided to the function. Wait time starts from baseDuration and on each error wait time is exponentially increased by the provided multiplier till maxBackoffDuration. example input: RetryOnError(func() error { return vc.ConnectVsan(ctx) },
time.Duration(100) * time.Millisecond, time.Duration(10) * time.Second, 1.5)
Types ¶
type DiskDecommController ¶
type DiskDecommController struct {
// contains filtered or unexported fields
}
DiskDecommController is responsible for watching and processing disk decommission request.
func (*DiskDecommController) DecommissionDisk ¶
func (w *DiskDecommController) DecommissionDisk(ctx context.Context, storagePoolName string, maintenanceMode string)
DecommissionDisk is responsible for making progress on disk decommission request. It does so by getting SvMotion plan from placement engine, persisting the migration plan through PVC objects and and passing this info to migration controller which migrates the volume to other local host attached disk.
type NodeAnnotationListener ¶
type NodeAnnotationListener struct {
// contains filtered or unexported fields
}
NodeAnnotationListener listens to Nodes in this WCP cluster looking for "vmware-system-esxi-node-moid" annotation
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service holds the controllers needed to manage StoragePools.
func (*Service) GetSPController ¶
func (sps *Service) GetSPController() *SpController
GetSPController returns the single SpController intialized in this service.
func (*Service) GetScWatch ¶
func (sps *Service) GetScWatch() *StorageClassWatch
GetScWatch returns the active StorageClassWatch initialized in this service.
type SpController ¶
type SpController struct {
// contains filtered or unexported fields
}
SpController holds the intended state updated by property collector listener and has methods to apply intended state into actual k8s state.
type StorageClassWatch ¶
type StorageClassWatch struct {
// contains filtered or unexported fields
}
StorageClassWatch keeps state to watch storage classes and keep an in-memory cache of datastore / storage pool accessibility.