Documentation
¶
Index ¶
Constants ¶
const ( VolumeEvacuatingEvent = "VolumeEvacuating" VolumeTemporarilyMadeReschedulableEvent = "VolumeTemporarilyMadeReschedulable" VolumeDeletedForEvacuationEvent = "VolumeDeletedForEvacuation" VolumeNotAttachedForEvacuationEvent = "VolumeNotAttachedForEvacuation" VolumeAttachedForEvacuationEvent = "VolumeAttachedForEvacuation" )
const SatelliteEvacuatedCondition = "SatelliteEvacuated"
SatelliteEvacuatedCondition tracks the progress of evacuating volumes off a Satellite.
Variables ¶
This section is empty.
Functions ¶
func AttachmentsByPV ¶ added in v2.10.2
func AttachmentsByPV(attachments []storagev1.VolumeAttachment) map[string]*storagev1.VolumeAttachment
func PVsByLinstorResource ¶ added in v2.10.2
func PVsByLinstorResource(pvs []corev1.PersistentVolume) map[string]*corev1.PersistentVolume
PVsByLinstorResource converts a list of PersistentVolumes to a map of LINSTOR Resource Names -> Persistent Volumes
Types ¶
type Evacuator ¶ added in v2.11.0
type Evacuator struct {
// Client reads and updates PVs, VolumeAttachments and LinstorSatellites.
Client client.Client
// Recorder records events on the affected PVCs/PVs.
Recorder record.EventRecorder
// MachineClient releases the ClusterAPI Machine drain/terminate hooks as evacuation progresses.
MachineClient *clusterapi.Client
// contains filtered or unexported fields
}
Evacuator moves LINSTOR resources off a Satellite that is being removed. It bundles the Kubernetes and ClusterAPI clients, which are stable for the lifetime of the reconciler; the per-cluster LINSTOR client is passed to EvacuateSatellite instead.
func (*Evacuator) EvacuateSatellite ¶ added in v2.11.0
func (e *Evacuator) EvacuateSatellite(ctx context.Context, lclient *lapi.Client, node *lapi.Node, machine *clusterapi.Machine, evacuationStrategy *piraeusiov1.EvacuationStrategy, conds conditions.Conditions, maxConcurrent int) (bool, error)
EvacuateSatellite ensures all LINSTOR Resources have been moved to other nodes, honoring the cluster-wide evacuation concurrency limit, and records the progress on the SatelliteEvacuatedCondition.
Returns true once evacuation is complete. The function should be called repeatedly until then.
type PVEvacuationAction ¶
type PVEvacuationAction string
const ( // PVEvacuationActionNone indicates the PV is ready for evacuation as-is. PVEvacuationActionNone PVEvacuationAction = "None" // PVEvacuationActionDelete indicates the PV and PVC should be deleted so that it gets recreated on draining the node. PVEvacuationActionDelete PVEvacuationAction = "Delete" // PVEvacuationActionAffinityOverride indicates the PV should be prepared for evacuation by setting a less strict affinity. PVEvacuationActionAffinityOverride PVEvacuationAction = "AffinityOverride" )