Documentation ¶
Index ¶
- Constants
- Variables
- func BackingImageDiskFileCleanup(node *longhorn.Node, bi *longhorn.BackingImage, ...)
- func EnhancedDefaultControllerRateLimiter() workqueue.TypedRateLimiter[any]
- func GetBinaryClientForEngine(e *longhorn.Engine, engines engineapi.EngineClientCollection, image string) (client *engineapi.EngineBinary, err error)
- func GetInstanceManagerCPURequirement(ds *datastore.DataStore, imName string) (*corev1.ResourceRequirements, error)
- func GetSupportBundleManagerName(supportBundle *longhorn.SupportBundle) string
- func IsRebuildingReplica(r *longhorn.Replica) bool
- func IsSameGuaranteedCPURequirement(a, b *corev1.ResourceRequirements) bool
- func IsValidForExpansion(engine *longhorn.Engine, cliAPIVersion, imAPIVersion int) (bool, error)
- func ParseResourceRequirement(val string) (*corev1.ResourceRequirements, error)
- type BackingImageController
- type BackingImageDataSourceController
- type BackingImageDataSourceMonitor
- type BackingImageManagerController
- type BackingImageManagerMonitor
- type BackupBackingImageController
- type BackupController
- type BackupStoreTimer
- type BackupTargetController
- type BackupVolumeController
- type CheckUpgradeExtraInfo
- type CheckUpgradeRequest
- type CheckUpgradeResponse
- type ClusterInfo
- type ClusterInfoStructFields
- type EngineController
- func (ec *EngineController) CreateInstance(obj interface{}) (*longhorn.InstanceProcess, error)
- func (ec *EngineController) DeleteInstance(obj interface{}) (err error)
- func (ec *EngineController) GetInstance(obj interface{}) (*longhorn.InstanceProcess, error)
- func (ec *EngineController) LogInstance(ctx context.Context, obj interface{}) (*engineapi.InstanceManagerClient, *imapi.LogStream, error)
- func (ec *EngineController) ReconcileEngineState(e *longhorn.Engine) error
- func (ec *EngineController) Run(workers int, stopCh <-chan struct{})
- func (ec *EngineController) Upgrade(e *longhorn.Engine, log *logrus.Entry) (err error)
- func (ec *EngineController) UpgradeEngineInstance(e *longhorn.Engine, log *logrus.Entry) error
- type EngineImageController
- type EngineMonitor
- type GetRuntimeObjectListFunc
- type InstanceHandler
- type InstanceManagerController
- type InstanceManagerHandler
- type InstanceManagerMonitor
- type KubernetesConfigMapController
- type KubernetesEndpointController
- type KubernetesNodeController
- type KubernetesPDBController
- type KubernetesPVController
- type KubernetesPodController
- type KubernetesSecretController
- type NodeController
- type OrphanController
- type RecurringJobController
- type ReplicaController
- func (rc *ReplicaController) CanStartRebuildingReplica(r *longhorn.Replica) (bool, error)
- func (rc *ReplicaController) CreateInstance(obj interface{}) (*longhorn.InstanceProcess, error)
- func (rc *ReplicaController) DeleteInstance(obj interface{}) (err error)
- func (rc *ReplicaController) GetBackingImagePathForReplicaStarting(r *longhorn.Replica) (string, error)
- func (rc *ReplicaController) GetInstance(obj interface{}) (*longhorn.InstanceProcess, error)
- func (rc *ReplicaController) LogInstance(ctx context.Context, obj interface{}) (*engineapi.InstanceManagerClient, *imapi.LogStream, error)
- func (rc *ReplicaController) Run(workers int, stopCh <-chan struct{})
- type SettingController
- type ShareManagerController
- type SimpleResourceEventHandler
- type SnapshotController
- type SupportBundleController
- type SupportBundleManager
- type SupportBundleManagerPhase
- type SupportBundleManagerStatus
- type SystemBackupController
- func (c *SystemBackupController) BackupBackingImage() (map[string]*longhorn.BackupBackingImage, error)
- func (c *SystemBackupController) BackupVolumes(systemBackup *longhorn.SystemBackup) (map[string]*longhorn.Backup, error)
- func (c *SystemBackupController) GenerateSystemBackup(systemBackup *longhorn.SystemBackup, archievePath, tempDir string)
- func (c *SystemBackupController) InitSystemBackup(systemBackup *longhorn.SystemBackup, log logrus.FieldLogger) error
- func (c *SystemBackupController) LogErrorState(record *systemBackupRecord, systemBackup *longhorn.SystemBackup, ...)
- func (c *SystemBackupController) LogNormalState(record *systemBackupRecord, systemBackup *longhorn.SystemBackup, ...)
- func (c *SystemBackupController) Run(workers int, stopCh <-chan struct{})
- func (c *SystemBackupController) UploadSystemBackup(systemBackup *longhorn.SystemBackup, archievePath, tempDir string, ...)
- func (c *SystemBackupController) WaitForBackingImageBackupToComplete(backupBackingImages map[string]*longhorn.BackupBackingImage, ...)
- func (c *SystemBackupController) WaitForVolumeBackupToComplete(backups map[string]*longhorn.Backup, systemBackup *longhorn.SystemBackup) (err error)
- type SystemRestoreController
- func (c *SystemRestoreController) CreateSystemRestoreJob(systemRestore *longhorn.SystemRestore, ...) (*batchv1.Job, error)
- func (c *SystemRestoreController) LogErrorState(record *systemRestoreRecord, systemRestore *longhorn.SystemRestore, ...)
- func (c *SystemRestoreController) LogNormalState(record *systemRestoreRecord, systemRestore *longhorn.SystemRestore, ...)
- func (c *SystemRestoreController) Run(workers int, stopCh <-chan struct{})
- type SystemRolloutController
- type TopologyLabelsChecker
- type UninstallController
- type Version
- type VolumeAttachmentController
- type VolumeCloneController
- type VolumeController
- func (c *VolumeController) EvictReplicas(v *longhorn.Volume, e *longhorn.Engine, rs map[string]*longhorn.Replica, ...) (err error)
- func (c *VolumeController) IsReplicaUnavailable(r *longhorn.Replica) (bool, error)
- func (c *VolumeController) ReconcileBackupVolumeState(volume *longhorn.Volume) error
- func (c *VolumeController) ReconcileEngineReplicaState(v *longhorn.Volume, es map[string]*longhorn.Engine, ...) (err error)
- func (c *VolumeController) ReconcilePersistentVolume(volume *longhorn.Volume) error
- func (c *VolumeController) ReconcileShareManagerState(volume *longhorn.Volume) error
- func (c *VolumeController) ReconcileVolumeState(v *longhorn.Volume, es map[string]*longhorn.Engine, ...) (err error)
- func (c *VolumeController) ResolveRefAndEnqueue(namespace string, ref *metav1.OwnerReference)
- func (c *VolumeController) Run(workers int, stopCh <-chan struct{})
- type VolumeEvictionController
- type VolumeExpansionController
- type VolumeRebuildingController
- type VolumeRestoreController
- type Watcher
- type WebsocketController
Constants ¶
const ( WaitForSnapshotMessage = "Waiting for the snapshot %v to be ready" WaitForEngineMessage = "Waiting for the engine %v to be ready" FailedToGetSnapshotMessage = "Failed to get the Snapshot %v" )
const ( VersionTagLatest = "latest" VersionTagStable = "stable" )
const ( ClusterInfoNamespaceUID = util.StructName("LonghornNamespaceUid") ClusterInfoNodeCount = util.StructName("LonghornNodeCount") ClusterInfoVolumeAvgActualSize = util.StructName("LonghornVolumeAverageActualSizeBytes") ClusterInfoVolumeAvgSize = util.StructName("LonghornVolumeAverageSizeBytes") ClusterInfoVolumeAvgSnapshotCount = util.StructName("LonghornVolumeAverageSnapshotCount") ClusterInfoVolumeAvgNumOfReplicas = util.StructName("LonghornVolumeAverageNumberOfReplicas") ClusterInfoPodAvgCPUUsageFmt = "Longhorn%sAverageCpuUsageMilliCores" ClusterInfoPodAvgMemoryUsageFmt = "Longhorn%sAverageMemoryUsageBytes" ClusterInfoSettingFmt = "LonghornSetting%s" ClusterInfoVolumeAccessModeCountFmt = "LonghornVolumeAccessMode%sCount" ClusterInfoVolumeDataEngineCountFmt = "LonghornVolumeDataEngine%sCount" ClusterInfoVolumeDataLocalityCountFmt = "LonghornVolumeDataLocality%sCount" ClusterInfoVolumeFrontendCountFmt = "LonghornVolumeFrontend%sCount" ClusterInfoVolumeReplicaAutoBalanceCountFmt = "LonghornVolumeReplicaAutoBalance%sCount" ClusterInfoVolumeReplicaSoftAntiAffinityCountFmt = "LonghornVolumeReplicaSoftAntiAffinity%sCount" ClusterInfoVolumeReplicaZoneSoftAntiAffinityCountFmt = "LonghornVolumeReplicaZoneSoftAntiAffinity%sCount" ClusterInfoVolumeReplicaDiskSoftAntiAffinityCountFmt = "LonghornVolumeReplicaDiskSoftAntiAffinity%sCount" ClusterInfoVolumeRestoreVolumeRecurringJobCountFmt = "LonghornVolumeRestoreVolumeRecurringJob%sCount" ClusterInfoVolumeSnapshotDataIntegrityCountFmt = "LonghornVolumeSnapshotDataIntegrity%sCount" ClusterInfoVolumeUnmapMarkSnapChainRemovedCountFmt = "LonghornVolumeUnmapMarkSnapChainRemoved%sCount" ClusterInfoVolumeFreezeFilesystemForSnapshotCountFmt = "LonghornVolumeFreezeFilesystemForSnapshot%sCount" )
Cluster Scope Info: will be sent from one of the Longhorn cluster nodes
const ( ClusterInfoKubernetesVersion = util.StructName("KubernetesVersion") ClusterInfoKubernetesNodeProvider = util.StructName("KubernetesNodeProvider") ClusterInfoHostKernelRelease = util.StructName("HostKernelRelease") ClusterInfoHostOsDistro = util.StructName("HostOsDistro") ClusterInfoDiskCountFmt = "LonghornDisk%sCount" ClusterInfoNodeDiskCountFmt = "LonghornNodeDisk%sCount" )
Node Scope Info: will be sent from all Longhorn cluster nodes
const ( SupportBundleServiceAccount = "longhorn-support-bundle" SupportBundleRequeueDelay = time.Second SupportBundleMsgRequeueOnConflictFmt = "Requeue %v due to conflict" SupportBundleMsgRequeueNextPhaseFmt = "Requeue %v for next phase: %v" SupportBundleMsgManagerPhase = "Support bundle manager updated phase: %v" SupportBundleMsgDeleting = "Deleting support bundle manager" SupportBundleMsgPurging = "Purging failed support bundle" )
const ( SystemBackupControllerName = "longhorn-system-backup" SystemBackupTempDir = "/tmp" SystemBackupErrArchive = "failed to archive system backup file" SystemBackupErrDelete = "failed to delete system backup in backup target" SystemBackupErrGenerate = "failed to generate system backup file" SystemBackupErrGenerateYAML = "failed to generate resource YAMLs" SystemBackupErrGetFmt = "failed to get %v" SystemBackupErrGetConfig = "failed to get system backup config" SystemBackupErrMkdir = "failed to create system backup file directory" SystemBackupErrRemoveAll = "failed to remove system backup directory" SystemBackupErrRemove = "failed to remove system backup file" SystemBackupErrOSStat = "failed to compute system backup file size" SystemBackupErrSync = "failed to sync from backup target" SystemBackupErrTimeoutUpload = "timeout uploading system backup" SystemBackupErrUpload = "failed to upload system backup file" SystemBackupErrVolumeBackup = "failed to backup volumes" SystemBackupMsgCreatedArchieveFmt = "Created system backup file: %v" SystemBackupMsgDeletingRemote = "Deleting system backup in backup target" SystemBackupMsgDeleted = "Deleted system backup" SystemBackupMsgRequeueNextPhaseFmt = "Requeue %v for next phase: %v" SystemBackupMsgStarting = "Starting system backup" SystemBackupMsgSyncedBackupTarget = "Synced system backup from backup target" SystemBackupMsgSyncingBackupTarget = "Syncing system backup from backup target" SystemBackupMsgUploadBackupTarget = "Uploaded system backup to backup target" )
const ( SystemRestoreControllerName = "longhorn-system-restore" RestoreJobBackoffLimit = 3 SystemRestoreErrJobCreate = "failed to create system restore Job" SystemRestoreMsgJobCreatedFmt = "Created system restore Job %v" SystemRestoreMsgDeleting = "Deleting SystemRestore" )
const ( SystemRolloutControllerName = "longhorn-system-rollout" SystemRolloutNamePrefix = "longhorn-system-rollout-" SystemRolloutErrFailedConvertToObjectFmt = "failed converting %v to %v object" SystemRolloutErrFailedToCreateFmt = "failed to create item: %v %v" SystemRolloutErrMissingDependencyFmt = "cannot rollout %v due to missing dependency: %v %v" SystemRolloutMsgDownloadedFmt = "Downloaded from %v" SystemRolloutMsgIdentical = "identical" SystemRolloutMsgInitializedFmt = "Initialized system rollout for %v" SystemRolloutMsgRestoringFmt = "Restoring %v" SystemRolloutMsgRequeueNextPhaseFmt = "Requeue for next phase: %v" SystemRolloutMsgRequeueDueToFmt = "Requeue due to %v" SystemRolloutMsgUnpackedFmt = "Unpacked %v" SystemRolloutMsgCompleted = "System rollout completed" SystemRolloutMsgCreating = "System rollout creating" SystemRolloutMsgIgnoreItemFmt = "System rollout ignoring item: %v" SystemRolloutMsgRestoredItem = "System rollout restored item" SystemRolloutMsgRestoredKindFmt = "System rollout restored Kind: %v" SystemRolloutMsgUpdating = "System rollout updating" )
const ( CRDEngineName = "engines.longhorn.io" CRDReplicaName = "replicas.longhorn.io" CRDVolumeName = "volumes.longhorn.io" CRDEngineImageName = "engineimages.longhorn.io" CRDNodeName = "nodes.longhorn.io" CRDInstanceManagerName = "instancemanagers.longhorn.io" CRDBackingImageName = "backingimages.longhorn.io" CRDBackingImageManagerName = "backingimagemanagers.longhorn.io" CRDBackingImageDataSourceName = "backingimagedatasources.longhorn.io" CRDBackupTargetName = "backuptargets.longhorn.io" CRDBackupVolumeName = "backupvolumes.longhorn.io" CRDBackupName = "backups.longhorn.io" CRDRecurringJobName = "recurringjobs.longhorn.io" CRDOrphanName = "orphans.longhorn.io" CRDSnapshotName = "snapshots.longhorn.io" EnvLonghornNamespace = "LONGHORN_NAMESPACE" )
const ( CronJobBackoffLimit = 3 VolumeSnapshotsWarningThreshold = 100 LastAppliedCronJobSpecAnnotationKeySuffix = "last-applied-cronjob-spec" )
const (
BackingImageDataSourcePodContainerName = "backing-image-data-source"
)
const (
BackingImageManagerPodContainerName = "backing-image-manager"
)
const (
ConflictRetryCount = 5
)
const ITERATE_NAME_LIMIT = 5
const (
KubernetesEndpointControllerName = "kubernetes-endpoint-controller"
)
const (
MessageTypeReconcileInfo = "info"
)
Variables ¶
var ( EnginePollInterval = 5 * time.Second EnginePollTimeout = 30 * time.Second EngineMonitorConflictRetryCount = 5 )
var ( RetryInterval = 100 * time.Millisecond RetryCounts = 20 AutoSalvageTimeLimit = 1 * time.Minute )
var (
ExpiredEngineImageTimeout = 60 * time.Minute
)
var (
SystemRolloutMsgSkipIdentical = fmt.Sprintf(SystemRolloutMsgIgnoreItemFmt, SystemRolloutMsgIdentical)
)
var (
Workers = 5
)
Functions ¶
func BackingImageDiskFileCleanup ¶ added in v1.2.0
func BackingImageDiskFileCleanup(node *longhorn.Node, bi *longhorn.BackingImage, bids *longhorn.BackingImageDataSource, waitInterval time.Duration, minNumberOfCopies int)
func EnhancedDefaultControllerRateLimiter ¶ added in v0.8.0
func EnhancedDefaultControllerRateLimiter() workqueue.TypedRateLimiter[any]
EnhancedDefaultControllerRateLimiter is an enhanced version of workqueue.DefaultControllerRateLimiter() See https://github.com/longhorn/longhorn/issues/1058 for details
func GetBinaryClientForEngine ¶ added in v1.3.0
func GetBinaryClientForEngine(e *longhorn.Engine, engines engineapi.EngineClientCollection, image string) (client *engineapi.EngineBinary, err error)
func GetInstanceManagerCPURequirement ¶ added in v1.1.1
func GetInstanceManagerCPURequirement(ds *datastore.DataStore, imName string) (*corev1.ResourceRequirements, error)
GetInstanceManagerCPURequirement returns the instance manager CPU requirement
func GetSupportBundleManagerName ¶ added in v1.4.0
func GetSupportBundleManagerName(supportBundle *longhorn.SupportBundle) string
func IsRebuildingReplica ¶ added in v1.2.1
func IsSameGuaranteedCPURequirement ¶ added in v1.0.0
func IsSameGuaranteedCPURequirement(a, b *corev1.ResourceRequirements) bool
IsSameGuaranteedCPURequirement returns true if the resource requirement a is equal to the resource requirement b
func IsValidForExpansion ¶ added in v1.4.0
func ParseResourceRequirement ¶ added in v1.1.1
func ParseResourceRequirement(val string) (*corev1.ResourceRequirements, error)
Types ¶
type BackingImageController ¶ added in v1.1.1
type BackingImageController struct {
// contains filtered or unexported fields
}
func NewBackingImageController ¶ added in v1.1.1
func (*BackingImageController) IsBackingImageDataSourceCleaned ¶ added in v1.3.3
func (bic *BackingImageController) IsBackingImageDataSourceCleaned(bi *longhorn.BackingImage) (cleaned bool, err error)
func (*BackingImageController) Run ¶ added in v1.1.1
func (bic *BackingImageController) Run(workers int, stopCh <-chan struct{})
type BackingImageDataSourceController ¶ added in v1.2.0
type BackingImageDataSourceController struct {
// contains filtered or unexported fields
}
func NewBackingImageDataSourceController ¶ added in v1.2.0
func (*BackingImageDataSourceController) Run ¶ added in v1.2.0
func (c *BackingImageDataSourceController) Run(workers int, stopCh <-chan struct{})
type BackingImageDataSourceMonitor ¶ added in v1.2.0
type BackingImageDataSourceMonitor struct { Name string // contains filtered or unexported fields }
type BackingImageManagerController ¶ added in v1.1.1
type BackingImageManagerController struct {
// contains filtered or unexported fields
}
func NewBackingImageManagerController ¶ added in v1.1.1
func (*BackingImageManagerController) Run ¶ added in v1.1.1
func (c *BackingImageManagerController) Run(workers int, stopCh <-chan struct{})
type BackingImageManagerMonitor ¶ added in v1.1.1
type BackingImageManagerMonitor struct { Name string // contains filtered or unexported fields }
func (*BackingImageManagerMonitor) Run ¶ added in v1.1.1
func (m *BackingImageManagerMonitor) Run()
type BackupBackingImageController ¶ added in v1.6.0
type BackupBackingImageController struct {
// contains filtered or unexported fields
}
func NewBackupBackingImageController ¶ added in v1.6.0
func (*BackupBackingImageController) Run ¶ added in v1.6.0
func (bc *BackupBackingImageController) Run(workers int, stopCh <-chan struct{})
type BackupController ¶ added in v1.2.0
type BackupController struct {
// contains filtered or unexported fields
}
func NewBackupController ¶ added in v1.2.0
func (*BackupController) Run ¶ added in v1.2.0
func (bc *BackupController) Run(workers int, stopCh <-chan struct{})
func (*BackupController) VerifyAttachment ¶ added in v1.5.0
func (bc *BackupController) VerifyAttachment(backup *longhorn.Backup, volumeName string) (bool, error)
VerifyAttachment check the volume attachment ticket for this backup is satisfied
type BackupStoreTimer ¶ added in v1.2.0
type BackupStoreTimer struct {
// contains filtered or unexported fields
}
func (*BackupStoreTimer) Start ¶ added in v1.2.0
func (bst *BackupStoreTimer) Start()
func (*BackupStoreTimer) Stop ¶ added in v1.2.0
func (bst *BackupStoreTimer) Stop()
type BackupTargetController ¶ added in v1.2.0
type BackupTargetController struct {
// contains filtered or unexported fields
}
func NewBackupTargetController ¶ added in v1.2.0
func (*BackupTargetController) Run ¶ added in v1.2.0
func (btc *BackupTargetController) Run(workers int, stopCh <-chan struct{})
type BackupVolumeController ¶ added in v1.2.0
type BackupVolumeController struct {
// contains filtered or unexported fields
}
func NewBackupVolumeController ¶ added in v1.2.0
func (*BackupVolumeController) Run ¶ added in v1.2.0
func (bvc *BackupVolumeController) Run(workers int, stopCh <-chan struct{})
type CheckUpgradeExtraInfo ¶ added in v1.5.0
type CheckUpgradeExtraInfo interface { }
type CheckUpgradeRequest ¶ added in v0.3.2
type CheckUpgradeRequest struct { AppVersion string `json:"appVersion"` ExtraTagInfo CheckUpgradeExtraInfo `json:"extraTagInfo"` ExtraFieldInfo CheckUpgradeExtraInfo `json:"extraFieldInfo"` }
type CheckUpgradeResponse ¶ added in v0.3.2
type CheckUpgradeResponse struct {
Versions []Version `json:"versions"`
}
type ClusterInfo ¶ added in v1.5.0
type ClusterInfo struct {
// contains filtered or unexported fields
}
ClusterInfo struct is used to collect information about the cluster. This provides additional usage metrics to https://metrics.longhorn.io.
type ClusterInfoStructFields ¶ added in v1.5.0
type ClusterInfoStructFields struct {
// contains filtered or unexported fields
}
type EngineController ¶
type EngineController struct {
// contains filtered or unexported fields
}
func NewEngineController ¶
func (*EngineController) CreateInstance ¶ added in v0.6.0
func (ec *EngineController) CreateInstance(obj interface{}) (*longhorn.InstanceProcess, error)
func (*EngineController) DeleteInstance ¶ added in v0.6.0
func (ec *EngineController) DeleteInstance(obj interface{}) (err error)
func (*EngineController) GetInstance ¶ added in v0.6.0
func (ec *EngineController) GetInstance(obj interface{}) (*longhorn.InstanceProcess, error)
func (*EngineController) LogInstance ¶ added in v0.6.0
func (ec *EngineController) LogInstance(ctx context.Context, obj interface{}) (*engineapi.InstanceManagerClient, *imapi.LogStream, error)
func (*EngineController) ReconcileEngineState ¶
func (ec *EngineController) ReconcileEngineState(e *longhorn.Engine) error
func (*EngineController) Run ¶
func (ec *EngineController) Run(workers int, stopCh <-chan struct{})
func (*EngineController) UpgradeEngineInstance ¶ added in v1.5.0
type EngineImageController ¶
type EngineImageController struct {
// contains filtered or unexported fields
}
func (*EngineImageController) ResolveRefAndEnqueue ¶
func (ic *EngineImageController) ResolveRefAndEnqueue(namespace string, ref *metav1.OwnerReference)
func (*EngineImageController) Run ¶
func (ic *EngineImageController) Run(workers int, stopCh <-chan struct{})
type EngineMonitor ¶
type EngineMonitor struct { Name string // contains filtered or unexported fields }
func (*EngineMonitor) Run ¶
func (m *EngineMonitor) Run()
type GetRuntimeObjectListFunc ¶ added in v1.4.0
type InstanceHandler ¶
type InstanceHandler struct {
// contains filtered or unexported fields
}
InstanceHandler can handle the state transition of correlated instance and engine/replica object. It assumed the instance it's going to operate with is using the SAME NAME from the engine/replica object
func NewInstanceHandler ¶
func NewInstanceHandler(ds *datastore.DataStore, instanceManagerHandler InstanceManagerHandler, eventRecorder record.EventRecorder) *InstanceHandler
func (*InstanceHandler) ReconcileInstanceState ¶
func (h *InstanceHandler) ReconcileInstanceState(obj interface{}, spec *longhorn.InstanceSpec, status *longhorn.InstanceStatus) (err error)
type InstanceManagerController ¶ added in v0.6.0
type InstanceManagerController struct {
// contains filtered or unexported fields
}
func NewInstanceManagerController ¶ added in v0.6.0
func (*InstanceManagerController) Run ¶ added in v0.6.0
func (imc *InstanceManagerController) Run(workers int, stopCh <-chan struct{})
type InstanceManagerHandler ¶ added in v0.6.0
type InstanceManagerHandler interface { GetInstance(obj interface{}) (*longhorn.InstanceProcess, error) CreateInstance(obj interface{}) (*longhorn.InstanceProcess, error) DeleteInstance(obj interface{}) error LogInstance(ctx context.Context, obj interface{}) (*engineapi.InstanceManagerClient, *imapi.LogStream, error) }
type InstanceManagerMonitor ¶ added in v0.6.0
type InstanceManagerMonitor struct { Name string // contains filtered or unexported fields }
func (*InstanceManagerMonitor) CheckMonitorStoppedWithLock ¶ added in v1.1.2
func (m *InstanceManagerMonitor) CheckMonitorStoppedWithLock() bool
func (*InstanceManagerMonitor) Run ¶ added in v0.6.0
func (m *InstanceManagerMonitor) Run()
func (*InstanceManagerMonitor) StopMonitorWithLock ¶ added in v1.1.2
func (m *InstanceManagerMonitor) StopMonitorWithLock()
type KubernetesConfigMapController ¶ added in v1.1.0
type KubernetesConfigMapController struct {
// contains filtered or unexported fields
}
func NewKubernetesConfigMapController ¶ added in v1.1.0
func (*KubernetesConfigMapController) Run ¶ added in v1.1.0
func (kc *KubernetesConfigMapController) Run(workers int, stopCh <-chan struct{})
type KubernetesEndpointController ¶ added in v1.7.0
type KubernetesEndpointController struct {
// contains filtered or unexported fields
}
func NewKubernetesEndpointController ¶ added in v1.7.0
func NewKubernetesEndpointController( logger logrus.FieldLogger, ds *datastore.DataStore, kubeClient clientset.Interface, controllerID string, namespace string) (*KubernetesEndpointController, error)
func (*KubernetesEndpointController) Run ¶ added in v1.7.0
func (c *KubernetesEndpointController) Run(workers int, stopCh <-chan struct{})
type KubernetesNodeController ¶ added in v0.8.1
type KubernetesNodeController struct {
// contains filtered or unexported fields
}
func NewKubernetesNodeController ¶ added in v0.8.1
func (*KubernetesNodeController) Run ¶ added in v0.8.1
func (knc *KubernetesNodeController) Run(workers int, stopCh <-chan struct{})
type KubernetesPDBController ¶ added in v1.3.3
type KubernetesPDBController struct {
// contains filtered or unexported fields
}
func NewKubernetesPDBController ¶ added in v1.3.3
func NewKubernetesPDBController( logger logrus.FieldLogger, ds *datastore.DataStore, kubeClient clientset.Interface, controllerID string, namespace string) (*KubernetesPDBController, error)
func (*KubernetesPDBController) Run ¶ added in v1.3.3
func (pc *KubernetesPDBController) Run(workers int, stopCh <-chan struct{})
type KubernetesPVController ¶ added in v0.8.1
type KubernetesPVController struct {
// contains filtered or unexported fields
}
func NewKubernetesPVController ¶ added in v0.8.1
func (*KubernetesPVController) Run ¶ added in v0.8.1
func (kc *KubernetesPVController) Run(workers int, stopCh <-chan struct{})
type KubernetesPodController ¶ added in v1.1.0
type KubernetesPodController struct {
// contains filtered or unexported fields
}
func NewKubernetesPodController ¶ added in v1.1.0
func (*KubernetesPodController) Run ¶ added in v1.1.0
func (kc *KubernetesPodController) Run(workers int, stopCh <-chan struct{})
type KubernetesSecretController ¶ added in v1.1.1
type KubernetesSecretController struct {
// contains filtered or unexported fields
}
func NewKubernetesSecretController ¶ added in v1.1.1
func (*KubernetesSecretController) Run ¶ added in v1.1.1
func (ks *KubernetesSecretController) Run(workers int, stopCh <-chan struct{})
type NodeController ¶
type NodeController struct {
// contains filtered or unexported fields
}
func NewNodeController ¶
func (*NodeController) Run ¶
func (nc *NodeController) Run(workers int, stopCh <-chan struct{})
type OrphanController ¶ added in v1.3.0
type OrphanController struct {
// contains filtered or unexported fields
}
func NewOrphanController ¶ added in v1.3.0
func (*OrphanController) DeleteV2ReplicaInstance ¶ added in v1.7.0
func (oc *OrphanController) DeleteV2ReplicaInstance(diskName, diskUUID, diskDriver, replicaInstanceName string) (err error)
func (*OrphanController) Run ¶ added in v1.3.0
func (oc *OrphanController) Run(workers int, stopCh <-chan struct{})
type RecurringJobController ¶ added in v1.2.0
type RecurringJobController struct { ManagerImage string // contains filtered or unexported fields }
func NewRecurringJobController ¶ added in v1.2.0
func (*RecurringJobController) Run ¶ added in v1.2.0
func (c *RecurringJobController) Run(workers int, stopCh <-chan struct{})
type ReplicaController ¶
type ReplicaController struct {
// contains filtered or unexported fields
}
func NewReplicaController ¶
func (*ReplicaController) CanStartRebuildingReplica ¶ added in v1.2.1
func (rc *ReplicaController) CanStartRebuildingReplica(r *longhorn.Replica) (bool, error)
func (*ReplicaController) CreateInstance ¶ added in v0.6.0
func (rc *ReplicaController) CreateInstance(obj interface{}) (*longhorn.InstanceProcess, error)
func (*ReplicaController) DeleteInstance ¶ added in v0.6.0
func (rc *ReplicaController) DeleteInstance(obj interface{}) (err error)
func (*ReplicaController) GetBackingImagePathForReplicaStarting ¶ added in v1.2.1
func (rc *ReplicaController) GetBackingImagePathForReplicaStarting(r *longhorn.Replica) (string, error)
func (*ReplicaController) GetInstance ¶ added in v0.6.0
func (rc *ReplicaController) GetInstance(obj interface{}) (*longhorn.InstanceProcess, error)
func (*ReplicaController) LogInstance ¶ added in v0.6.0
func (rc *ReplicaController) LogInstance(ctx context.Context, obj interface{}) (*engineapi.InstanceManagerClient, *imapi.LogStream, error)
func (*ReplicaController) Run ¶
func (rc *ReplicaController) Run(workers int, stopCh <-chan struct{})
type SettingController ¶ added in v0.3.2
type SettingController struct {
// contains filtered or unexported fields
}
func NewSettingController ¶ added in v0.3.2
func NewSettingController( logger logrus.FieldLogger, ds *datastore.DataStore, scheme *runtime.Scheme, kubeClient clientset.Interface, metricsClient metricsclientset.Interface, namespace, controllerID, version string) (*SettingController, error)
func (*SettingController) CheckLatestAndStableLonghornVersions ¶ added in v1.2.1
func (sc *SettingController) CheckLatestAndStableLonghornVersions() (string, string, error)
func (*SettingController) GetCheckUpgradeRequestExtraInfo ¶ added in v1.5.0
func (sc *SettingController) GetCheckUpgradeRequestExtraInfo() (extraTagInfo CheckUpgradeExtraInfo, extraFieldInfo CheckUpgradeExtraInfo, err error)
func (*SettingController) Run ¶ added in v0.3.2
func (sc *SettingController) Run(stopCh <-chan struct{})
type ShareManagerController ¶ added in v1.1.0
type ShareManagerController struct {
// contains filtered or unexported fields
}
func NewShareManagerController ¶ added in v1.1.0
func (*ShareManagerController) Run ¶ added in v1.1.0
func (c *ShareManagerController) Run(workers int, stopCh <-chan struct{})
type SimpleResourceEventHandler ¶
type SimpleResourceEventHandler struct{ ChangeFunc func() }
func (SimpleResourceEventHandler) OnAdd ¶
func (s SimpleResourceEventHandler) OnAdd(obj interface{}, isInInitialList bool)
func (SimpleResourceEventHandler) OnDelete ¶
func (s SimpleResourceEventHandler) OnDelete(obj interface{})
func (SimpleResourceEventHandler) OnUpdate ¶
func (s SimpleResourceEventHandler) OnUpdate(oldObj, newObj interface{})
type SnapshotController ¶ added in v1.3.0
type SnapshotController struct {
// contains filtered or unexported fields
}
func NewSnapshotController ¶ added in v1.3.0
func (*SnapshotController) Run ¶ added in v1.3.0
func (sc *SnapshotController) Run(workers int, stopCh <-chan struct{})
type SupportBundleController ¶ added in v1.4.0
type SupportBundleController struct {
// contains filtered or unexported fields
}
func NewSupportBundleController ¶ added in v1.4.0
func (*SupportBundleController) Run ¶ added in v1.4.0
func (c *SupportBundleController) Run(workers int, stopCh <-chan struct{})
type SupportBundleManager ¶ added in v1.4.0
type SupportBundleManager struct {
// contains filtered or unexported fields
}
type SupportBundleManagerPhase ¶ added in v1.4.0
type SupportBundleManagerPhase string
type SupportBundleManagerStatus ¶ added in v1.4.0
type SystemBackupController ¶ added in v1.4.0
type SystemBackupController struct {
// contains filtered or unexported fields
}
func NewSystemBackupController ¶ added in v1.4.0
func (*SystemBackupController) BackupBackingImage ¶ added in v1.7.0
func (c *SystemBackupController) BackupBackingImage() (map[string]*longhorn.BackupBackingImage, error)
func (*SystemBackupController) BackupVolumes ¶ added in v1.5.0
func (c *SystemBackupController) BackupVolumes(systemBackup *longhorn.SystemBackup) (map[string]*longhorn.Backup, error)
func (*SystemBackupController) GenerateSystemBackup ¶ added in v1.4.0
func (c *SystemBackupController) GenerateSystemBackup(systemBackup *longhorn.SystemBackup, archievePath, tempDir string)
func (*SystemBackupController) InitSystemBackup ¶ added in v1.4.0
func (c *SystemBackupController) InitSystemBackup(systemBackup *longhorn.SystemBackup, log logrus.FieldLogger) error
func (*SystemBackupController) LogErrorState ¶ added in v1.4.0
func (c *SystemBackupController) LogErrorState(record *systemBackupRecord, systemBackup *longhorn.SystemBackup, log logrus.FieldLogger)
func (*SystemBackupController) LogNormalState ¶ added in v1.4.0
func (c *SystemBackupController) LogNormalState(record *systemBackupRecord, systemBackup *longhorn.SystemBackup, log logrus.FieldLogger)
func (*SystemBackupController) Run ¶ added in v1.4.0
func (c *SystemBackupController) Run(workers int, stopCh <-chan struct{})
func (*SystemBackupController) UploadSystemBackup ¶ added in v1.4.0
func (c *SystemBackupController) UploadSystemBackup(systemBackup *longhorn.SystemBackup, archievePath, tempDir string, backupTargetClient engineapi.SystemBackupOperationInterface)
func (*SystemBackupController) WaitForBackingImageBackupToComplete ¶ added in v1.7.0
func (c *SystemBackupController) WaitForBackingImageBackupToComplete(backupBackingImages map[string]*longhorn.BackupBackingImage, systemBackup *longhorn.SystemBackup)
func (*SystemBackupController) WaitForVolumeBackupToComplete ¶ added in v1.5.0
func (c *SystemBackupController) WaitForVolumeBackupToComplete(backups map[string]*longhorn.Backup, systemBackup *longhorn.SystemBackup) (err error)
type SystemRestoreController ¶ added in v1.4.0
type SystemRestoreController struct {
// contains filtered or unexported fields
}
func NewSystemRestoreController ¶ added in v1.4.0
func (*SystemRestoreController) CreateSystemRestoreJob ¶ added in v1.4.0
func (c *SystemRestoreController) CreateSystemRestoreJob(systemRestore *longhorn.SystemRestore, backupTargetClient engineapi.SystemBackupOperationInterface) (*batchv1.Job, error)
func (*SystemRestoreController) LogErrorState ¶ added in v1.4.0
func (c *SystemRestoreController) LogErrorState(record *systemRestoreRecord, systemRestore *longhorn.SystemRestore, log logrus.FieldLogger)
func (*SystemRestoreController) LogNormalState ¶ added in v1.4.0
func (c *SystemRestoreController) LogNormalState(record *systemRestoreRecord, systemRestore *longhorn.SystemRestore, log logrus.FieldLogger)
func (*SystemRestoreController) Run ¶ added in v1.4.0
func (c *SystemRestoreController) Run(workers int, stopCh <-chan struct{})
type SystemRolloutController ¶ added in v1.4.0
type SystemRolloutController struct {
// contains filtered or unexported fields
}
func NewSystemRolloutController ¶ added in v1.4.0
func NewSystemRolloutController( systemRestoreName string, logger logrus.FieldLogger, controllerID string, ds *datastore.DataStore, scheme *runtime.Scheme, stopCh chan struct{}, kubeClient clientset.Interface, extensionsClient apiextensionsclientset.Interface, ) (*SystemRolloutController, error)
func (*SystemRolloutController) Download ¶ added in v1.4.0
func (c *SystemRolloutController) Download(log logrus.FieldLogger) error
func (*SystemRolloutController) GetSystemBackupURL ¶ added in v1.4.0
func (c *SystemRolloutController) GetSystemBackupURL() (string, error)
func (*SystemRolloutController) Run ¶ added in v1.4.0
func (c *SystemRolloutController) Run() error
func (*SystemRolloutController) Unpack ¶ added in v1.4.0
func (c *SystemRolloutController) Unpack(log logrus.FieldLogger) error
type TopologyLabelsChecker ¶ added in v0.8.0
type UninstallController ¶ added in v0.3.2
type UninstallController struct {
// contains filtered or unexported fields
}
func NewUninstallController ¶ added in v0.3.2
func NewUninstallController( logger logrus.FieldLogger, namespace string, force bool, ds *datastore.DataStore, stopCh chan struct{}, kubeClient clientset.Interface, extensionsClient apiextensionsclientset.Interface, ) (*UninstallController, error)
func (*UninstallController) Run ¶ added in v0.3.2
func (c *UninstallController) Run() error
type VolumeAttachmentController ¶ added in v1.5.0
type VolumeAttachmentController struct {
// contains filtered or unexported fields
}
func NewLonghornVolumeAttachmentController ¶ added in v1.5.0
func (*VolumeAttachmentController) Run ¶ added in v1.5.0
func (vac *VolumeAttachmentController) Run(workers int, stopCh <-chan struct{})
type VolumeCloneController ¶ added in v1.5.0
type VolumeCloneController struct {
// contains filtered or unexported fields
}
func NewVolumeCloneController ¶ added in v1.5.0
func (*VolumeCloneController) Run ¶ added in v1.5.0
func (vcc *VolumeCloneController) Run(workers int, stopCh <-chan struct{})
type VolumeController ¶
type VolumeController struct {
// contains filtered or unexported fields
}
func NewVolumeController ¶
func (*VolumeController) EvictReplicas ¶ added in v1.1.0
func (c *VolumeController) EvictReplicas(v *longhorn.Volume, e *longhorn.Engine, rs map[string]*longhorn.Replica, healthyCount int) (err error)
EvictReplicas do creating one more replica for eviction, if requested
func (*VolumeController) IsReplicaUnavailable ¶ added in v1.2.1
func (c *VolumeController) IsReplicaUnavailable(r *longhorn.Replica) (bool, error)
func (*VolumeController) ReconcileBackupVolumeState ¶ added in v1.2.0
func (c *VolumeController) ReconcileBackupVolumeState(volume *longhorn.Volume) error
ReconcileBackupVolumeState is responsible for syncing the state of backup volumes to volume.status
func (*VolumeController) ReconcileEngineReplicaState ¶
func (c *VolumeController) ReconcileEngineReplicaState(v *longhorn.Volume, es map[string]*longhorn.Engine, rs map[string]*longhorn.Replica) (err error)
ReconcileEngineReplicaState will get the current main engine e.Status.ReplicaModeMap, e.Status.RestoreStatus, e.Status.purgeStatus, and e.Status.SnapshotCloneStatus then update v and rs accordingly.
func (*VolumeController) ReconcilePersistentVolume ¶ added in v1.4.3
func (c *VolumeController) ReconcilePersistentVolume(volume *longhorn.Volume) error
ReconcilePersistentVolume is responsible for syncing the state with the PersistentVolume
func (*VolumeController) ReconcileShareManagerState ¶ added in v1.1.0
func (c *VolumeController) ReconcileShareManagerState(volume *longhorn.Volume) error
ReconcileShareManagerState is responsible for syncing the state of shared volumes with their share manager
func (*VolumeController) ReconcileVolumeState ¶
func (c *VolumeController) ReconcileVolumeState(v *longhorn.Volume, es map[string]*longhorn.Engine, rs map[string]*longhorn.Replica) (err error)
ReconcileVolumeState handles the attaching and detaching of volume
func (*VolumeController) ResolveRefAndEnqueue ¶
func (c *VolumeController) ResolveRefAndEnqueue(namespace string, ref *metav1.OwnerReference)
func (*VolumeController) Run ¶
func (c *VolumeController) Run(workers int, stopCh <-chan struct{})
type VolumeEvictionController ¶ added in v1.5.0
type VolumeEvictionController struct {
// contains filtered or unexported fields
}
func NewVolumeEvictionController ¶ added in v1.5.0
func (*VolumeEvictionController) Run ¶ added in v1.5.0
func (vec *VolumeEvictionController) Run(workers int, stopCh <-chan struct{})
type VolumeExpansionController ¶ added in v1.5.0
type VolumeExpansionController struct {
// contains filtered or unexported fields
}
func NewVolumeExpansionController ¶ added in v1.5.0
func (*VolumeExpansionController) Run ¶ added in v1.5.0
func (vec *VolumeExpansionController) Run(workers int, stopCh <-chan struct{})
type VolumeRebuildingController ¶ added in v1.5.0
type VolumeRebuildingController struct {
// contains filtered or unexported fields
}
func NewVolumeRebuildingController ¶ added in v1.5.0
func (*VolumeRebuildingController) Run ¶ added in v1.5.0
func (vbc *VolumeRebuildingController) Run(workers int, stopCh <-chan struct{})
type VolumeRestoreController ¶ added in v1.5.0
type VolumeRestoreController struct {
// contains filtered or unexported fields
}
func NewVolumeRestoreController ¶ added in v1.5.0
func (*VolumeRestoreController) Run ¶ added in v1.5.0
func (vrsc *VolumeRestoreController) Run(workers int, stopCh <-chan struct{})
type WebsocketController ¶
type WebsocketController struct {
// contains filtered or unexported fields
}
func NewWebsocketController ¶
func NewWebsocketController( logger logrus.FieldLogger, ds *datastore.DataStore, ) (*WebsocketController, error)
func StartControllers ¶
func StartControllers(logger logrus.FieldLogger, clients *client.Clients, controllerID, serviceAccount, managerImage, backingImageManagerImage, shareManagerImage, kubeconfigPath, version string, proxyConnCounter util.Counter) (*WebsocketController, error)
StartControllers initiates all Longhorn component controllers and monitors to manage the creating, updating, and deletion of Longhorn resources
func (*WebsocketController) Close ¶
func (wc *WebsocketController) Close()
func (*WebsocketController) NewWatcher ¶
func (wc *WebsocketController) NewWatcher(resources ...string) *Watcher
func (*WebsocketController) Run ¶
func (wc *WebsocketController) Run(stopCh <-chan struct{})
Source Files ¶
- backing_image_controller.go
- backing_image_data_source_controller.go
- backing_image_manager_controller.go
- backup_backing_image_controller.go
- backup_controller.go
- backup_target_controller.go
- backup_volume_controller.go
- base_controller.go
- controller_manager.go
- engine_controller.go
- engine_image_controller.go
- instance_handler.go
- instance_manager_controller.go
- kubernetes_configmap_controller.go
- kubernetes_endpoint_controller.go
- kubernetes_node_controller.go
- kubernetes_pdb_controller.go
- kubernetes_pod_controller.go
- kubernetes_pv_controller.go
- kubernetes_secret_controller.go
- node_controller.go
- orphan_controller.go
- recurring_job_controller.go
- replica_controller.go
- setting_controller.go
- share_manager_controller.go
- snapshot_controller.go
- support_bundle_controller.go
- system_backup_controller.go
- system_restore_controller.go
- system_rollout_controller.go
- uninstall_controller.go
- utils.go
- volume_attachment_controller.go
- volume_clone_controller.go
- volume_controller.go
- volume_eviction_controller.go
- volume_expansion_controller.go
- volume_rebuilding_controller.go
- volume_restore_controller.go
- websocket_controller.go