Documentation ¶
Index ¶
- Constants
- Variables
- func AllocClusterIndex(subCluster string) int
- func CleanClusterIndex()
- func ClusterIndexToSwitchType(x int) (SwitchType, SwitchType)
- func FreeClusterIndex(subCluster string) int
- func GenerateReadableKey(name string) string
- func GetAssignedNumas(state *CycleState) ([]int, error)
- func GetClusterIndex(subCluster string) int
- func GetEverScheduledState(state *CycleState) (bool, error)
- func GetGlobalSubClusterKey() string
- func GetIndexOfPDB(state *CycleState) (map[string]int, error)
- func GetMatchedPDBIndexes(state *CycleState) (map[string][]int, error)
- func GetNodeGroupKey(state *CycleState) (string, error)
- func GetNotScheduledPodKeysCountByTemplate(unitState *CycleState, ownerName string) (int, error)
- func GetOrCreateClusterIndex(subCluster string) (int, bool)
- func GetPDBsAllowed(state *CycleState) ([]int32, error)
- func GetPodGroupKey(podGroup *schedulingv1a1.PodGroup) (string, error)
- func GetPodKey(pod *v1.Pod) (string, error)
- func GetPodLauncher(state *CycleState) (podutil.PodLauncher, error)
- func GetPodPriority(pod *v1.Pod) int32
- func GetPodQos(pod *v1.Pod) podutil.PodResourceType
- func GetPodResourceType(state *CycleState) (podutil.PodResourceType, error)
- func GetPodSchedulingStageInCycleState(cycleState *CycleState, stage SchedulingStage) bool
- func GetPodSubCluster(pod *v1.Pod) string
- func GetPodTrace(state *CycleState) (tracing.SchedulingTrace, error)
- func GetPodsCanNotBePreempted(state *CycleState) ([]string, error)
- func GetSchedulingStagesState(states SchedulingStagesState, stage SchedulingStage) bool
- func GetUnitKey(pod *v1.Pod) string
- func IsConflictResourcesForDifferentQoS(resourceName v1.ResourceName) bool
- func MustConvertToMetricsLabels(property UnitProperty) metrics.Labels
- func NewPDBItemImpl(pdb *policy.PodDisruptionBudget) *pdbItemImpl
- func QuantityEqual(r1, r2 *resource.Quantity) bool
- func SetEverScheduledState(everScheduled bool, state *CycleState)
- func SetGlobalSubClusterKey(key string)
- func SetIndexOfPDB(pdbNameToIndexes map[string]int, state *CycleState)
- func SetMatchedPDBIndexes(victimKey string, indexes []int, state *CycleState) error
- func SetNodeGroupKeyState(nodeGroup string, state *CycleState) error
- func SetNotScheduledPodKeysByTemplate(notScheduledPodKeysByTemplate map[string]sets.String, unitState *CycleState) error
- func SetPDBItems(pdbItems []PDBItem, state *CycleState) error
- func SetPDBsAllowed(pdbsAllowed []int32, state *CycleState) error
- func SetPodLauncherState(podLauncher podutil.PodLauncher, state *CycleState) error
- func SetPodProperty(p *PodProperty, state *CycleState)
- func SetPodResourceTypeState(resourceType podutil.PodResourceType, state *CycleState) error
- func SetPodSchedulingStageInCycleState(cycleState *CycleState, changedStage SchedulingStage, expectedExecute bool)
- func SetPodTrace(podTrace tracing.SchedulingTrace, state *CycleState) error
- func SetPodsCanNotBePreempted(podKey string, state *CycleState) error
- func TransferGenerationStore(cache, snapshot generationstore.Store) (generationstore.ListStore, generationstore.RawStore)
- func UnitRequireJobLevelAffinity(unit ScheduleUnit) bool
- type ActionType
- type AffinityTerm
- type BindPlugin
- type BinderFramework
- type CachePodInfo
- type CachePodInfoWrapper
- type CachePodState
- type CachedNominatedNodes
- func (cnn *CachedNominatedNodes) GetPodCount() int
- func (cnn *CachedNominatedNodes) GetUnusedNominatedNodes() []*Candidate
- func (cnn *CachedNominatedNodes) GetUsedNominatedNode() *Candidate
- func (cnn *CachedNominatedNodes) HasCrossNodeConstraints() *bool
- func (cnn *CachedNominatedNodes) IsEmpty() bool
- func (cnn *CachedNominatedNodes) RemoveOnePod()
- func (cnn *CachedNominatedNodes) SetHasCrossNodesConstraints(crossNodes bool)
- func (cnn *CachedNominatedNodes) SetPodCount(count int)
- func (cnn *CachedNominatedNodes) SetUnusedNominatedNodes(candidates []*Candidate)
- func (cnn *CachedNominatedNodes) SetUsedNominatedNode(candidate *Candidate)
- type Candidate
- type CandidatesSortingPlugin
- type CheckConflictsPlugin
- type CheckTopologyPlugin
- type ClusterEvent
- type ClusterNodeInfoGetter
- type ClusterNodeInfoLister
- type ClusterPrePreemptingPlugin
- type ClusterSharedLister
- type Code
- type CrossNodesPlugin
- type CycleState
- func (c *CycleState) Clone() *CycleState
- func (c *CycleState) Delete(key StateKey)
- func (c *CycleState) Read(key StateKey) (StateData, error)
- func (c *CycleState) SetRecordPluginMetrics(flag bool)
- func (c *CycleState) ShouldRecordPluginMetrics() bool
- func (c *CycleState) Write(key StateKey, val StateData)
- type FilterPlugin
- type FitError
- type GVK
- type GenerationPodGroup
- type GenerationPodGroupImpl
- func (i GenerationPodGroupImpl) Clone() GenerationPodGroup
- func (i *GenerationPodGroupImpl) GetGeneration() int64
- func (i *GenerationPodGroupImpl) GetPodGroup() *schedulingv1a1.PodGroup
- func (i *GenerationPodGroupImpl) SetGeneration(generation int64)
- func (i *GenerationPodGroupImpl) SetPodGroup(podgroup *schedulingv1a1.PodGroup)
- type GenerationStringSet
- type GenerationStringSetImpl
- func (s *GenerationStringSetImpl) Delete(strings ...string)
- func (s *GenerationStringSetImpl) Equal(store GenerationStringSet) bool
- func (s *GenerationStringSetImpl) GetGeneration() int64
- func (s *GenerationStringSetImpl) Has(string string) bool
- func (s *GenerationStringSetImpl) Insert(strings ...string)
- func (s *GenerationStringSetImpl) Len() int
- func (s *GenerationStringSetImpl) Range(f GenerationStringSetRangeFunc)
- func (s *GenerationStringSetImpl) Reset(store GenerationStringSet)
- func (s *GenerationStringSetImpl) SetGeneration(generation int64)
- func (s *GenerationStringSetImpl) Strings() []string
- type GenerationStringSetRangeFunc
- type GroupingPlugin
- type HostPortInfo
- type ImageStateSummary
- type LessFunc
- type LoadAwareNodeMetricInfo
- type LoadAwareNodeUsage
- type LocatingPlugin
- type MetaPod
- type MetaVictims
- type MovementDetailForPod
- type MovementDetailOnNode
- type MovementInfo
- func (mi *MovementInfo) AddAssumedPod(pod *v1.Pod, nodeName string)
- func (mi *MovementInfo) AddMovement(movement *schedulingv1a1.Movement)
- func (mi *MovementInfo) GetAvailableSuggestionTimesForNodes(ownerKey string) map[string]int64
- func (mi *MovementInfo) GetDeletedPodsFromMovement(movementName string) sets.String
- func (mi *MovementInfo) GetSuggestedMovementAndNodes(ownerKey string) map[string][]*MovementDetailOnNode
- func (mi *MovementInfo) RemoveAssumedPod(pod *v1.Pod, nodeName string)
- func (mi *MovementInfo) RemoveMovement(movement *schedulingv1a1.Movement)
- func (mi *MovementInfo) UpdateMovementInfo(snapshotMovementInfo *MovementInfo)
- type MovementState
- type MovementStateImpl
- func (movementState *MovementStateImpl) AddAssumedPod(podKey, ownerKey, nodeName string)
- func (movementState *MovementStateImpl) AddMovement(movement *schedulingv1a1.Movement)
- func (movementState *MovementStateImpl) DeleteMovement() bool
- func (movementState *MovementStateImpl) GetAlgorithmName() string
- func (movementState *MovementStateImpl) GetAvailableNodeSuggestions(ownerKey string) map[string]int64
- func (movementState *MovementStateImpl) GetCreationTimestamp() metav1.Time
- func (movementState *MovementStateImpl) GetDeletedPods() sets.String
- func (movementState *MovementStateImpl) GetGeneration() int64
- func (movementState *MovementStateImpl) GetNodesStillHaveSuggestion(ownerKey string) map[string]int64
- func (movementState *MovementStateImpl) GetOwnerList() []string
- func (movementState *MovementStateImpl) GetOwnerMovements() generationstore.Store
- func (movementState *MovementStateImpl) ProcessOwners(f func(string))
- func (movementState *MovementStateImpl) RemoveAssumedPod(podKey, ownerKey, nodeName string) bool
- func (movementState *MovementStateImpl) SetAlgorithmName(algorithm string)
- func (movementState *MovementStateImpl) SetCreationTimestamp(t metav1.Time)
- func (movementState *MovementStateImpl) SetDeletedPods(deletedPod []string)
- func (movementState *MovementStateImpl) SetGeneration(generation int64)
- func (movementState *MovementStateImpl) UpdateMovementState(snapshotMovementState MovementState)
- type NodeCircle
- type NodeCircleImpl
- type NodeCircleList
- type NodeGroup
- type NodeGroupImpl
- func (ng *NodeGroupImpl) GetKey() string
- func (ng *NodeGroupImpl) GetNodeCircles() NodeCircleList
- func (ng *NodeGroupImpl) GetPreferredNodes() PreferredNodes
- func (ng *NodeGroupImpl) SetNodeCircles(nodeCircleList NodeCircleList)
- func (ng *NodeGroupImpl) SetPreferredNodes(preferredNodes PreferredNodes)
- func (ng *NodeGroupImpl) Validate() error
- type NodeHashSlice
- type NodeHashSliceImpl
- type NodeInfo
- type NodeInfoGetterImpl
- type NodeInfoImpl
- func (n *NodeInfoImpl) AddPod(pod *v1.Pod)
- func (n *NodeInfoImpl) Clone() NodeInfo
- func (n *NodeInfoImpl) GetBestEffortAllocatable() *Resource
- func (n *NodeInfoImpl) GetBestEffortNonZeroRequested() *Resource
- func (n *NodeInfoImpl) GetBestEffortRequested() *Resource
- func (n *NodeInfoImpl) GetCNR() *katalystv1alpha1.CustomNodeResource
- func (n *NodeInfoImpl) GetGeneration() int64
- func (n *NodeInfoImpl) GetGuaranteedAllocatable() *Resource
- func (n *NodeInfoImpl) GetGuaranteedCapacity() *Resource
- func (n *NodeInfoImpl) GetGuaranteedNonZeroRequested() *Resource
- func (n *NodeInfoImpl) GetGuaranteedRequested() *Resource
- func (n *NodeInfoImpl) GetGuaranteedReserved() *Resource
- func (n *NodeInfoImpl) GetImageStates() map[string]*ImageStateSummary
- func (n *NodeInfoImpl) GetNMNode() *nodev1alpha1.NMNode
- func (n *NodeInfoImpl) GetNMNodeInSchedulerPartition() bool
- func (n *NodeInfoImpl) GetNode() *v1.Node
- func (n *NodeInfoImpl) GetNodeInSchedulerPartition() bool
- func (n *NodeInfoImpl) GetNodeLabels(podLauncher podutil.PodLauncher) map[string]string
- func (n *NodeInfoImpl) GetNodeName() string
- func (n *NodeInfoImpl) GetNumaTopologyStatus() *NumaTopologyStatus
- func (n *NodeInfoImpl) GetOccupiableResources(partitionInfo *PodPartitionInfo) *Resource
- func (n *NodeInfoImpl) GetPods() []*PodInfo
- func (n *NodeInfoImpl) GetPodsWithAffinity() []*PodInfo
- func (n *NodeInfoImpl) GetPodsWithRequiredAntiAffinity() []*PodInfo
- func (n *NodeInfoImpl) GetPrioritiesForPodsMayBePreempted(resourceType podutil.PodResourceType) []int64
- func (n *NodeInfoImpl) GetResourcesAvailableForSharedCoresPods(unavailableNumaList []int) *Resource
- func (n *NodeInfoImpl) GetResourcesRequestsOfSharedCoresPods() *Resource
- func (n *NodeInfoImpl) GetTransientInfo() *TransientSchedulerInfo
- func (n *NodeInfoImpl) GetUsedPorts() HostPortInfo
- func (n *NodeInfoImpl) GetVictimCandidates(partitionInfo *PodPartitionInfo) []*PodInfo
- func (n *NodeInfoImpl) NumPlaceholderPods() int
- func (n *NodeInfoImpl) NumPods() int
- func (n *NodeInfoImpl) ObjectIsNil() bool
- func (n *NodeInfoImpl) RemoveCNR()
- func (n *NodeInfoImpl) RemoveNMNode()
- func (n *NodeInfoImpl) RemoveNode()
- func (n *NodeInfoImpl) RemovePod(pod *v1.Pod, preempt bool) error
- func (n *NodeInfoImpl) SetBestEffortAllocatable(r *Resource)
- func (n *NodeInfoImpl) SetBestEffortNonZeroRequested(r *Resource)
- func (n *NodeInfoImpl) SetBestEffortRequested(r *Resource)
- func (n *NodeInfoImpl) SetCNR(cnr *katalystv1alpha1.CustomNodeResource) error
- func (n *NodeInfoImpl) SetGeneration(generation int64)
- func (n *NodeInfoImpl) SetGuaranteedAllocatable(r *Resource)
- func (n *NodeInfoImpl) SetGuaranteedCapacity(r *Resource)
- func (n *NodeInfoImpl) SetGuaranteedNonZeroRequested(r *Resource)
- func (n *NodeInfoImpl) SetGuaranteedRequested(r *Resource)
- func (n *NodeInfoImpl) SetImageStates(summary map[string]*ImageStateSummary)
- func (n *NodeInfoImpl) SetNMNode(nmNode *nodev1alpha1.NMNode) error
- func (n *NodeInfoImpl) SetNMNodeInSchedulerPartition(flag bool)
- func (n *NodeInfoImpl) SetNode(node *v1.Node) error
- func (n *NodeInfoImpl) SetNodeInSchedulerPartition(flag bool)
- func (n *NodeInfoImpl) SetNodePartition(inSchedulerPartition bool) error
- func (n *NodeInfoImpl) SetTransientInfo(info *TransientSchedulerInfo)
- func (n *NodeInfoImpl) SetUsedPorts(info HostPortInfo)
- func (n *NodeInfoImpl) String() string
- func (n *NodeInfoImpl) VolumeLimits() map[v1.ResourceName]int64
- type NodeInfoLister
- type NodeInfoListerImpl
- func (i *NodeInfoListerImpl) AddNodeInfo(nodeInfo NodeInfo)
- func (i *NodeInfoListerImpl) HavePodsWithAffinityList() []NodeInfo
- func (i *NodeInfoListerImpl) HavePodsWithRequiredAntiAffinityList() []NodeInfo
- func (i *NodeInfoListerImpl) InPartitionList() []NodeInfo
- func (i *NodeInfoListerImpl) Len() int
- func (i *NodeInfoListerImpl) List() []NodeInfo
- func (i *NodeInfoListerImpl) OutOfPartitionList() []NodeInfo
- type NodePostPreemptingPlugin
- type NodePrePreemptingPlugin
- type NodeScore
- type NodeScoreList
- type NodeToStatusMap
- type NodeToStatusMapByTemplate
- type NominatedNode
- type NumaStatus
- type NumaTopologyStatus
- func (n *NumaTopologyStatus) AddPod(podInfo *PodInfo)
- func (s *NumaTopologyStatus) Equal(o *NumaTopologyStatus) bool
- func (n *NumaTopologyStatus) GetFreeNumasInSocketForConflictResources(socket int) sets.Int
- func (n *NumaTopologyStatus) GetFreeResourcesInNuma(numa int) v1.ResourceList
- func (n *NumaTopologyStatus) GetFreeResourcesInNumaList(numas []int) v1.ResourceList
- func (n *NumaTopologyStatus) GetNumaList() []int
- func (n *NumaTopologyStatus) GetNumaNum() int
- func (n *NumaTopologyStatus) GetNumaTopology() map[int]*NumaStatus
- func (n *NumaTopologyStatus) GetResourcesAvailableForSharedCoresPods(unavailableNumaList []int) *Resource
- func (n *NumaTopologyStatus) GetResourcesRequestsOfSharedCoresPods() *Resource
- func (n *NumaTopologyStatus) GetSocketList() []int
- func (n *NumaTopologyStatus) HasResourceInTopology(rName v1.ResourceName) bool
- func (n *NumaTopologyStatus) IsNumaEmptyForConflictResources(numa int) bool
- func (n *NumaTopologyStatus) RemovePod(podInfo *PodInfo, preempt, notChangedNumaTopology bool)
- type ObservableUnit
- type ObserveProperty
- type OrderedPluginRegistry
- type OwnerItem
- type OwnerMovement
- type OwnerMovementImpl
- func (omi *OwnerMovementImpl) AddAssumedPod(podKey, nodeName string)
- func (omi *OwnerMovementImpl) AddDesiredAndActualState(nodeName string, desiredPodCound int64, actualPods []*schedulingv1a1.TaskInfo)
- func (omi *OwnerMovementImpl) DeleteMovement() bool
- func (omi *OwnerMovementImpl) GetAvailableNodeSuggestions() map[string]int64
- func (omi *OwnerMovementImpl) GetGeneration() int64
- func (omi *OwnerMovementImpl) GetNodeSuggestionsStore() generationstore.Store
- func (omi *OwnerMovementImpl) GetNodesStillHaveSuggestion() map[string]int64
- func (omi *OwnerMovementImpl) RemoveAssumedPod(podKey, nodeName string) bool
- func (omi *OwnerMovementImpl) SetGeneration(generation int64)
- func (omi *OwnerMovementImpl) UpdateOwnerMovement(snapshotOwnerMovement OwnerMovement)
- type PDBItem
- type PermitPlugin
- type Plugin
- type PluginCollection
- type PluginCollectionSet
- type PluginList
- type PluginMap
- type PluginOrder
- type PluginSpec
- type PluginToNodeScores
- type PluginToStatus
- type Plugins
- type PluginsRunner
- type PodAllocation
- type PodGroupSchedulingStatus
- type PodGroupUnit
- func (p *PodGroupUnit) AddPod(pod *QueuedPodInfo) error
- func (p *PodGroupUnit) AddPods(pods []*QueuedPodInfo) error
- func (p *PodGroupUnit) AddPodsIfNotPresent(pods ...*QueuedPodInfo) error
- func (p *PodGroupUnit) DeletePod(pod *QueuedPodInfo) error
- func (p *PodGroupUnit) GetAffinityNodeSelector() (*v1.NodeSelector, error)
- func (p *PodGroupUnit) GetAnnotations() map[string]string
- func (p *PodGroupUnit) GetCreationTimestamp() *metav1.Time
- func (p *PodGroupUnit) GetEnqueuedTimestamp() *metav1.Time
- func (p *PodGroupUnit) GetKey() string
- func (p *PodGroupUnit) GetMinMember() (int, error)
- func (p *PodGroupUnit) GetName() string
- func (p *PodGroupUnit) GetNamespace() string
- func (p *PodGroupUnit) GetPod(pod *QueuedPodInfo) *QueuedPodInfo
- func (p *PodGroupUnit) GetPods() []*QueuedPodInfo
- func (p *PodGroupUnit) GetPreferredAffinity() ([]UnitAffinityTerm, error)
- func (p *PodGroupUnit) GetPriority() int32
- func (p *PodGroupUnit) GetRequiredAffinity() ([]UnitAffinityTerm, error)
- func (p *PodGroupUnit) GetSortRulesForAffinity() []SortRule
- func (p *PodGroupUnit) GetTimeoutPeriod() int32
- func (p *PodGroupUnit) GetUnitProperty() UnitProperty
- func (p *PodGroupUnit) IsDebugModeOn() bool
- func (p *PodGroupUnit) NumPods() int
- func (p *PodGroupUnit) PodBelongToUnit(pod *v1.Pod) bool
- func (p *PodGroupUnit) ReadyToBePopulated() bool
- func (p *PodGroupUnit) ResetPods()
- func (p *PodGroupUnit) SetEnqueuedTimeStamp(ts time.Time)
- func (p *PodGroupUnit) String() string
- func (p *PodGroupUnit) Type() ScheduleUnitType
- func (p *PodGroupUnit) UpdatePod(pod *QueuedPodInfo) error
- func (p *PodGroupUnit) ValidatePodCount(podCount int) bool
- type PodInfo
- type PodInfoMaintainer
- func (m *PodInfoMaintainer) AddPodInfo(p *PodInfo)
- func (m *PodInfoMaintainer) Clone() *PodInfoMaintainer
- func (m *PodInfoMaintainer) Equal(o *PodInfoMaintainer) bool
- func (m *PodInfoMaintainer) GetMaintainableInfoByPartition(partitionInfo *PodPartitionInfo) PodMaintainableInfo
- func (m *PodInfoMaintainer) GetPodInfo(key string) *PodInfo
- func (m *PodInfoMaintainer) GetPods() []*PodInfo
- func (m *PodInfoMaintainer) GetPodsWithAffinity() []*PodInfo
- func (m *PodInfoMaintainer) GetPodsWithRequiredAntiAffinity() []*PodInfo
- func (m *PodInfoMaintainer) GetPrioritiesForPodsMayBePreempted(resourceType podutil.PodResourceType) []int64
- func (m *PodInfoMaintainer) GetVictimCandidates(partitionInfo *PodPartitionInfo) []*PodInfo
- func (m *PodInfoMaintainer) Len() int
- func (m *PodInfoMaintainer) Range(f func(*PodInfo))
- func (m *PodInfoMaintainer) RemovePodInfo(p *PodInfo)
- func (m *PodInfoMaintainer) ReservedPodsNum() int
- type PodInfoSlice
- type PodInfoSliceImpl
- type PodMaintainableInfo
- type PodPartitionInfo
- type PodPreemptionInfo
- type PodProperty
- type PostBindPlugin
- type PostVictimCheckingPlugin
- type PostVictimSearchingPlugin
- type PotentialVictim
- type PotentialVictims
- type PotentialVictimsInNodes
- type PreBindPlugin
- type PreFilterExtensions
- type PreFilterPlugin
- type PreScorePlugin
- type PreemptionError
- type PreferNodeExtension
- type PreferNodeExtensionList
- type PreferredNodes
- type PreferredNodesImpl
- type ProtocolPort
- type QueueSortPlugin
- type QueuedPodInfo
- type QueuedUnitInfo
- type RecorderFactory
- type ReservationPlaceholderMap
- type ReservationPlaceholdersOfNodes
- type ReservePlugin
- type Resource
- func (r *Resource) Add(rl v1.ResourceList)
- func (r *Resource) AddResource(resource *Resource)
- func (r *Resource) AddScalar(name v1.ResourceName, quantity int64)
- func (r *Resource) Clone() *Resource
- func (r *Resource) IsZero() bool
- func (r *Resource) ResourceList() v1.ResourceList
- func (r *Resource) Satisfy(request *Resource) bool
- func (r *Resource) SetMaxResource(rl v1.ResourceList)
- func (r *Resource) SetMinResource(rl v1.ResourceList)
- func (r *Resource) SetScalar(name v1.ResourceName, quantity int64)
- func (r *Resource) Sub(rl v1.ResourceList)
- func (r *Resource) SubResource(resource *Resource)
- type ResourceStatus
- type ScheduleUnit
- type ScheduleUnitProperty
- type ScheduleUnitType
- type SchedulerFramework
- type SchedulerPreemptionFramework
- type SchedulingStage
- type SchedulingStagesState
- type ScoreExtensions
- type ScorePlugin
- type SharedLister
- type SinglePodUnit
- func (s *SinglePodUnit) AddPod(pod *QueuedPodInfo) error
- func (s *SinglePodUnit) AddPods(pods []*QueuedPodInfo) error
- func (s *SinglePodUnit) AddPodsIfNotPresent(pods ...*QueuedPodInfo) error
- func (s *SinglePodUnit) DeletePod(pod *QueuedPodInfo) error
- func (s *SinglePodUnit) GetAffinityNodeSelector() (*v1.NodeSelector, error)
- func (s *SinglePodUnit) GetAnnotations() map[string]string
- func (s *SinglePodUnit) GetCreationTimestamp() *metav1.Time
- func (s *SinglePodUnit) GetEnqueuedTimestamp() *metav1.Time
- func (s *SinglePodUnit) GetKey() string
- func (s *SinglePodUnit) GetMinMember() (int, error)
- func (s *SinglePodUnit) GetName() string
- func (s *SinglePodUnit) GetNamespace() string
- func (s *SinglePodUnit) GetPod(pod *QueuedPodInfo) *QueuedPodInfo
- func (s *SinglePodUnit) GetPods() []*QueuedPodInfo
- func (s *SinglePodUnit) GetPreferredAffinity() ([]UnitAffinityTerm, error)
- func (s *SinglePodUnit) GetPriority() int32
- func (s *SinglePodUnit) GetRequiredAffinity() ([]UnitAffinityTerm, error)
- func (s *SinglePodUnit) GetSortRulesForAffinity() []SortRule
- func (s *SinglePodUnit) GetTimeoutPeriod() int32
- func (s *SinglePodUnit) GetUnitProperty() UnitProperty
- func (s *SinglePodUnit) IsDebugModeOn() bool
- func (s *SinglePodUnit) NumPods() int
- func (s *SinglePodUnit) PodBelongToUnit(pod *v1.Pod) bool
- func (s *SinglePodUnit) ReadyToBePopulated() bool
- func (s *SinglePodUnit) ResetPods()
- func (s *SinglePodUnit) SetEnqueuedTimeStamp(ts time.Time)
- func (s *SinglePodUnit) String() string
- func (s *SinglePodUnit) Type() ScheduleUnitType
- func (s *SinglePodUnit) UpdatePod(pod *QueuedPodInfo) error
- func (s *SinglePodUnit) ValidatePodCount(podCnt int) bool
- type SortDimension
- type SortOrder
- type SortResource
- type SortRule
- type StateData
- type StateKey
- type Status
- type StoredUnit
- type SuggestionForNode
- func (s *SuggestionForNode) AddAssumedPod(podKey string)
- func (s *SuggestionForNode) DeleteMovement() bool
- func (s *SuggestionForNode) GetActualPods() []string
- func (s *SuggestionForNode) GetAssumedPods() []string
- func (s *SuggestionForNode) GetGeneration() int64
- func (s *SuggestionForNode) RemoveAssumedPod(podKey string) bool
- func (s *SuggestionForNode) Replace(newSuggestion *SuggestionForNode)
- func (s *SuggestionForNode) SetActualPods(actualPods []string)
- func (s *SuggestionForNode) SetAssumedPods(assumedPods []string)
- func (s *SuggestionForNode) SetDesiredPodCound(desiredPodCound int64)
- func (s *SuggestionForNode) SetGeneration(generation int64)
- type SwitchType
- type TransientSchedulerInfo
- type UnitAffinityTerm
- type UnitLessFunc
- type UnitProperty
- type UnitQueueSortPlugin
- type UnitSchedulingRequest
- type VictimCheckingPlugin
- type VictimCheckingPluginCollection
- type VictimCheckingPluginCollectionSpec
- type VictimPod
- type VictimPods
- type VictimSearchingPlugin
- type VictimSearchingPluginCollection
- type VictimSearchingPluginCollectionSpec
- type VictimState
- type Victims
- type WeightedAffinityTerm
Constants ¶
const ( // State data key NodePartitionTypeStateKey = "NodePartitionType" PodLauncherStateKey = "PodLauncher" PodResourceTypeStateKey = "PodResourceType" PodTraceStateKey = "PodTrace" NodeGroupStateKey = "NodeGroup" PotentialVictimsKey = "PotentialVictims" PDBsAllowedKey = "PDBsAllowed" PDBItemsKey = "PDBItems" PodsCanNotBePreemptedKey = "PodsCanNotBePreempted" MatchedPDBIndexesKey = "MatchedPDBIndexes" VictimCountOfDeployKey = "VictimCountOfDeployKey" IndexOfPDBKey = "IndexOfPDBKey" EverScheduledKey = "EverScheduledKey" // Error Message NodePartitionTypeMissedErrorString = "failed to get NodePartitionType, supposed to be set in cycle state" PodLauncherMissedErrorString = "failed to get PodLauncher, supposed to be set in cycle state" PodResourceTypeMissingErrorString = "failed to get PodResourceType, supposed to be set in cycle state" PodTraceMissingErrorString = "failed to get PodTrace, supposed to be set in cycle state" NodeGroupMissedErrorString = "failed to get NodeGroup, supposed to be set in cycle state" UnsupportedError = "unsupported %s" MissedError = "missed %s" PodPropertyKey = "PodProperty" AssignedNumasKey = "AssignedNumas" PodSchedulingStageStateKey = "PodSchedulingStageState" NotScheduledPodKeysByTemplateKey = "NotScheduledPodKeysByTemplate" )
const ( // MaxNodeScore is the maximum score a Score plugin is expected to return. MaxNodeScore int64 = 100 // MinNodeScore is the minimum score a Score plugin is expected to return. MinNodeScore int64 = 0 // MaxTotalScore is the maximum total score. MaxTotalScore int64 = math.MaxInt64 )
const ( PreFilterPhase = "PreFilter" FilterPhase = "Filter" PreScorePhase = "PreScore" ScorePhase = "Score" CrossNodesCheckerPhase = "CrossNodesChecker" ClusterPrePreemptingPhase = "ClusterPrePreempting" NodePrePreemptingPhase = "NodePrePreempting" VictimSearchingPhase = "VictimSearching" PostVictimSearchingPhase = "PostVictimSearching" NodePostPreemptingPhase = "NodePostPreempting" CheckTopologyPhase = "CheckTopology" CheckConflictPhase = "CheckConflict" PermitPhase = "Permit" PreBindPhase = "PreBind" PostBindPhase = "PostBind" BindPhase = "Bind" ReservePhase = "Reserve" )
These are predefined phases used in Scheduler and Binder.
const ( DefaultNodeCircleName string = "" DefaultNodeGroupName string = "" )
const ( MaxSwitchNum int = 31 // 0 as default, with 30 additional subclusters GTBitMask SwitchType = 1<<MaxSwitchNum - 1 BEBitMask SwitchType = GTBitMask << MaxSwitchNum DisableScheduleSwitch SwitchType = 0 SwitchTypeAll SwitchType = GTBitMask | BEBitMask RecycleExpiration = 30 * 24 * time.Hour DisableScheduleSwitchStr = "DisableScheduleSwitch" GTScheduleStr = "GTSchedule" BEScheduleStr = "BESchedule" InvalidScheduleStr = "InvalidSchedule" DefaultSubClusterIndex = 0 DefaultSubClusterSwitchType = (SwitchType(1) << DefaultSubClusterIndex) | (SwitchType(1) << DefaultSubClusterIndex << MaxSwitchNum) DefaultSubCluster = "" )
const ( ScheduleInPreferredNodes SchedulingStage = 1 << iota // 0b0001 ScheduleInNodeCircles // 0b0010 PreemptInPreferredNodes // 0b0100 PreemptInNodeCircles // 0b1000 DefaultSchedulingStagesStates SchedulingStagesState = 0b1111 )
const ( NamespaceTagKey = "namespace" UnitKeyTagKey = "unitKey" PriorityTagKey = "priority" QosTagKey = "qos" SubClusterTagKey = "subCluster" UnitTypeTagKey = "unitType" MinMemberTagKey = "minMember" )
const DefaultBindAllHostIP = "0.0.0.0"
DefaultBindAllHostIP defines the default ip address used to bind to all host.
const DefaultPluginWeight = 1
const NoNodeAvailableMsg = "0/%v nodes are available to run pod %v: %v.\n"
NoNodeAvailableMsg is used to format message when no nodes available.
const (
// NotFound is the not found error message.
NotFound = "not found"
)
Variables ¶
var ( // ErrNoNodesAvailable is used to describe the error that no nodes available to schedule pods. ErrNoNodesAvailable = fmt.Errorf("no nodes available to schedule pods") // ErrNoNodeGroupsAvailable is used to describe the error that no node groups available to schedule units. ErrNoNodeGroupsAvailable = fmt.Errorf("no node groups available to schedule units") // ErrPreemptFailed is used to describe the error that preempt failed for one pod. ErrPreemptFailed = fmt.Errorf("preempt failed") )
var PodLauncherMissedError = fmt.Errorf(PodLauncherMissedErrorString)
var PodResourceTypeMissingError = fmt.Errorf(PodResourceTypeMissingErrorString)
var PodTraceMissingError = fmt.Errorf(PodTraceMissingErrorString)
var WildCardEvent = ClusterEvent{Resource: WildCard, ActionType: All}
WildCardEvent semantically matches all resources on all actions.
Functions ¶
func AllocClusterIndex ¶
func CleanClusterIndex ¶
func CleanClusterIndex()
func ClusterIndexToSwitchType ¶
func ClusterIndexToSwitchType(x int) (SwitchType, SwitchType)
func FreeClusterIndex ¶
func GenerateReadableKey ¶
func GetAssignedNumas ¶
func GetAssignedNumas(state *CycleState) ([]int, error)
func GetClusterIndex ¶
func GetEverScheduledState ¶
func GetEverScheduledState(state *CycleState) (bool, error)
func GetGlobalSubClusterKey ¶
func GetGlobalSubClusterKey() string
func GetIndexOfPDB ¶
func GetIndexOfPDB(state *CycleState) (map[string]int, error)
func GetMatchedPDBIndexes ¶
func GetMatchedPDBIndexes(state *CycleState) (map[string][]int, error)
func GetNodeGroupKey ¶
func GetNodeGroupKey(state *CycleState) (string, error)
func GetNotScheduledPodKeysCountByTemplate ¶
func GetNotScheduledPodKeysCountByTemplate(unitState *CycleState, ownerName string) (int, error)
func GetOrCreateClusterIndex ¶
func GetPDBsAllowed ¶
func GetPDBsAllowed(state *CycleState) ([]int32, error)
func GetPodGroupKey ¶
func GetPodGroupKey(podGroup *schedulingv1a1.PodGroup) (string, error)
GetPodGroupKey returns the string key of a podGroup.
func GetPodLauncher ¶
func GetPodLauncher(state *CycleState) (podutil.PodLauncher, error)
func GetPodPriority ¶
func GetPodResourceType ¶
func GetPodResourceType(state *CycleState) (podutil.PodResourceType, error)
func GetPodSchedulingStageInCycleState ¶
func GetPodSchedulingStageInCycleState(cycleState *CycleState, stage SchedulingStage) bool
func GetPodSubCluster ¶
func GetPodTrace ¶
func GetPodTrace(state *CycleState) (tracing.SchedulingTrace, error)
func GetPodsCanNotBePreempted ¶
func GetPodsCanNotBePreempted(state *CycleState) ([]string, error)
func GetSchedulingStagesState ¶
func GetSchedulingStagesState(states SchedulingStagesState, stage SchedulingStage) bool
func GetUnitKey ¶
func IsConflictResourcesForDifferentQoS ¶
func IsConflictResourcesForDifferentQoS(resourceName v1.ResourceName) bool
func MustConvertToMetricsLabels ¶
func MustConvertToMetricsLabels(property UnitProperty) metrics.Labels
func NewPDBItemImpl ¶
func NewPDBItemImpl(pdb *policy.PodDisruptionBudget) *pdbItemImpl
func QuantityEqual ¶
func SetEverScheduledState ¶
func SetEverScheduledState(everScheduled bool, state *CycleState)
func SetGlobalSubClusterKey ¶
func SetGlobalSubClusterKey(key string)
SetGlobalSubClusterKey will be called only when init scheduler.
func SetIndexOfPDB ¶
func SetIndexOfPDB(pdbNameToIndexes map[string]int, state *CycleState)
func SetMatchedPDBIndexes ¶
func SetMatchedPDBIndexes(victimKey string, indexes []int, state *CycleState) error
func SetNodeGroupKeyState ¶
func SetNodeGroupKeyState(nodeGroup string, state *CycleState) error
func SetNotScheduledPodKeysByTemplate ¶
func SetNotScheduledPodKeysByTemplate(notScheduledPodKeysByTemplate map[string]sets.String, unitState *CycleState) error
func SetPDBItems ¶
func SetPDBItems(pdbItems []PDBItem, state *CycleState) error
func SetPDBsAllowed ¶
func SetPDBsAllowed(pdbsAllowed []int32, state *CycleState) error
func SetPodLauncherState ¶
func SetPodLauncherState(podLauncher podutil.PodLauncher, state *CycleState) error
func SetPodProperty ¶
func SetPodProperty(p *PodProperty, state *CycleState)
SetPodProperty adds a unit property to the state.
func SetPodResourceTypeState ¶
func SetPodResourceTypeState(resourceType podutil.PodResourceType, state *CycleState) error
func SetPodSchedulingStageInCycleState ¶
func SetPodSchedulingStageInCycleState(cycleState *CycleState, changedStage SchedulingStage, expectedExecute bool)
func SetPodTrace ¶
func SetPodTrace(podTrace tracing.SchedulingTrace, state *CycleState) error
func SetPodsCanNotBePreempted ¶
func SetPodsCanNotBePreempted(podKey string, state *CycleState) error
func TransferGenerationStore ¶
func TransferGenerationStore(cache, snapshot generationstore.Store) (generationstore.ListStore, generationstore.RawStore)
func UnitRequireJobLevelAffinity ¶
func UnitRequireJobLevelAffinity(unit ScheduleUnit) bool
Types ¶
type ActionType ¶
type ActionType int64
ActionType is an integer to represent one type of resource change. Different ActionTypes can be bit-wised to compose new semantics.
const ( Add ActionType = 1 << iota // 1 Delete // 10 // UpdateNodeXYZ is only applicable for Node events. UpdateNodeAllocatable // 100 UpdateNodeLabel // 1000 UpdateNodeTaint // 10000 UpdateNodeCondition // 100000 All ActionType = 1<<iota - 1 // 111111 // Use the general Update type if you don't either know or care the specific sub-Update type to use. Update = UpdateNodeAllocatable | UpdateNodeLabel | UpdateNodeTaint | UpdateNodeCondition )
Constants for ActionTypes.
type AffinityTerm ¶
AffinityTerm is a processed version of v1.PodAffinityTerm.
type BindPlugin ¶
type BindPlugin interface { Plugin // Bind plugins will not be called until all pre-bind plugins have completed. Each // bind plugin is called in the configured order. A bind plugin may choose whether // to handle the given Pod. If a bind plugin chooses to handle a Pod, the // remaining bind plugins are skipped. When a bind plugin does not handle a pod, // it must return Skip in its Status code. If a bind plugin returns an Error, the // pod is rejected and will not be bound. Bind(ctx context.Context, state *CycleState, p *v1.Pod, nodeName string) *Status }
BindPlugin is an interface that must be implemented by "Bind" plugins. Bind plugins are used to bind a pod to a Node.
type BinderFramework ¶
type BinderFramework interface { RunCheckTopologyPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeInfo NodeInfo) PluginToStatus // RunCheckConflictsPlugins runs the set of configured CheckConflicts plugins for pod on // the given node. Note that for the node being evaluated, the passed nodeInfo // reference could be different from the one in NodeInfoSnapshot map (e.g., pods // considered to be running on the node could be different). For example, during // preemption, we may pass a copy of the original nodeInfo object that has some pods // removed from it to evaluate the possibility of preempting them to // schedule the target pod. RunCheckConflictsPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeInfo NodeInfo) PluginToStatus // RunPreBindPlugins runs the set of configured PreBind plugins. It returns // *Status and its code is set to non-success if any of the plugins returns // anything but Success. If the Status code is "Unschedulable", it is // considered as a scheduling check failure, otherwise, it is considered as an // internal error. In either case the pod is not going to be bound. RunPreBindPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) *Status // RunPostBindPlugins runs the set of configured PostBind plugins. RunPostBindPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) // RunBindPlugins runs the set of configured Bind plugins. A Bind plugin may choose // whether to handle the given Pod. If a Bind plugin chooses to skip the // binding, it should return code=5("skip") status. Otherwise, it should return "Error" // or "Success". If none of the plugins handled binding, RunBindPlugins returns // code=5("skip") status. RunBindPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) *Status // RunReservePluginsReserve runs the Reserve method of the set of // configured Reserve plugins. If any of these calls returns an error, it // does not continue running the remaining ones and returns the error. In // such case, pod will not be scheduled. RunReservePluginsReserve(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) *Status // RunReservePluginsUnreserve runs the Unreserve method of the set of // configured Reserve plugins. RunReservePluginsUnreserve(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) // RunPermitPlugins runs the set of configured Permit plugins. If any of these // plugins returns a status other than "Success" or "Wait", it does not continue // running the remaining plugins and returns an error. Otherwise, if any of the // plugins returns "Wait", then this function will create and add waiting pod // to a map of currently waiting pods and return status with "Wait" code. // Pod will remain waiting pod for the minimum duration returned by the Permit plugins. RunPermitPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) *Status // WaitOnPermit will block, if the pod is a waiting pod, until the waiting pod is rejected or allowed. WaitOnPermit(ctx context.Context, pod *v1.Pod) *Status // HasCheckConflictsPlugins returns true if at least one CheckConflicts plugin is defined. HasCheckConflictsPlugins() bool // HasCheckTopologyPlugins returns true if at least one CheckTopology plugin is defined. HasCheckTopologyPlugins() bool HasPlugin(pluginName string) bool // ListPlugins returns a map of extension point name to list of configured Plugins. ListPlugins() map[string]sets.String // InitCycleState returns a new cycle state to be used in scheduling process, storing default common data from pod annotation in CycleState // This function is used to reduce unmarshalling operations in plugins for pod annotations. InitCycleState(pod *v1.Pod) (*CycleState, error) RunClusterPrePreemptingPlugins(preemptor *v1.Pod, state, preemptionState *CycleState) *Status RunVictimCheckingPlugins(preemptor, pod *v1.Pod, state, preemptionState *CycleState) *Status RunPostVictimCheckingPlugins(preemptor, pod *v1.Pod, state, preemptionState *CycleState) *Status }
BinderFramework manages the set of plugins in use by the scheduling framework. Configured plugins are called at specified points in a scheduling context.
type CachePodInfo ¶
type CachePodInfo struct { Pod *v1.Pod CycleState *CycleState Victims *Victims }
type CachePodInfoWrapper ¶
type CachePodInfoWrapper struct {
// contains filtered or unexported fields
}
func MakeCachePodInfoWrapper ¶
func MakeCachePodInfoWrapper() *CachePodInfoWrapper
func (*CachePodInfoWrapper) CycleState ¶
func (w *CachePodInfoWrapper) CycleState(s *CycleState) *CachePodInfoWrapper
func (*CachePodInfoWrapper) Obj ¶
func (w *CachePodInfoWrapper) Obj() *CachePodInfo
func (*CachePodInfoWrapper) Pod ¶
func (w *CachePodInfoWrapper) Pod(p *v1.Pod) *CachePodInfoWrapper
func (*CachePodInfoWrapper) Victims ¶
func (w *CachePodInfoWrapper) Victims(victims *Victims) *CachePodInfoWrapper
type CachePodState ¶
type CachedNominatedNodes ¶
type CachedNominatedNodes struct {
// contains filtered or unexported fields
}
func NewCachedNominatedNodes ¶
func NewCachedNominatedNodes() *CachedNominatedNodes
func (*CachedNominatedNodes) GetPodCount ¶
func (cnn *CachedNominatedNodes) GetPodCount() int
func (*CachedNominatedNodes) GetUnusedNominatedNodes ¶
func (cnn *CachedNominatedNodes) GetUnusedNominatedNodes() []*Candidate
func (*CachedNominatedNodes) GetUsedNominatedNode ¶
func (cnn *CachedNominatedNodes) GetUsedNominatedNode() *Candidate
func (*CachedNominatedNodes) HasCrossNodeConstraints ¶
func (cnn *CachedNominatedNodes) HasCrossNodeConstraints() *bool
func (*CachedNominatedNodes) IsEmpty ¶
func (cnn *CachedNominatedNodes) IsEmpty() bool
func (*CachedNominatedNodes) RemoveOnePod ¶
func (cnn *CachedNominatedNodes) RemoveOnePod()
func (*CachedNominatedNodes) SetHasCrossNodesConstraints ¶
func (cnn *CachedNominatedNodes) SetHasCrossNodesConstraints(crossNodes bool)
func (*CachedNominatedNodes) SetPodCount ¶
func (cnn *CachedNominatedNodes) SetPodCount(count int)
func (*CachedNominatedNodes) SetUnusedNominatedNodes ¶
func (cnn *CachedNominatedNodes) SetUnusedNominatedNodes(candidates []*Candidate)
func (*CachedNominatedNodes) SetUsedNominatedNode ¶
func (cnn *CachedNominatedNodes) SetUsedNominatedNode(candidate *Candidate)
type CandidatesSortingPlugin ¶
type CheckConflictsPlugin ¶
type CheckConflictsPlugin interface { Plugin // CheckConflicts is called by framework in Binder. // All CheckConflictsPlugin should return "Success" to declare that // the given node fits the pod. If CheckConflicts doesn't return "Success", // CheckConflictsPlugin set proper error message. // For the node being evaluated, CheckConflicts plugins should look at the passed // nodeInfo reference for this particular node's information (e.g., pods // considered to be running on the node) instead of looking it up in the // NodeInfoSnapshot because we don't guarantee that they will be the same. // For example, during preemption, we may pass a copy of the original // nodeInfo object that has some pods removed from it to evaluate the // possibility of preempting them to schedule the target pod. CheckConflicts(ctx context.Context, state *CycleState, pod *v1.Pod, nodeInfo NodeInfo) *Status }
CheckConflictsPlugin is an interface for CheckConflicts plugins. These plugins are called at the CheckConflicts extension point by Binder to check whether the node selected by scheduler can run the pod. These plugins should return "Success", "Unschedulable" or "Error" in Status.code. However, Binder accepts other valid codes as well. Anything other than "Success" will lead to exclusion of the given host from running the pod.
type CheckTopologyPlugin ¶
type ClusterEvent ¶
type ClusterEvent struct { Resource GVK ActionType ActionType }
ClusterEvent abstracts how a system resource's state gets changed. Resource represents the standard API resources such as Pod, Node, etc. ActionType denotes the specific change such as Add, Update or Delete.
type ClusterNodeInfoGetter ¶
type ClusterNodeInfoLister ¶
type ClusterNodeInfoLister interface { // List Returns the list of NodeInfos. List() []NodeInfo // Returns the list of NodeInfos in the partition of the scheduler InPartitionList() []NodeInfo // Returns the list of NodeInfos out of the partition of the scheduler OutOfPartitionList() []NodeInfo // HavePodsWithAffinityList Returns the list of NodeInfos of nodes with pods with affinity terms. HavePodsWithAffinityList() []NodeInfo // HavePodsWithRequiredAntiAffinityList Returns the list of NodeInfos of nodes with pods with required anti-affinity terms. HavePodsWithRequiredAntiAffinityList() []NodeInfo Len() int }
ClusterNodeInfoLister interface represents anything that can list NodeInfo objects.
func FilterNodeInfoLister ¶
func FilterNodeInfoLister(lister ClusterNodeInfoLister, filterFunc func(NodeInfo) bool) ClusterNodeInfoLister
func NewClusterNodeInfoLister ¶
func NewClusterNodeInfoLister() ClusterNodeInfoLister
NewClusterNodeInfoLister creates a new NodeInfoLister object.
type ClusterPrePreemptingPlugin ¶
type ClusterPrePreemptingPlugin interface { Plugin ClusterPrePreempting(*v1.Pod, *CycleState, *CycleState) *Status }
type ClusterSharedLister ¶
type ClusterSharedLister interface {
}ClusterSharedLister groups scheduler-specific listers.
type Code ¶
type Code int
Code is the Status code/type which is returned from plugins.
const ( // Success means that plugin ran correctly and found pod schedulable. // NOTE: A nil status is also considered as "Success". Success Code = iota // Error is used for internal plugin errors, unexpected input, etc. Error // Unschedulable is used when a plugin finds a pod unschedulable. The scheduler might attempt to // preempt other pods to get this pod scheduled. Use UnschedulableAndUnresolvable to make the // scheduler skip preemption. // The accompanying status message should explain why the pod is unschedulable. Unschedulable // UnschedulableAndUnresolvable is used when a (pre-)filter plugin finds a pod unschedulable and // preemption would not change anything. Plugins should return Unschedulable if it is possible // that the pod can get scheduled with preemption. // The accompanying status message should explain why the pod is unschedulable. UnschedulableAndUnresolvable // Wait is used when a permit plugin finds a pod scheduling should wait. Wait // Skip is used when a bind plugin chooses to skip binding. Skip // PreemptionSuccess is used when preemption pass PreemptionSucceed // PreemptionFail is used when preemption fail PreemptionFail // PreemptionNotSure is used when preemption result is not clear PreemptionNotSure )
These are predefined codes used in a Status.
type CrossNodesPlugin ¶
type CycleState ¶
type CycleState struct {
// contains filtered or unexported fields
}
CycleState provides a mechanism for plugins to store and retrieve arbitrary data. StateData stored by one plugin can be read, altered, or deleted by another plugin. For data that will be read and written by plugins, we use sync.Map to avoid race condition. As for data that will only be read by plugins, we use map directly.
func NewCycleState ¶
func NewCycleState() *CycleState
NewCycleState initializes a new CycleState and returns its pointer.
func (*CycleState) Clone ¶
func (c *CycleState) Clone() *CycleState
Clone creates a copy of CycleState and returns its pointer. Clone returns nil if the context being cloned is nil.
func (*CycleState) Delete ¶
func (c *CycleState) Delete(key StateKey)
Delete deletes data with the given key from CycleState. This function is not thread safe. In multithreading code, lock should be acquired first.
func (*CycleState) Read ¶
func (c *CycleState) Read(key StateKey) (StateData, error)
Read retrieves data with the given "key" from CycleState. If the key is not present an error is returned. This function is not thread safe. In multithreading code, lock should be acquired first.
func (*CycleState) SetRecordPluginMetrics ¶
func (c *CycleState) SetRecordPluginMetrics(flag bool)
SetRecordPluginMetrics sets recordPluginMetrics to the given value.
func (*CycleState) ShouldRecordPluginMetrics ¶
func (c *CycleState) ShouldRecordPluginMetrics() bool
ShouldRecordPluginMetrics returns whether PluginExecutionDuration metrics should be recorded.
func (*CycleState) Write ¶
func (c *CycleState) Write(key StateKey, val StateData)
Write stores the given "val" in CycleState with the given "key". This function is not thread safe. In multithreading code, lock should be acquired first.
type FilterPlugin ¶
type FilterPlugin interface { Plugin // Filter is called by the scheduling framework. // All FilterPlugins should return "Success" to declare that // the given node fits the pod. If Filter doesn't return "Success", // please refer scheduler/algorithm/predicates/error.go // to set error message. // For the node being evaluated, Filter plugins should look at the passed // nodeInfo reference for this particular node's information (e.g., pods // considered to be running on the node) instead of looking it up in the // NodeInfoSnapshot because we don't guarantee that they will be the same. // For example, during preemption, we may pass a copy of the original // nodeInfo object that has some pods removed from it to evaluate the // possibility of preempting them to schedule the target pod. Filter(ctx context.Context, state *CycleState, pod *v1.Pod, nodeInfo NodeInfo) *Status }
FilterPlugin is an interface for Filter plugins. These plugins are called at the filter extension point for filtering out hosts that cannot run a pod. This concept used to be called 'predicate' in the original scheduler. These plugins should return "Success", "Unschedulable" or "Error" in Status.code. However, the scheduler accepts other valid codes as well. Anything other than "Success" will lead to exclusion of the given host from running the pod.
type FitError ¶
type FitError struct { Pod *v1.Pod NumAllNodes int FilteredNodesStatuses NodeToStatusMap }
FitError describes a fit error of a pod.
type GVK ¶
type GVK string
GVK is short for group/version/kind, which can uniquely represent a particular API resource.
type GenerationPodGroup ¶
type GenerationPodGroup interface { SetPodGroup(*schedulingv1a1.PodGroup) GetPodGroup() *schedulingv1a1.PodGroup Clone() GenerationPodGroup generationstore.StoredObj }
func NewGenerationPodGroup ¶
func NewGenerationPodGroup(podgroup *schedulingv1a1.PodGroup) GenerationPodGroup
type GenerationPodGroupImpl ¶
type GenerationPodGroupImpl struct {
// contains filtered or unexported fields
}
ATTENTION: GenerationPodGroupImpl.Clone will not deep-copy the PodGroup object. The scheduling process CAN NOT modify the PodGroup object returned to it by Snapshot.
func (GenerationPodGroupImpl) Clone ¶
func (i GenerationPodGroupImpl) Clone() GenerationPodGroup
func (*GenerationPodGroupImpl) GetGeneration ¶
func (i *GenerationPodGroupImpl) GetGeneration() int64
func (*GenerationPodGroupImpl) GetPodGroup ¶
func (i *GenerationPodGroupImpl) GetPodGroup() *schedulingv1a1.PodGroup
func (*GenerationPodGroupImpl) SetGeneration ¶
func (i *GenerationPodGroupImpl) SetGeneration(generation int64)
func (*GenerationPodGroupImpl) SetPodGroup ¶
func (i *GenerationPodGroupImpl) SetPodGroup(podgroup *schedulingv1a1.PodGroup)
type GenerationStringSet ¶
type GenerationStringSet interface { Has(string) bool Insert(...string) Delete(...string) Len() int GetGeneration() int64 SetGeneration(generation int64) Equal(GenerationStringSet) bool Reset(GenerationStringSet) Range(GenerationStringSetRangeFunc) Strings() []string }
func NewGenerationStringSet ¶
func NewGenerationStringSet(strings ...string) GenerationStringSet
type GenerationStringSetImpl ¶
type GenerationStringSetImpl struct {
// contains filtered or unexported fields
}
func (*GenerationStringSetImpl) Delete ¶
func (s *GenerationStringSetImpl) Delete(strings ...string)
func (*GenerationStringSetImpl) Equal ¶
func (s *GenerationStringSetImpl) Equal(store GenerationStringSet) bool
func (*GenerationStringSetImpl) GetGeneration ¶
func (s *GenerationStringSetImpl) GetGeneration() int64
func (*GenerationStringSetImpl) Has ¶
func (s *GenerationStringSetImpl) Has(string string) bool
func (*GenerationStringSetImpl) Insert ¶
func (s *GenerationStringSetImpl) Insert(strings ...string)
func (*GenerationStringSetImpl) Len ¶
func (s *GenerationStringSetImpl) Len() int
func (*GenerationStringSetImpl) Range ¶
func (s *GenerationStringSetImpl) Range(f GenerationStringSetRangeFunc)
func (*GenerationStringSetImpl) Reset ¶
func (s *GenerationStringSetImpl) Reset(store GenerationStringSet)
func (*GenerationStringSetImpl) SetGeneration ¶
func (s *GenerationStringSetImpl) SetGeneration(generation int64)
func (*GenerationStringSetImpl) Strings ¶
func (s *GenerationStringSetImpl) Strings() []string
type GenerationStringSetRangeFunc ¶
type GenerationStringSetRangeFunc func(key string)
type GroupingPlugin ¶
type GroupingPlugin interface { Plugin Grouping(context.Context, ScheduleUnit, *CycleState, NodeGroup) ([]NodeGroup, *Status) }
type HostPortInfo ¶
type HostPortInfo map[string]map[ProtocolPort]struct{}
HostPortInfo stores mapping from ip to a set of ProtocolPort
func (HostPortInfo) Add ¶
func (h HostPortInfo) Add(ip, protocol string, port int32)
Add adds (ip, protocol, port) to HostPortInfo
func (HostPortInfo) CheckConflict ¶
func (h HostPortInfo) CheckConflict(ip, protocol string, port int32) bool
CheckConflict checks if the input (ip, protocol, port) conflicts with the existing ones in HostPortInfo.
func (HostPortInfo) Len ¶
func (h HostPortInfo) Len() int
Len returns the total number of (ip, protocol, port) tuple in HostPortInfo
func (HostPortInfo) Remove ¶
func (h HostPortInfo) Remove(ip, protocol string, port int32)
Remove removes (ip, protocol, port) from HostPortInfo
type ImageStateSummary ¶
type ImageStateSummary struct { // Size of the image Size int64 // Used to track how many nodes have this image NumNodes int }
ImageStateSummary provides summarized information about the state of an image.
type LessFunc ¶
type LessFunc func(podInfo1, podInfo2 *QueuedPodInfo) bool
LessFunc is the function to sort pod info
type LoadAwareNodeMetricInfo ¶
type LoadAwareNodeUsage ¶
type LoadAwareNodeUsage struct { RequestMilliCPU int64 RequestMEM int64 ProfileMilliCPU int64 ProfileMEM int64 }
In order to minimize computational overhead as much as possible, only the CPU/mem fields are used here. In the future, field expansion needs to be carried out based on actual needs
type LocatingPlugin ¶
type LocatingPlugin interface { Plugin Locating(context.Context, ScheduleUnit, *CycleState, NodeGroup) (NodeGroup, *Status) PreparePreferNode(context.Context, *CycleState, *CycleState, *v1.Pod) *Status }
type MetaVictims ¶
MetaVictims represents:
pods: a group of pods expected to be preempted. Only Pod identifiers will be sent and user are expect to get v1.Pod in their own way. numPDBViolations: the count of violations of PodDisruptionBudget
type MovementDetailForPod ¶
type MovementDetailForPod struct {
// contains filtered or unexported fields
}
func NewMovementDetailForPod ¶
func NewMovementDetailForPod(owner, movement, node string) *MovementDetailForPod
func (*MovementDetailForPod) GetGeneration ¶
func (detail *MovementDetailForPod) GetGeneration() int64
func (*MovementDetailForPod) Reset ¶
func (detail *MovementDetailForPod) Reset(newDetail *MovementDetailForPod)
func (*MovementDetailForPod) SetGeneration ¶
func (detail *MovementDetailForPod) SetGeneration(generation int64)
type MovementDetailOnNode ¶
type MovementInfo ¶
type MovementInfo struct { // key is owner key, value is movement name set, changed when operate movement OwnersToMovements generationstore.Store // key is movement name, value is movement state, changed when operate movement & pod MovementStates generationstore.Store }
func NewCacheMovementInfo ¶
func NewCacheMovementInfo() *MovementInfo
func NewSnapshotMovementInfo ¶
func NewSnapshotMovementInfo() *MovementInfo
func (*MovementInfo) AddAssumedPod ¶
func (mi *MovementInfo) AddAssumedPod(pod *v1.Pod, nodeName string)
func (*MovementInfo) AddMovement ¶
func (mi *MovementInfo) AddMovement(movement *schedulingv1a1.Movement)
func (*MovementInfo) GetAvailableSuggestionTimesForNodes ¶
func (mi *MovementInfo) GetAvailableSuggestionTimesForNodes(ownerKey string) map[string]int64
func (*MovementInfo) GetDeletedPodsFromMovement ¶
func (mi *MovementInfo) GetDeletedPodsFromMovement(movementName string) sets.String
func (*MovementInfo) GetSuggestedMovementAndNodes ¶
func (mi *MovementInfo) GetSuggestedMovementAndNodes(ownerKey string) map[string][]*MovementDetailOnNode
func (*MovementInfo) RemoveAssumedPod ¶
func (mi *MovementInfo) RemoveAssumedPod(pod *v1.Pod, nodeName string)
func (*MovementInfo) RemoveMovement ¶
func (mi *MovementInfo) RemoveMovement(movement *schedulingv1a1.Movement)
func (*MovementInfo) UpdateMovementInfo ¶
func (mi *MovementInfo) UpdateMovementInfo(snapshotMovementInfo *MovementInfo)
type MovementState ¶
type MovementState interface { AddMovement(movement *schedulingv1a1.Movement) GetOwnerMovements() generationstore.Store GetOwnerList() []string ProcessOwners(func(string)) GetAvailableNodeSuggestions(string) map[string]int64 DeleteMovement() bool AddAssumedPod(string, string, string) RemoveAssumedPod(string, string, string) bool GetDeletedPods() sets.String SetDeletedPods([]string) GetGeneration() int64 SetGeneration(int64) UpdateMovementState(MovementState) GetNodesStillHaveSuggestion(string) map[string]int64 GetAlgorithmName() string SetAlgorithmName(string) GetCreationTimestamp() metav1.Time SetCreationTimestamp(metav1.Time) }
func NewCacheMovementState ¶
func NewCacheMovementState() MovementState
func NewSnapshotMovementState ¶
func NewSnapshotMovementState() MovementState
type MovementStateImpl ¶
type MovementStateImpl struct {
// contains filtered or unexported fields
}
func (*MovementStateImpl) AddAssumedPod ¶
func (movementState *MovementStateImpl) AddAssumedPod(podKey, ownerKey, nodeName string)
func (*MovementStateImpl) AddMovement ¶
func (movementState *MovementStateImpl) AddMovement(movement *schedulingv1a1.Movement)
func (*MovementStateImpl) DeleteMovement ¶
func (movementState *MovementStateImpl) DeleteMovement() bool
func (*MovementStateImpl) GetAlgorithmName ¶
func (movementState *MovementStateImpl) GetAlgorithmName() string
func (*MovementStateImpl) GetAvailableNodeSuggestions ¶
func (movementState *MovementStateImpl) GetAvailableNodeSuggestions(ownerKey string) map[string]int64
func (*MovementStateImpl) GetCreationTimestamp ¶
func (movementState *MovementStateImpl) GetCreationTimestamp() metav1.Time
func (*MovementStateImpl) GetDeletedPods ¶
func (movementState *MovementStateImpl) GetDeletedPods() sets.String
func (*MovementStateImpl) GetGeneration ¶
func (movementState *MovementStateImpl) GetGeneration() int64
func (*MovementStateImpl) GetNodesStillHaveSuggestion ¶
func (movementState *MovementStateImpl) GetNodesStillHaveSuggestion(ownerKey string) map[string]int64
func (*MovementStateImpl) GetOwnerList ¶
func (movementState *MovementStateImpl) GetOwnerList() []string
func (*MovementStateImpl) GetOwnerMovements ¶
func (movementState *MovementStateImpl) GetOwnerMovements() generationstore.Store
func (*MovementStateImpl) ProcessOwners ¶
func (movementState *MovementStateImpl) ProcessOwners(f func(string))
func (*MovementStateImpl) RemoveAssumedPod ¶
func (movementState *MovementStateImpl) RemoveAssumedPod(podKey, ownerKey, nodeName string) bool
func (*MovementStateImpl) SetAlgorithmName ¶
func (movementState *MovementStateImpl) SetAlgorithmName(algorithm string)
func (*MovementStateImpl) SetCreationTimestamp ¶
func (movementState *MovementStateImpl) SetCreationTimestamp(t metav1.Time)
func (*MovementStateImpl) SetDeletedPods ¶
func (movementState *MovementStateImpl) SetDeletedPods(deletedPod []string)
func (*MovementStateImpl) SetGeneration ¶
func (movementState *MovementStateImpl) SetGeneration(generation int64)
func (*MovementStateImpl) UpdateMovementState ¶
func (movementState *MovementStateImpl) UpdateMovementState(snapshotMovementState MovementState)
type NodeCircle ¶
type NodeCircle interface { ClusterNodeInfoLister GetKey() string Validate() error }
func NewNodeCircle ¶
func NewNodeCircle(key string, lister ClusterNodeInfoLister) NodeCircle
type NodeCircleImpl ¶
type NodeCircleImpl struct { ClusterNodeInfoLister // contains filtered or unexported fields }
func (*NodeCircleImpl) GetKey ¶
func (nc *NodeCircleImpl) GetKey() string
func (*NodeCircleImpl) Validate ¶
func (nc *NodeCircleImpl) Validate() error
type NodeCircleList ¶
type NodeCircleList []NodeCircle
type NodeGroup ¶
type NodeGroup interface { GetKey() string Validate() error ClusterNodeInfoGetter GetNodeCircles() NodeCircleList SetNodeCircles(NodeCircleList) GetPreferredNodes() PreferredNodes SetPreferredNodes(PreferredNodes) }
func FilterNodeGroup ¶
func NewNodeGroup ¶
func NewNodeGroup(key string, getter ClusterNodeInfoGetter, nodeCircles []NodeCircle) NodeGroup
NewNodeGroup creates and returns a new NodeGroup. A non-nil `getter` is passed usually when the node set is large but unchanged, for example, when we get a basic NodeGroup from the snapshot.
type NodeGroupImpl ¶
type NodeGroupImpl struct { Key string ClusterNodeInfoGetter NodeCircles []NodeCircle PreferredNodes PreferredNodes }
func (*NodeGroupImpl) GetKey ¶
func (ng *NodeGroupImpl) GetKey() string
func (*NodeGroupImpl) GetNodeCircles ¶
func (ng *NodeGroupImpl) GetNodeCircles() NodeCircleList
func (*NodeGroupImpl) GetPreferredNodes ¶
func (ng *NodeGroupImpl) GetPreferredNodes() PreferredNodes
func (*NodeGroupImpl) SetNodeCircles ¶
func (ng *NodeGroupImpl) SetNodeCircles(nodeCircleList NodeCircleList)
func (*NodeGroupImpl) SetPreferredNodes ¶
func (ng *NodeGroupImpl) SetPreferredNodes(preferredNodes PreferredNodes)
func (*NodeGroupImpl) Validate ¶
func (ng *NodeGroupImpl) Validate() error
type NodeHashSlice ¶
type NodeHashSlice interface { Add(NodeInfo) bool Del(NodeInfo) bool Has(string) bool Nodes() []NodeInfo Len() int }
NodeHashSlice maintains a linear NodeInfo's slice. The time complexity of all methods is O(1).
func NewNodeHashSlice ¶
func NewNodeHashSlice() NodeHashSlice
type NodeHashSliceImpl ¶
type NodeHashSliceImpl struct {
// contains filtered or unexported fields
}
NodeHashSliceImpl holds a mapping of string keys to slice index, and slice to NodeInfo. When adding a NodeInfo, we will place it directly at the end of the slice. When deleting a NodeInfo, we swap it with the last NodeInfo and delete the last NodeInfo.
func (*NodeHashSliceImpl) Add ¶
func (hs *NodeHashSliceImpl) Add(n NodeInfo) bool
func (*NodeHashSliceImpl) Del ¶
func (hs *NodeHashSliceImpl) Del(n NodeInfo) bool
func (*NodeHashSliceImpl) Has ¶
func (hs *NodeHashSliceImpl) Has(key string) bool
func (*NodeHashSliceImpl) Len ¶
func (hs *NodeHashSliceImpl) Len() int
func (*NodeHashSliceImpl) Nodes ¶
func (hs *NodeHashSliceImpl) Nodes() []NodeInfo
type NodeInfo ¶
type NodeInfo interface { GetNodeName() string GetGeneration() int64 SetGeneration(generation int64) GetNodeLabels(podLauncher podutil.PodLauncher) map[string]string GetUsedPorts() HostPortInfo SetUsedPorts(HostPortInfo) GetGuaranteedRequested() *Resource GetGuaranteedNonZeroRequested() *Resource GetGuaranteedAllocatable() *Resource GetGuaranteedReserved() *Resource GetGuaranteedCapacity() *Resource GetBestEffortRequested() *Resource GetBestEffortNonZeroRequested() *Resource GetBestEffortAllocatable() *Resource SetGuaranteedRequested(*Resource) SetGuaranteedNonZeroRequested(*Resource) SetGuaranteedAllocatable(*Resource) SetGuaranteedCapacity(*Resource) SetBestEffortRequested(*Resource) SetBestEffortNonZeroRequested(*Resource) SetBestEffortAllocatable(*Resource) GetNodeInSchedulerPartition() bool // TODO SetNodeInSchedulerPartition(bool) // TODO GetNMNodeInSchedulerPartition() bool // TODO SetNMNodeInSchedulerPartition(bool) // TODO GetImageStates() map[string]*ImageStateSummary SetImageStates(map[string]*ImageStateSummary) SetTransientInfo(info *TransientSchedulerInfo) GetTransientInfo() *TransientSchedulerInfo GetNode() *v1.Node GetNMNode() *nodev1alpha1.NMNode GetCNR() *katalystv1alpha1.CustomNodeResource SetNode(node *v1.Node) error SetNMNode(nmNode *nodev1alpha1.NMNode) error SetCNR(cnr *katalystv1alpha1.CustomNodeResource) error RemoveNode() RemoveNMNode() RemoveCNR() ObjectIsNil() bool SetNodePartition(inSchedulerPartition bool) error Clone() NodeInfo String() string GetPodsWithAffinity() []*PodInfo GetPodsWithRequiredAntiAffinity() []*PodInfo AddPod(pod *v1.Pod) RemovePod(pod *v1.Pod, preempt bool) error GetPods() []*PodInfo NumPods() int // NumPlaceholderPods the number of reservation placeholder pod NumPlaceholderPods() int GetVictimCandidates(partitionInfo *PodPartitionInfo) []*PodInfo GetOccupiableResources(partitionInfo *PodPartitionInfo) *Resource VolumeLimits() map[v1.ResourceName]int64 GetNumaTopologyStatus() *NumaTopologyStatus GetPrioritiesForPodsMayBePreempted(resourceType podutil.PodResourceType) []int64 }
func NewNodeInfo ¶
NewNodeInfo returns a ready to use empty NodeInfo object. If any pods are given in arguments, their information will be aggregated in the returned object.
type NodeInfoGetterImpl ¶
type NodeInfoImpl ¶
type NodeInfoImpl struct { // Overall node information, collected by k8s. Node *v1.Node // node information, collected by node manager NMNode *nodev1alpha1.NMNode // cnr stores additional/custom node information, such as numa topology, etc. CNR *katalystv1alpha1.CustomNodeResource // Whether Node is in the partition of the scheduler NodeInSchedulerPartition bool // Whether NMNode is in the partition of the scheduler NMNodeInSchedulerPartition bool // PodInfoMaintainer maintain all the pods running on the node. PodInfoMaintainer *PodInfoMaintainer // Ports allocated on the node. UsedPorts HostPortInfo // Total requested resources of all guaranteed pods on this node. This includes // assumed pods, which scheduler has sent for binding, but may not be scheduled // yet. GuaranteedRequested *Resource // Total requested resources of all guaranteed pods on this node with a minimum // value applied to each container's CPU and memory requests. This does not reflect // the actual resource requests for this node, but is used to avoid scheduling // many zero-request pods onto one node. GuaranteedNonZeroRequested *Resource // We store guaranteed allocatedResources (which is the minimum of Node.Status.Allocatable.* // and CNR.Status.ResourceAllocatable.*) explicitly // as int64, to avoid conversions and accessing map. GuaranteedAllocatable *Resource // GuaranteedCapacity is capacity resource of node GuaranteedCapacity *Resource // GuaranteedReserved is the total reserved resources of GT pods. GuaranteedReserved *Resource // Total requested resources of all best-effort pods on this node. This includes assumed // pods, which scheduler has sent for binding, but may not be scheduled yet. BestEffortRequested *Resource // Total requested resources of all best-effort pods on this node with a minimum value // applied to each container's CPU and memory requests. This does not reflect // the actual resource requests for this node, but is used to avoid scheduling // many zero-request pods onto one node. BestEffortNonZeroRequested *Resource // We store best-effort allocatedResources (which is CNR.Status.BestEffortResourceAllocatable.*) explicitly // as int64, to avoid conversions and accessing map. BestEffortAllocatable *Resource // ImageStates holds the entry of an image if and only if this image is on the node. The entry can be used for // checking an image's existence and advanced usage (e.g., image locality scheduling policy) based on the image // state information. ImageStates map[string]*ImageStateSummary // TransientInfo holds the information pertaining to a scheduling cycle. This will be destructed at the end of // scheduling cycle. TransientInfo *TransientSchedulerInfo // Whenever NodeInfoImpl changes, generation is bumped. // This is used to avoid cloning it if the object didn't change. Generation int64 NumaTopologyStatus *NumaTopologyStatus // contains filtered or unexported fields }
NodeInfoImpl is node level aggregated information.
func (*NodeInfoImpl) AddPod ¶
func (n *NodeInfoImpl) AddPod(pod *v1.Pod)
AddPod adds pod information to this NodeInfoImpl. If resource type is not set or illegal, the pod is considered as a GuaranteedPod, and resource requests are added to guaranteed request
func (*NodeInfoImpl) Clone ¶
func (n *NodeInfoImpl) Clone() NodeInfo
TODO: remove some unused fields Clone returns a copy of this node.
func (*NodeInfoImpl) GetBestEffortAllocatable ¶
func (n *NodeInfoImpl) GetBestEffortAllocatable() *Resource
func (*NodeInfoImpl) GetBestEffortNonZeroRequested ¶
func (n *NodeInfoImpl) GetBestEffortNonZeroRequested() *Resource
func (*NodeInfoImpl) GetBestEffortRequested ¶
func (n *NodeInfoImpl) GetBestEffortRequested() *Resource
func (*NodeInfoImpl) GetCNR ¶
func (n *NodeInfoImpl) GetCNR() *katalystv1alpha1.CustomNodeResource
GetCNR returns overall information about this CNR.
func (*NodeInfoImpl) GetGeneration ¶
func (n *NodeInfoImpl) GetGeneration() int64
func (*NodeInfoImpl) GetGuaranteedAllocatable ¶
func (n *NodeInfoImpl) GetGuaranteedAllocatable() *Resource
func (*NodeInfoImpl) GetGuaranteedCapacity ¶
func (n *NodeInfoImpl) GetGuaranteedCapacity() *Resource
func (*NodeInfoImpl) GetGuaranteedNonZeroRequested ¶
func (n *NodeInfoImpl) GetGuaranteedNonZeroRequested() *Resource
func (*NodeInfoImpl) GetGuaranteedRequested ¶
func (n *NodeInfoImpl) GetGuaranteedRequested() *Resource
func (*NodeInfoImpl) GetGuaranteedReserved ¶
func (n *NodeInfoImpl) GetGuaranteedReserved() *Resource
func (*NodeInfoImpl) GetImageStates ¶
func (n *NodeInfoImpl) GetImageStates() map[string]*ImageStateSummary
func (*NodeInfoImpl) GetNMNode ¶
func (n *NodeInfoImpl) GetNMNode() *nodev1alpha1.NMNode
NMNode returns the NMNode info
func (*NodeInfoImpl) GetNMNodeInSchedulerPartition ¶
func (n *NodeInfoImpl) GetNMNodeInSchedulerPartition() bool
func (*NodeInfoImpl) GetNode ¶
func (n *NodeInfoImpl) GetNode() *v1.Node
Node returns overall information about this node.
func (*NodeInfoImpl) GetNodeInSchedulerPartition ¶
func (n *NodeInfoImpl) GetNodeInSchedulerPartition() bool
func (*NodeInfoImpl) GetNodeLabels ¶
func (n *NodeInfoImpl) GetNodeLabels(podLauncher podutil.PodLauncher) map[string]string
func (*NodeInfoImpl) GetNodeName ¶
func (n *NodeInfoImpl) GetNodeName() string
GetNodeName returns the node name of the node info. Both Node and NMNode should share the same node name.
func (*NodeInfoImpl) GetNumaTopologyStatus ¶
func (n *NodeInfoImpl) GetNumaTopologyStatus() *NumaTopologyStatus
Notice that the return value cannot be modified in the place where the function is called
func (*NodeInfoImpl) GetOccupiableResources ¶
func (n *NodeInfoImpl) GetOccupiableResources(partitionInfo *PodPartitionInfo) *Resource
GetOccupiableResources does a partition on the podinfomaintainer's Splay-Tree based on the PodPartitionInfo and returns the sum of the resources in the partition and the unused resources. All pods in a partition have the possibility of being preempted, which is a rough judgment.
func (*NodeInfoImpl) GetPods ¶
func (n *NodeInfoImpl) GetPods() []*PodInfo
func (*NodeInfoImpl) GetPodsWithAffinity ¶
func (n *NodeInfoImpl) GetPodsWithAffinity() []*PodInfo
func (*NodeInfoImpl) GetPodsWithRequiredAntiAffinity ¶
func (n *NodeInfoImpl) GetPodsWithRequiredAntiAffinity() []*PodInfo
func (*NodeInfoImpl) GetPrioritiesForPodsMayBePreempted ¶
func (n *NodeInfoImpl) GetPrioritiesForPodsMayBePreempted(resourceType podutil.PodResourceType) []int64
func (*NodeInfoImpl) GetResourcesAvailableForSharedCoresPods ¶
func (n *NodeInfoImpl) GetResourcesAvailableForSharedCoresPods(unavailableNumaList []int) *Resource
func (*NodeInfoImpl) GetResourcesRequestsOfSharedCoresPods ¶
func (n *NodeInfoImpl) GetResourcesRequestsOfSharedCoresPods() *Resource
func (*NodeInfoImpl) GetTransientInfo ¶
func (n *NodeInfoImpl) GetTransientInfo() *TransientSchedulerInfo
func (*NodeInfoImpl) GetUsedPorts ¶
func (n *NodeInfoImpl) GetUsedPorts() HostPortInfo
func (*NodeInfoImpl) GetVictimCandidates ¶
func (n *NodeInfoImpl) GetVictimCandidates(partitionInfo *PodPartitionInfo) []*PodInfo
GetVictimCandidates returns all pods under the same PodResourceType that may be preempted. Whether or not they are actually victims depends on the cluster state and the currently preemptor.
func (*NodeInfoImpl) NumPlaceholderPods ¶
func (n *NodeInfoImpl) NumPlaceholderPods() int
func (*NodeInfoImpl) NumPods ¶
func (n *NodeInfoImpl) NumPods() int
func (*NodeInfoImpl) ObjectIsNil ¶
func (n *NodeInfoImpl) ObjectIsNil() bool
func (*NodeInfoImpl) RemoveCNR ¶
func (n *NodeInfoImpl) RemoveCNR()
RemoveCNR removes the CNR object, leaving all other tracking information.
func (*NodeInfoImpl) RemoveNMNode ¶
func (n *NodeInfoImpl) RemoveNMNode()
func (*NodeInfoImpl) RemoveNode ¶
func (n *NodeInfoImpl) RemoveNode()
RemoveNode removes the node object, leaving all other tracking information.
func (*NodeInfoImpl) RemovePod ¶
func (n *NodeInfoImpl) RemovePod(pod *v1.Pod, preempt bool) error
RemovePod subtracts pod information from this NodeInfoImpl. If resource type is not set or illegal, the pod is considered as a GuaranteedPod, and resource requests are removed from guaranteed request
func (*NodeInfoImpl) SetBestEffortAllocatable ¶
func (n *NodeInfoImpl) SetBestEffortAllocatable(r *Resource)
func (*NodeInfoImpl) SetBestEffortNonZeroRequested ¶
func (n *NodeInfoImpl) SetBestEffortNonZeroRequested(r *Resource)
func (*NodeInfoImpl) SetBestEffortRequested ¶
func (n *NodeInfoImpl) SetBestEffortRequested(r *Resource)
func (*NodeInfoImpl) SetCNR ¶
func (n *NodeInfoImpl) SetCNR(cnr *katalystv1alpha1.CustomNodeResource) error
SetCNR sets extend information about node, such as YARN and numa topology, etc.
func (*NodeInfoImpl) SetGeneration ¶
func (n *NodeInfoImpl) SetGeneration(generation int64)
func (*NodeInfoImpl) SetGuaranteedAllocatable ¶
func (n *NodeInfoImpl) SetGuaranteedAllocatable(r *Resource)
func (*NodeInfoImpl) SetGuaranteedCapacity ¶
func (n *NodeInfoImpl) SetGuaranteedCapacity(r *Resource)
func (*NodeInfoImpl) SetGuaranteedNonZeroRequested ¶
func (n *NodeInfoImpl) SetGuaranteedNonZeroRequested(r *Resource)
func (*NodeInfoImpl) SetGuaranteedRequested ¶
func (n *NodeInfoImpl) SetGuaranteedRequested(r *Resource)
func (*NodeInfoImpl) SetImageStates ¶
func (n *NodeInfoImpl) SetImageStates(summary map[string]*ImageStateSummary)
func (*NodeInfoImpl) SetNMNode ¶
func (n *NodeInfoImpl) SetNMNode(nmNode *nodev1alpha1.NMNode) error
SetNMNode sets the overall node information collected by node manager.
func (*NodeInfoImpl) SetNMNodeInSchedulerPartition ¶
func (n *NodeInfoImpl) SetNMNodeInSchedulerPartition(flag bool)
func (*NodeInfoImpl) SetNode ¶
func (n *NodeInfoImpl) SetNode(node *v1.Node) error
SetNode sets the overall node information collected by k8s.
func (*NodeInfoImpl) SetNodeInSchedulerPartition ¶
func (n *NodeInfoImpl) SetNodeInSchedulerPartition(flag bool)
func (*NodeInfoImpl) SetNodePartition ¶
func (n *NodeInfoImpl) SetNodePartition(inSchedulerPartition bool) error
SetNodePartition sets whether the node is in partition of scheduler
func (*NodeInfoImpl) SetTransientInfo ¶
func (n *NodeInfoImpl) SetTransientInfo(info *TransientSchedulerInfo)
func (*NodeInfoImpl) SetUsedPorts ¶
func (n *NodeInfoImpl) SetUsedPorts(info HostPortInfo)
func (*NodeInfoImpl) String ¶
func (n *NodeInfoImpl) String() string
String returns representation of human readable format of this NodeInfoImpl.
func (*NodeInfoImpl) VolumeLimits ¶
func (n *NodeInfoImpl) VolumeLimits() map[v1.ResourceName]int64
VolumeLimits returns volume limits associated with the node
type NodeInfoLister ¶
type NodeInfoLister interface { ClusterNodeInfoGetter ClusterNodeInfoLister }
NodeInfoLister interface represents anything that can list/get NodeInfo objects from node name.
type NodeInfoListerImpl ¶
type NodeInfoListerImpl struct { // InPartitionNodes is the list of nodes in the partition of the scheduler. InPartitionNodes []NodeInfo // OutOfPartitionNodes is the list of nodes out of the partition of the scheduler. OutOfPartitionNodes []NodeInfo // HavePodsWithAffinityNodes is the list of nodes with at least one pod declaring affinity terms. HavePodsWithAffinityNodes []NodeInfo // HavePodsWithRequiredAntiAffinityNodes is the list of nodes with at least one pod declaring // required anti-affinity terms. HavePodsWithRequiredAntiAffinityNodes []NodeInfo }
NodeInfoListerImpl implements ClusterNodeInfoLister interface.
func (*NodeInfoListerImpl) AddNodeInfo ¶
func (i *NodeInfoListerImpl) AddNodeInfo(nodeInfo NodeInfo)
func (*NodeInfoListerImpl) HavePodsWithAffinityList ¶
func (i *NodeInfoListerImpl) HavePodsWithAffinityList() []NodeInfo
HavePodsWithAffinityList returns the list of NodeInfos of nodes with pods with affinity terms.
func (*NodeInfoListerImpl) HavePodsWithRequiredAntiAffinityList ¶
func (i *NodeInfoListerImpl) HavePodsWithRequiredAntiAffinityList() []NodeInfo
HavePodsWithRequiredAntiAffinityList returns the list of NodeInfos of nodes with pods with required anti-affinity terms.
func (*NodeInfoListerImpl) InPartitionList ¶
func (i *NodeInfoListerImpl) InPartitionList() []NodeInfo
func (*NodeInfoListerImpl) Len ¶
func (i *NodeInfoListerImpl) Len() int
func (*NodeInfoListerImpl) List ¶
func (i *NodeInfoListerImpl) List() []NodeInfo
func (*NodeInfoListerImpl) OutOfPartitionList ¶
func (i *NodeInfoListerImpl) OutOfPartitionList() []NodeInfo
type NodePostPreemptingPlugin ¶
type NodePostPreemptingPlugin interface { Plugin NodePostPreempting(*v1.Pod, []*v1.Pod, *CycleState, *CycleState) *Status }
type NodePrePreemptingPlugin ¶
type NodePrePreemptingPlugin interface { Plugin NodePrePreempting(*v1.Pod, NodeInfo, *CycleState, *CycleState) *Status }
type NodeScoreList ¶
type NodeScoreList []NodeScore
NodeScoreList declares a list of nodes and their scores.
type NodeToStatusMap ¶
NodeToStatusMap declares map from node name to its status.
func (NodeToStatusMap) Update ¶
func (t NodeToStatusMap) Update(m NodeToStatusMap)
type NodeToStatusMapByTemplate ¶
type NodeToStatusMapByTemplate map[string]NodeToStatusMap
NodeToStatusMapByTemplate declares map from pod template to its NodeToStatusMap.
type NominatedNode ¶
type NominatedNode struct { // NodeName is the node where the pod is supposed to place NodeName string `json:"node"` // VictimPods is the collection of all victim pods name. VictimPods should not be nil or empty. // If VictimPods is empty, this pod are supposed to be assumed VictimPods VictimPods `json:"victims"` }
func (*NominatedNode) DeepCopy ¶
func (nn *NominatedNode) DeepCopy() *NominatedNode
func (*NominatedNode) Marshall ¶
func (nn *NominatedNode) Marshall() string
type NumaStatus ¶
type NumaStatus struct {
// contains filtered or unexported fields
}
func NewNumaStatus ¶
func NewNumaStatus(socketID int, monopolized bool, resources map[string]*ResourceStatus) *NumaStatus
func (*NumaStatus) Equal ¶
func (numaStatus *NumaStatus) Equal(n2 *NumaStatus) bool
func (*NumaStatus) GetNumaInfo ¶
func (numaStatus *NumaStatus) GetNumaInfo() string
GetNumaInfo return the numa's information in string's format
func (*NumaStatus) GetNumaResourcesAllocatable ¶
func (numaStatus *NumaStatus) GetNumaResourcesAllocatable() *v1.ResourceList
func (*NumaStatus) GetSocket ¶
func (numaStatus *NumaStatus) GetSocket() int
func (*NumaStatus) IsEmptyForConflictResources ¶
func (numaStatus *NumaStatus) IsEmptyForConflictResources() bool
type NumaTopologyStatus ¶
type NumaTopologyStatus struct {
// contains filtered or unexported fields
}
func (*NumaTopologyStatus) AddPod ¶
func (n *NumaTopologyStatus) AddPod(podInfo *PodInfo)
func (*NumaTopologyStatus) Equal ¶
func (s *NumaTopologyStatus) Equal(o *NumaTopologyStatus) bool
func (*NumaTopologyStatus) GetFreeNumasInSocketForConflictResources ¶
func (n *NumaTopologyStatus) GetFreeNumasInSocketForConflictResources(socket int) sets.Int
func (*NumaTopologyStatus) GetFreeResourcesInNuma ¶
func (n *NumaTopologyStatus) GetFreeResourcesInNuma(numa int) v1.ResourceList
func (*NumaTopologyStatus) GetFreeResourcesInNumaList ¶
func (n *NumaTopologyStatus) GetFreeResourcesInNumaList(numas []int) v1.ResourceList
func (*NumaTopologyStatus) GetNumaList ¶
func (n *NumaTopologyStatus) GetNumaList() []int
func (*NumaTopologyStatus) GetNumaNum ¶
func (n *NumaTopologyStatus) GetNumaNum() int
func (*NumaTopologyStatus) GetNumaTopology ¶
func (n *NumaTopologyStatus) GetNumaTopology() map[int]*NumaStatus
func (*NumaTopologyStatus) GetResourcesAvailableForSharedCoresPods ¶
func (n *NumaTopologyStatus) GetResourcesAvailableForSharedCoresPods(unavailableNumaList []int) *Resource
func (*NumaTopologyStatus) GetResourcesRequestsOfSharedCoresPods ¶
func (n *NumaTopologyStatus) GetResourcesRequestsOfSharedCoresPods() *Resource
func (*NumaTopologyStatus) GetSocketList ¶
func (n *NumaTopologyStatus) GetSocketList() []int
func (*NumaTopologyStatus) HasResourceInTopology ¶
func (n *NumaTopologyStatus) HasResourceInTopology(rName v1.ResourceName) bool
func (*NumaTopologyStatus) IsNumaEmptyForConflictResources ¶
func (n *NumaTopologyStatus) IsNumaEmptyForConflictResources(numa int) bool
func (*NumaTopologyStatus) RemovePod ¶
func (n *NumaTopologyStatus) RemovePod(podInfo *PodInfo, preempt, notChangedNumaTopology bool)
type ObservableUnit ¶
type ObservableUnit interface {
GetUnitProperty() UnitProperty
}
type ObserveProperty ¶
type ObserveProperty interface { ConvertToMetricsLabels() metrics.Labels ConvertToTracingTags() trace.SpanOption }
ObserveProperty contains object property used by metrics、tracing.
type OrderedPluginRegistry ¶
type OrderedPluginRegistry struct {
Plugins []string
}
func (*OrderedPluginRegistry) List ¶
func (fpo *OrderedPluginRegistry) List() []string
type OwnerMovement ¶
type OwnerMovement interface { GetGeneration() int64 SetGeneration(int64) AddDesiredAndActualState(string, int64, []*schedulingv1a1.TaskInfo) GetAvailableNodeSuggestions() map[string]int64 DeleteMovement() bool AddAssumedPod(string, string) RemoveAssumedPod(string, string) bool GetNodesStillHaveSuggestion() map[string]int64 GetNodeSuggestionsStore() generationstore.Store UpdateOwnerMovement(OwnerMovement) }
func NewCacheOwnerMovement ¶
func NewCacheOwnerMovement() OwnerMovement
func NewSnapshotOwnerMovement ¶
func NewSnapshotOwnerMovement() OwnerMovement
type OwnerMovementImpl ¶
type OwnerMovementImpl struct {
// contains filtered or unexported fields
}
func (*OwnerMovementImpl) AddAssumedPod ¶
func (omi *OwnerMovementImpl) AddAssumedPod(podKey, nodeName string)
func (*OwnerMovementImpl) AddDesiredAndActualState ¶
func (omi *OwnerMovementImpl) AddDesiredAndActualState(nodeName string, desiredPodCound int64, actualPods []*schedulingv1a1.TaskInfo)
func (*OwnerMovementImpl) DeleteMovement ¶
func (omi *OwnerMovementImpl) DeleteMovement() bool
func (*OwnerMovementImpl) GetAvailableNodeSuggestions ¶
func (omi *OwnerMovementImpl) GetAvailableNodeSuggestions() map[string]int64
func (*OwnerMovementImpl) GetGeneration ¶
func (omi *OwnerMovementImpl) GetGeneration() int64
func (*OwnerMovementImpl) GetNodeSuggestionsStore ¶
func (omi *OwnerMovementImpl) GetNodeSuggestionsStore() generationstore.Store
func (*OwnerMovementImpl) GetNodesStillHaveSuggestion ¶
func (omi *OwnerMovementImpl) GetNodesStillHaveSuggestion() map[string]int64
func (*OwnerMovementImpl) RemoveAssumedPod ¶
func (omi *OwnerMovementImpl) RemoveAssumedPod(podKey, nodeName string) bool
func (*OwnerMovementImpl) SetGeneration ¶
func (omi *OwnerMovementImpl) SetGeneration(generation int64)
func (*OwnerMovementImpl) UpdateOwnerMovement ¶
func (omi *OwnerMovementImpl) UpdateOwnerMovement(snapshotOwnerMovement OwnerMovement)
type PDBItem ¶
type PDBItem interface { GetPDB() *policy.PodDisruptionBudget SetPDB(*policy.PodDisruptionBudget) GetPDBSelector() labels.Selector SetPDBSelector(labels.Selector) RemoveAllOwners() AddOwner(string, string) RemoveOwner(string, string) GetRelatedOwnersByType(string) []string RemovePDBFromOwner(func(string, string)) GetGeneration() int64 SetGeneration(int64) Replace(PDBItem) Clone() PDBItem }
func GetPDBItems ¶
func GetPDBItems(state *CycleState) ([]PDBItem, error)
type PermitPlugin ¶
type PermitPlugin interface { Plugin // TODO: remove the second return value // Permit is called before binding a pod (and before binder plugins). Permit // plugins are used to prevent or delay the binding of a Pod. A permit plugin // must return success or wait with timeout duration, or the pod will be rejected. // The pod will also be rejected if the wait timeout or the pod is rejected while // waiting. Note that if the plugin returns "wait", the framework will wait only // after running the remaining plugins given that no other plugin rejects the pod. Permit(ctx context.Context, state *CycleState, p *v1.Pod, nodeName string) (*Status, time.Duration) }
PermitPlugin is an interface that must be implemented by "Permit" plugins. These plugins are called before a pod is bound to a node.
type Plugin ¶
type Plugin interface {
Name() string
}
Plugin is the parent type for all the scheduling framework plugins, means the atomic scheduling step, the basic component of constraints
type PluginCollection ¶
type PluginCollection struct { // Filters is a set of plugins that should be invoked when filtering out nodes that cannot run the Pod. Filters []*PluginSpec // Scores is a set of plugins that should be invoked when ranking nodes that have passed the filtering phase. Scores []*PluginSpec // Searchings is a set of plugins that should be invoked in preemption phase Searchings []*VictimSearchingPluginCollectionSpec Sortings []*PluginSpec }
type PluginCollectionSet ¶
type PluginCollectionSet map[string]*PluginCollection
type PluginList ¶
type PluginList interface {
List() []string
}
type PluginOrder ¶
type PluginSpec ¶
func NewPluginSpec ¶
func NewPluginSpec(name string) *PluginSpec
func NewPluginSpecWithWeight ¶
func NewPluginSpecWithWeight(name string, weight int64) *PluginSpec
func (*PluginSpec) GetName ¶
func (ps *PluginSpec) GetName() string
func (*PluginSpec) GetWeight ¶
func (ps *PluginSpec) GetWeight() int64
func (*PluginSpec) SetWeight ¶
func (ps *PluginSpec) SetWeight(weight int64)
type PluginToNodeScores ¶
type PluginToNodeScores map[string]NodeScoreList
PluginToNodeScores declares a map from plugin name to its NodeScoreList.
type PluginToStatus ¶
PluginToStatus maps plugin name to status. Currently used to identify which Filter plugin returned which status.
func (PluginToStatus) Merge ¶
func (p PluginToStatus) Merge() *Status
Merge merges the statuses in the map into one. The resulting status code have the following precedence: Error, UnschedulableAndUnresolvable, Unschedulable.
type PluginsRunner ¶
type PluginsRunner interface { // RunFilterPlugins runs the set of configured filter plugins for pod on the given node. RunFilterPlugins(context.Context, *CycleState, *v1.Pod, NodeInfo) PluginToStatus // RunPreFilterExtensionAddPod calls the AddPod interface for the set of configured PreFilter plugins. RunPreFilterExtensionAddPod(ctx context.Context, state *CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo NodeInfo) *Status // RunPreFilterExtensionRemovePod calls the RemovePod interface for the set of configured PreFilter plugins. RunPreFilterExtensionRemovePod(ctx context.Context, state *CycleState, podToSchedule *v1.Pod, podToRemove *v1.Pod, nodeInfo NodeInfo) *Status }
PluginsRunner abstracts operations to run some plugins. This is used by preemption PostFilter plugins when evaluating the feasibility of scheduling the pod on nodes when certain running pods get evicted.
type PodAllocation ¶
type PodAllocation struct {
// contains filtered or unexported fields
}
func (*PodAllocation) Equal ¶
func (alloc *PodAllocation) Equal(alloc2 *PodAllocation) bool
type PodGroupSchedulingStatus ¶
type PodGroupSchedulingStatus string
const ( Waiting PodGroupSchedulingStatus = "Waiting" Successful PodGroupSchedulingStatus = "Successful" Failed PodGroupSchedulingStatus = "Failed" )
These internal status should map to api definition
type PodGroupUnit ¶
type PodGroupUnit struct {
// contains filtered or unexported fields
}
PodGroupUnit is the podGroup Unit implementation
func NewPodGroupUnit ¶
func NewPodGroupUnit(podGroup *schedulingv1a1.PodGroup, priority int32) *PodGroupUnit
func (*PodGroupUnit) AddPod ¶
func (p *PodGroupUnit) AddPod(pod *QueuedPodInfo) error
func (*PodGroupUnit) AddPods ¶
func (p *PodGroupUnit) AddPods(pods []*QueuedPodInfo) error
func (*PodGroupUnit) AddPodsIfNotPresent ¶
func (p *PodGroupUnit) AddPodsIfNotPresent(pods ...*QueuedPodInfo) error
func (*PodGroupUnit) DeletePod ¶
func (p *PodGroupUnit) DeletePod(pod *QueuedPodInfo) error
func (*PodGroupUnit) GetAffinityNodeSelector ¶
func (p *PodGroupUnit) GetAffinityNodeSelector() (*v1.NodeSelector, error)
func (*PodGroupUnit) GetAnnotations ¶
func (p *PodGroupUnit) GetAnnotations() map[string]string
func (*PodGroupUnit) GetCreationTimestamp ¶
func (p *PodGroupUnit) GetCreationTimestamp() *metav1.Time
func (*PodGroupUnit) GetEnqueuedTimestamp ¶
func (p *PodGroupUnit) GetEnqueuedTimestamp() *metav1.Time
func (*PodGroupUnit) GetKey ¶
func (p *PodGroupUnit) GetKey() string
func (*PodGroupUnit) GetMinMember ¶
func (p *PodGroupUnit) GetMinMember() (int, error)
func (*PodGroupUnit) GetName ¶
func (p *PodGroupUnit) GetName() string
func (*PodGroupUnit) GetNamespace ¶
func (p *PodGroupUnit) GetNamespace() string
func (*PodGroupUnit) GetPod ¶
func (p *PodGroupUnit) GetPod(pod *QueuedPodInfo) *QueuedPodInfo
func (*PodGroupUnit) GetPods ¶
func (p *PodGroupUnit) GetPods() []*QueuedPodInfo
If iterating the map is a performance concern here, we can introduce more complex data structure.
func (*PodGroupUnit) GetPreferredAffinity ¶
func (p *PodGroupUnit) GetPreferredAffinity() ([]UnitAffinityTerm, error)
GetPreferredAffinity returns affinity rules specified in PodGroupAffinity.Preferred
func (*PodGroupUnit) GetPriority ¶
func (p *PodGroupUnit) GetPriority() int32
GetPriority return pod group unit priority. CreatUnit already assigns the value, it's safe to return it directly.
func (*PodGroupUnit) GetRequiredAffinity ¶
func (p *PodGroupUnit) GetRequiredAffinity() ([]UnitAffinityTerm, error)
GetRequiredAffinity returns affinity rules specified in PodGroupAffinity.Required
func (*PodGroupUnit) GetSortRulesForAffinity ¶
func (p *PodGroupUnit) GetSortRulesForAffinity() []SortRule
func (*PodGroupUnit) GetTimeoutPeriod ¶
func (p *PodGroupUnit) GetTimeoutPeriod() int32
func (*PodGroupUnit) GetUnitProperty ¶
func (p *PodGroupUnit) GetUnitProperty() UnitProperty
func (*PodGroupUnit) IsDebugModeOn ¶
func (p *PodGroupUnit) IsDebugModeOn() bool
func (*PodGroupUnit) NumPods ¶
func (p *PodGroupUnit) NumPods() int
func (*PodGroupUnit) PodBelongToUnit ¶
func (p *PodGroupUnit) PodBelongToUnit(pod *v1.Pod) bool
func (*PodGroupUnit) ReadyToBePopulated ¶
func (p *PodGroupUnit) ReadyToBePopulated() bool
func (*PodGroupUnit) ResetPods ¶
func (p *PodGroupUnit) ResetPods()
func (*PodGroupUnit) SetEnqueuedTimeStamp ¶
func (p *PodGroupUnit) SetEnqueuedTimeStamp(ts time.Time)
func (*PodGroupUnit) String ¶
func (p *PodGroupUnit) String() string
func (*PodGroupUnit) Type ¶
func (p *PodGroupUnit) Type() ScheduleUnitType
func (*PodGroupUnit) UpdatePod ¶
func (p *PodGroupUnit) UpdatePod(pod *QueuedPodInfo) error
func (*PodGroupUnit) ValidatePodCount ¶
func (p *PodGroupUnit) ValidatePodCount(podCount int) bool
type PodInfo ¶
type PodInfo struct { Pod *v1.Pod RequiredAffinityTerms []AffinityTerm RequiredAntiAffinityTerms []AffinityTerm PreferredAffinityTerms []WeightedAffinityTerm PreferredAntiAffinityTerms []WeightedAffinityTerm ParseError error Res Resource Non0CPU, Non0Mem int64 PodResourceType podutil.PodResourceType PodResourceTypeError error PodKey string PodPriority int64 PodGroupName string PodLauncher podutil.PodLauncher PodPreemptionInfo PodPreemptionInfo }
PodInfo is a wrapper to a Pod with additional pre-computed information to accelerate processing. This information is typically immutable (e.g., pre-processed inter-pod affinity selectors). This will be stored in splay-tree.
func (*PodInfo) MakeMaintainInfo ¶
func (pi *PodInfo) MakeMaintainInfo() splay.MaintainInfo
type PodInfoMaintainer ¶
type PodInfoMaintainer struct {
// contains filtered or unexported fields
}
func NewPodInfoMaintainer ¶
func NewPodInfoMaintainer(pods ...*PodInfo) *PodInfoMaintainer
func (*PodInfoMaintainer) AddPodInfo ¶
func (m *PodInfoMaintainer) AddPodInfo(p *PodInfo)
func (*PodInfoMaintainer) Clone ¶
func (m *PodInfoMaintainer) Clone() *PodInfoMaintainer
func (*PodInfoMaintainer) Equal ¶
func (m *PodInfoMaintainer) Equal(o *PodInfoMaintainer) bool
func (*PodInfoMaintainer) GetMaintainableInfoByPartition ¶
func (m *PodInfoMaintainer) GetMaintainableInfoByPartition(partitionInfo *PodPartitionInfo) PodMaintainableInfo
func (*PodInfoMaintainer) GetPodInfo ¶
func (m *PodInfoMaintainer) GetPodInfo(key string) *PodInfo
func (*PodInfoMaintainer) GetPods ¶
func (m *PodInfoMaintainer) GetPods() []*PodInfo
func (*PodInfoMaintainer) GetPodsWithAffinity ¶
func (m *PodInfoMaintainer) GetPodsWithAffinity() []*PodInfo
func (*PodInfoMaintainer) GetPodsWithRequiredAntiAffinity ¶
func (m *PodInfoMaintainer) GetPodsWithRequiredAntiAffinity() []*PodInfo
func (*PodInfoMaintainer) GetPrioritiesForPodsMayBePreempted ¶
func (m *PodInfoMaintainer) GetPrioritiesForPodsMayBePreempted(resourceType podutil.PodResourceType) []int64
func (*PodInfoMaintainer) GetVictimCandidates ¶
func (m *PodInfoMaintainer) GetVictimCandidates(partitionInfo *PodPartitionInfo) []*PodInfo
func (*PodInfoMaintainer) Len ¶
func (m *PodInfoMaintainer) Len() int
func (*PodInfoMaintainer) Range ¶
func (m *PodInfoMaintainer) Range(f func(*PodInfo))
func (*PodInfoMaintainer) RemovePodInfo ¶
func (m *PodInfoMaintainer) RemovePodInfo(p *PodInfo)
func (*PodInfoMaintainer) ReservedPodsNum ¶
func (m *PodInfoMaintainer) ReservedPodsNum() int
type PodInfoSlice ¶
type PodInfoSlice interface { Add(*PodInfo) bool Del(*PodInfo) bool Pods() []*PodInfo Len() int Clone() PodInfoSlice Equal(PodInfoSlice) bool }
PodInfoSlice maintains a linear PodInfo's slice. The time complexity of all methods is O(1).
func NewPodInfoSlice ¶
func NewPodInfoSlice() PodInfoSlice
type PodInfoSliceImpl ¶
type PodInfoSliceImpl struct {
// contains filtered or unexported fields
}
PodInfoSliceImpl holds a mapping of string keys to slice index, and slice to PodInfo. When adding a PodInfo, we will place it directly at the end of the slice. When deleting a PodInfo, we swap it with the last PodInfo and delete the last PodInfo.
func (*PodInfoSliceImpl) Add ¶
func (hs *PodInfoSliceImpl) Add(pi *PodInfo) bool
func (*PodInfoSliceImpl) Clone ¶
func (hs *PodInfoSliceImpl) Clone() PodInfoSlice
func (*PodInfoSliceImpl) Del ¶
func (hs *PodInfoSliceImpl) Del(pi *PodInfo) bool
func (*PodInfoSliceImpl) Equal ¶
func (hs *PodInfoSliceImpl) Equal(pis PodInfoSlice) bool
func (*PodInfoSliceImpl) Len ¶
func (hs *PodInfoSliceImpl) Len() int
func (*PodInfoSliceImpl) Pods ¶
func (hs *PodInfoSliceImpl) Pods() []*PodInfo
type PodMaintainableInfo ¶
PodMaintainableInfo implements splay.MaintainInfo. It maintains the subtree information rooted at the current node from the bottom up based on the left and right subtree information. Currently, the information maintained is the sum of all MilliCPU/Memory requests in a subtree. This will be used when we store PodInfo in splay-tree.
func (PodMaintainableInfo) Maintain ¶
func (o PodMaintainableInfo) Maintain(l splay.MaintainInfo, r splay.MaintainInfo) splay.MaintainInfo
type PodPartitionInfo ¶
type PodPartitionInfo struct {
// contains filtered or unexported fields
}
PodPartitionInfo records a pod Priority and a PodResourceType, which we use to partition all ordered pods in Splay-Tree. More precisely, we partition all pods for which `p.Compare` returns false into a subtree. For now, we perform the `p.Compare` operation based on Priority. This will be used when we store PodInfo in splay-tree.
func NewPartitionInfo ¶
func NewPartitionInfo(priorityLower, priorityUpper int64, resourceType podutil.PodResourceType) *PodPartitionInfo
func (*PodPartitionInfo) Compare ¶
func (p *PodPartitionInfo) Compare(o splay.Comparable) bool
type PodPreemptionInfo ¶
type PodProperty ¶
type PodProperty struct { Namespace string UnitKey string Priority int32 Qos podutil.PodResourceType SubCluster string }
func ExtractPodProperty ¶
func ExtractPodProperty(pod *v1.Pod) *PodProperty
ExtractPodProperty extract property from Pod, if Pod is nil return nil
func GetPodProperty ¶
func GetPodProperty(state *CycleState) (*PodProperty, error)
GetPodProperty returns the unit property from the state.
func (*PodProperty) ConvertToMetricsLabels ¶
func (p *PodProperty) ConvertToMetricsLabels() metrics.Labels
func (*PodProperty) ConvertToTracingTags ¶
func (p *PodProperty) ConvertToTracingTags() trace.SpanOption
type PostBindPlugin ¶
type PostBindPlugin interface { Plugin // PostBind is called after a pod is successfully bound. These plugins are // informational. A common application of this extension point is for cleaning // up. If a plugin needs to clean-up its state after a pod is scheduled and // bound, PostBind is the extension point that it should register. PostBind(ctx context.Context, state *CycleState, p *v1.Pod, nodeName string) }
PostBindPlugin is an interface that must be implemented by "PostBind" plugins. These plugins are called after a pod is successfully bound to a node.
type PostVictimCheckingPlugin ¶
type PostVictimCheckingPlugin interface { Plugin PostVictimChecking(*v1.Pod, *v1.Pod, *CycleState, *CycleState) *Status }
type PostVictimSearchingPlugin ¶
type PostVictimSearchingPlugin interface { Plugin PostVictimSearching(*v1.Pod, *PodInfo, *CycleState, *CycleState, *VictimState) *Status }
type PotentialVictim ¶
type PotentialVictims ¶
type PotentialVictims []PotentialVictim
type PotentialVictimsInNodes ¶
type PotentialVictimsInNodes struct {
// contains filtered or unexported fields
}
func NewPotentialVictimsInNodes ¶
func NewPotentialVictimsInNodes() *PotentialVictimsInNodes
func (*PotentialVictimsInNodes) GetPotentialVictims ¶
func (pv *PotentialVictimsInNodes) GetPotentialVictims(node string) []string
func (*PotentialVictimsInNodes) SetPotentialVictims ¶
func (pv *PotentialVictimsInNodes) SetPotentialVictims(node string, potentialVictims []string)
type PreBindPlugin ¶
type PreBindPlugin interface { Plugin // PreBind is called before binding a pod. All binder plugins must return // success or the pod will be rejected and won't be sent for binding. PreBind(ctx context.Context, state *CycleState, p *v1.Pod, nodeName string) *Status }
PreBindPlugin is an interface that must be implemented by "PreBind" plugins. These plugins are called before a pod being scheduled.
type PreFilterExtensions ¶
type PreFilterExtensions interface { // AddPod is called by the framework while trying to evaluate the impact // of adding podToAdd to the node while scheduling podToSchedule. AddPod(ctx context.Context, state *CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo NodeInfo) *Status // RemovePod is called by the framework while trying to evaluate the impact // of removing podToRemove from the node while scheduling podToSchedule. RemovePod(ctx context.Context, state *CycleState, podToSchedule *v1.Pod, podToRemove *v1.Pod, nodeInfo NodeInfo) *Status }
PreFilterExtensions is an interface that is included in plugins that allow specifying callbacks to make incremental updates to its supposedly pre-calculated state.
type PreFilterPlugin ¶
type PreFilterPlugin interface { Plugin // PreFilter is called at the beginning of the scheduling cycle. All PreFilter // plugins must return success or the pod will be rejected. PreFilter(ctx context.Context, state *CycleState, p *v1.Pod) *Status // PreFilterExtensions returns a PreFilterExtensions interface if the plugin implements one, // or nil if it does not. A Pre-filter plugin can provide extensions to incrementally // modify its pre-processed info. The framework guarantees that the extensions // AddPod/RemovePod will only be called after PreFilter, possibly on a cloned // CycleState, and may call those functions more than once before calling // Filter again on a specific node. PreFilterExtensions() PreFilterExtensions }
PreFilterPlugin is an interface that must be implemented by "prefilter" plugins. These plugins are called at the beginning of the scheduling cycle.
type PreScorePlugin ¶
type PreScorePlugin interface { Plugin // PreScore is called by the scheduling framework after a list of nodes // passed the filtering phase. All prescore plugins must return success or // the pod will be rejected PreScore(ctx context.Context, state *CycleState, pod *v1.Pod, nodes []NodeInfo) *Status }
PreScorePlugin is an interface for Pre-score plugin. Pre-score is an informational extension point. Plugins will be called with a list of nodes that passed the filtering phase. A plugin may use this data to update internal state or to generate logs/metrics.
type PreemptionError ¶
type PreemptionError string
PreemptionError describe that pod can't preempt any of candidate nodes. Note: we only return PreemptionError when PostPlugins return `Unschedulable` or `UnschedulableAndUnresolvable`.
func NewPreemptionError ¶
func NewPreemptionError(podKey string, candidateNodes int, status *Status) PreemptionError
func (PreemptionError) Error ¶
func (err PreemptionError) Error() string
type PreferNodeExtension ¶
type PreferNodeExtension interface { Plugin PrePreferNode(context.Context, *CycleState, *CycleState, *v1.Pod, NodeInfo) (NodeInfo, *CycleState, *Status) PostPreferNode(context.Context, *CycleState, *CycleState, *v1.Pod, NodeInfo, *Status) *Status // TODO: revisit this, should we pass in Status instead of `fit` bool? }
type PreferNodeExtensionList ¶
type PreferNodeExtensionList []PreferNodeExtension
func (PreferNodeExtensionList) PostPreferNode ¶
func (l PreferNodeExtensionList) PostPreferNode(ctx context.Context, unitCycleState *CycleState, podCycleState *CycleState, pod *v1.Pod, nodeInfo NodeInfo, status *Status) *Status
func (PreferNodeExtensionList) PrePreferNode ¶
func (l PreferNodeExtensionList) PrePreferNode(ctx context.Context, unitCycleState *CycleState, podCycleState *CycleState, pod *v1.Pod, nodeInfo NodeInfo) (NodeInfo, *CycleState, *Status)
type PreferredNodes ¶
type PreferredNodes interface { Add(NodeInfo, ...PreferNodeExtension) Get(nodeName string) PreferNodeExtensionList List() []NodeInfo }
func FilterPreferredNodes ¶
func FilterPreferredNodes(preferredNodes PreferredNodes, filterFunc func(NodeInfo) bool) PreferredNodes
func NewPreferredNodes ¶
func NewPreferredNodes() PreferredNodes
type PreferredNodesImpl ¶
type PreferredNodesImpl struct { NodeInfoHooks map[string]PreferNodeExtensionList NodeHashSlice NodeHashSlice }
func (*PreferredNodesImpl) Add ¶
func (i *PreferredNodesImpl) Add(nodeInfo NodeInfo, hooks ...PreferNodeExtension)
func (*PreferredNodesImpl) Get ¶
func (i *PreferredNodesImpl) Get(nodeName string) PreferNodeExtensionList
func (*PreferredNodesImpl) List ¶
func (i *PreferredNodesImpl) List() []NodeInfo
type ProtocolPort ¶
ProtocolPort represents a protocol port pair, e.g. tcp:80.
func NewProtocolPort ¶
func NewProtocolPort(protocol string, port int32) *ProtocolPort
NewProtocolPort creates a ProtocolPort instance.
type QueueSortPlugin ¶
type QueueSortPlugin interface { Plugin // Less are used to sort pods in the scheduling queue. Less(*QueuedPodInfo, *QueuedPodInfo) bool }
QueueSortPlugin is an interface that must be implemented to get sort score for pods in the scheduling queue.
type QueuedPodInfo ¶
type QueuedPodInfo struct { Pod *v1.Pod // The time pod added to the scheduling queue. Timestamp time.Time // Number of schedule attempts before successfully scheduled. // It's used to record the # attempts metric. Attempts int // The time when the pod is added to the queue for the first time. The pod may be added // back to the queue multiple times before it's successfully scheduled. // It shouldn't be updated once initialized. It's used to record the e2e scheduling // latency for a pod. InitialAttemptTimestamp time.Time // The time when the pod is first attempted to preempt victim pods. There can be // multiple attempts for this pod to wait on victim pods to be preempted, this // timestamp tracks the first time. It is used to timeout if the victim preemption // takes more time. InitialPreemptAttemptTimestamp time.Time // Fields below are only used by binder, need to move this out of QueuedPodInfo and put them into BinderQueuedPodInfo // TODO: (liumeng) implement BinderQueuedPodInfo ? // assumedPod ReservedPod *v1.Pod // NominatedNode contains victims and nominated node for the pod NominatedNode *NominatedNode // NoConflictStillInHandling indicates the pod passed the conflict checking phase // NewlyAssumedButStillInHandling indicates the pod passed the conflict checking phase // but is still in processing // TODO: when this field is moved from QueuedPodInfo to BindQueuedPodInfo, add more fine-grained states to avoid duplicated checking in binder workflow // for example: VictimsDeleting, ReadyForBinding ... NewlyAssumedButStillInHandling bool AllVolumeBound bool // QueueSpan is used to record queue updates QueueSpan *tracing.SpanInfo OwnerReferenceKey string // TODO: revisit this. // if this is true, we will remove fake pod and check conflicts. ReservationFakePod *v1.Pod // contains filtered or unexported fields }
QueuedPodInfo is a Pod wrapper with additional information related to the pod's status in the scheduling queue, such as the timestamp when it's added to the queue.
func (*QueuedPodInfo) DeepCopy ¶
func (pqi *QueuedPodInfo) DeepCopy() *QueuedPodInfo
DeepCopy returns a deep copy of the QueuedPodInfo object.
func (*QueuedPodInfo) GetPodProperty ¶
func (pqi *QueuedPodInfo) GetPodProperty() *PodProperty
func (*QueuedPodInfo) UpdateQueueStage ¶
func (pqi *QueuedPodInfo) UpdateQueueStage(queueStage string)
type QueuedUnitInfo ¶
type QueuedUnitInfo struct { UnitKey string ScheduleUnit // The time unit added to the scheduling queue (will be refreshed). Timestamp time.Time // Number of schedule attempts before successfully scheduled. // It's used to record the # attempts metric. Attempts int // The time when the unit is added to the queue for the first time. The unit may // back to the queue multiple times before it's successfully scheduled. // It shouldn't be updated once initialized. It's used to record the e2e sched // latency for a pod. InitialAttemptTimestamp time.Time // QueuePriorityScore is calculated according to pod.Spec, combined with priority. It should not change if no changes in pod.Spec. QueuePriorityScore float64 }
QueuedUnitInfo is a Unit wrapper with additional information related to the unit's status in the scheduling queue, such as the timestamp when it's added to the queue.
func NewQueuedUnitInfo ¶
func NewQueuedUnitInfo(unitKey string, unit ScheduleUnit, clock godelutil.Clock) *QueuedUnitInfo
NewQueuedUnitInfo builds a QueuedPodInfo object.
func (*QueuedUnitInfo) String ¶
func (qui *QueuedUnitInfo) String() string
type RecorderFactory ¶
type RecorderFactory func(string) events.EventRecorder
RecorderFactory builds an EventRecorder for a given scheduler name.
type ReservationPlaceholderMap ¶
func (ReservationPlaceholderMap) String ¶
func (r ReservationPlaceholderMap) String() string
type ReservationPlaceholdersOfNodes ¶
type ReservationPlaceholdersOfNodes map[string]ReservationPlaceholderMap
func (ReservationPlaceholdersOfNodes) String ¶
func (p ReservationPlaceholdersOfNodes) String() string
type ReservePlugin ¶
type ReservePlugin interface { Plugin // Reserve is called by the scheduling framework when the scheduler cache is // updated. If this method returns a failed Status, the scheduler will call // the Unreserve method for all enabled ReservePlugins. Reserve(ctx context.Context, state *CycleState, p *v1.Pod, nodeName string) *Status // Unreserve is called by the scheduling framework when a reserved pod was // rejected, an error occurred during reservation of subsequent plugins, or // in a later phase. The Unreserve method implementation must be idempotent // and may be called by the scheduler even if the corresponding Reserve // method for the same plugin was not called. Unreserve(ctx context.Context, state *CycleState, p *v1.Pod, nodeName string) }
ReservePlugin is an interface for plugins with Reserve and Unreserve methods. These are meant to update the state of the plugin. This concept used to be called 'assume' in the original scheduler. These plugins should return only Success or Error in Status.code. However, the scheduler accepts other valid codes as well. Anything other than Success will lead to rejection of the pod.
type Resource ¶
type Resource struct { MilliCPU int64 Memory int64 EphemeralStorage int64 // We store allowedPodNumber (which is Node.Status.Allocatable.Pods().Value()) // explicitly as int, to avoid conversions and improve performance. AllowedPodNumber int // ScalarResources ScalarResources map[v1.ResourceName]int64 }
Resource is a collection of compute resource.
func CalculateResource ¶
resourceRequest = max(sum(podSpec.Containers), podSpec.InitContainers) + overHead
func NewResource ¶
func NewResource(rl v1.ResourceList) *Resource
NewResource creates a Resource from ResourceList
func NewResourceFromPtr ¶
func NewResourceFromPtr(rl *v1.ResourceList) *Resource
NewResource creates a Resource from ResourceList pointer
func (*Resource) Add ¶
func (r *Resource) Add(rl v1.ResourceList)
Add adds ResourceList into Resource.
func (*Resource) AddResource ¶
AddResource adds another Resource, this method could avoid Resource to ResourceList conversion
func (*Resource) AddScalar ¶
func (r *Resource) AddScalar(name v1.ResourceName, quantity int64)
AddScalar adds a resource by a scalar value of this resource.
func (*Resource) ResourceList ¶
func (r *Resource) ResourceList() v1.ResourceList
ResourceList returns a resource list of this resource.
func (*Resource) SetMaxResource ¶
func (r *Resource) SetMaxResource(rl v1.ResourceList)
SetMaxResource compares with ResourceList and takes max value for each Resource.
func (*Resource) SetMinResource ¶
func (r *Resource) SetMinResource(rl v1.ResourceList)
SetMinResource compares with ResourceList and takes min value for each Resource.
func (*Resource) SetScalar ¶
func (r *Resource) SetScalar(name v1.ResourceName, quantity int64)
SetScalar sets a resource by a scalar value of this resource.
func (*Resource) Sub ¶
func (r *Resource) Sub(rl v1.ResourceList)
Sub subs ResourceList into Resource.
func (*Resource) SubResource ¶
type ResourceStatus ¶
type ResourceStatus struct { Allocatable *resource.Quantity Available *resource.Quantity Users sets.String }
func (*ResourceStatus) Equal ¶
func (s *ResourceStatus) Equal(s2 *ResourceStatus) bool
type ScheduleUnit ¶
type ScheduleUnit interface { // Name is schedule unit name. // Name() string // Type is the schedule unit type. e.g. PodGroupUnit, DeploymentUnit, etc Type() ScheduleUnitType // GetKey returns the key of unit. This should be unique globally. GetKey() string // TODO: Should GetName()、GetNamespace() be there? // GetName returns the name of unit. GetName() string // GetNamespace returns the namespace of unit. GetNamespace() string // ReadyToBePopulated is used to determine whether the unit is ready to be populated. // This is a precondition check to schedule corresponding pods belonging to the unit. ReadyToBePopulated() bool // PodBelongToUnit is used in event handling to determine if a pod is a naked pod, or it belongs to unit. // If it does belong to the unit, the pods will be put into dedicated scheduling queue. PodBelongToUnit(pod *v1.Pod) bool // GetCreationTimestamp returns the creation timestamp of the original object. GetCreationTimestamp() *metav1.Time // GetEnqueuedTimestamp returns the timestamp when the unit is added to pending queue. GetEnqueuedTimestamp() *metav1.Time // GetPriority returns the priority score which is used to rank units in the readyQ GetPriority() int32 // GetPods returns all pods belongs to this unit GetPods() []*QueuedPodInfo // ValidatePodCount checks if the podCount is a valid number in a batch operation for this unit ValidatePodCount(podCount int) bool // NumPods return the number of QueuedPodInfos in the unit NumPods() int // GetPod return a QueuedPodInfo with the same pod.UID GetPod(pod *QueuedPodInfo) *QueuedPodInfo // AddPod adds QueuedPodInfo into the Unit AddPod(pod *QueuedPodInfo) error // AddPods adds QueuedPodInfo into the Unit AddPods(pods []*QueuedPodInfo) error // UpdatePod updates QueuedPodInfo in the Unit UpdatePod(pod *QueuedPodInfo) error // DeletePod deletes QueuedPodInfo from the Unit DeletePod(pod *QueuedPodInfo) error // AddPodsIfNotPresent adds pods not existed in the Unit AddPodsIfNotPresent(pods ...*QueuedPodInfo) error GetTimeoutPeriod() int32 // GetAnnotations returns the annotations of the Unit GetAnnotations() map[string]string // GetMinMember gets the min member value GetMinMember() (int, error) // GetRequiredAffinity returns required affinity scheduling rules, which // must be met in scheduling. GetRequiredAffinity() ([]UnitAffinityTerm, error) // GetPreferredAffinity returns preferred affinity scheduling rules, which // don't necessarily have to be satisfied but scheduler will prefer to schedule pods // to nodes that satisfy the affinity rules. GetPreferredAffinity() ([]UnitAffinityTerm, error) // GetAffinityNodeSelector returns the nodeSelector in affinity which defines the specific affinity rules. GetAffinityNodeSelector() (*v1.NodeSelector, error) // GetSortRulesForAffinity return the rules that indicate how the nodeGroups are sorted. // The rule's index in slice is the sort sequence. GetSortRulesForAffinity() []SortRule // IsDebugModeOn checks whether the debug mode is set to on IsDebugModeOn() bool // SetEnqueuedTimeStamp set the timestamp when the unit is added to pending queue SetEnqueuedTimeStamp(time.Time) // GetUnitProperty returns unit property to be used by metrics and tracing GetUnitProperty() UnitProperty // ResetPods will empty all pods for the unit // It will be used by binder when we want to re-enqueue the unit (empty pods and then add waiting pods back) ResetPods() }
ScheduleUnit is an interface that must be implemented by `podGroup` or other plugins. These plugins are called in the middle of the scheduling cycle.
type ScheduleUnitProperty ¶
type ScheduleUnitProperty struct { // TODO: figure out whether we should embed PodProperty into ScheduleUnitProperty *PodProperty MinMember int UnitType string }
func NewScheduleUnitProperty ¶
func NewScheduleUnitProperty(unit ScheduleUnit) (*ScheduleUnitProperty, error)
func (*ScheduleUnitProperty) ConvertToMetricsLabels ¶
func (up *ScheduleUnitProperty) ConvertToMetricsLabels() metrics.Labels
func (*ScheduleUnitProperty) ConvertToTracingTags ¶
func (up *ScheduleUnitProperty) ConvertToTracingTags() trace.SpanOption
func (*ScheduleUnitProperty) GetPodProperty ¶
func (up *ScheduleUnitProperty) GetPodProperty() *PodProperty
type ScheduleUnitType ¶
type ScheduleUnitType string
ScheduleUnitType describes the type of the unit.
const ( PodGroupUnitType ScheduleUnitType = "PodGroupUnit" SinglePodUnitType ScheduleUnitType = "SinglePodUnit" )
type SchedulerFramework ¶
type SchedulerFramework interface { // RunPreFilterPlugins runs the set of configured prefilter plugins. It returns // *Status and its code is set to non-success if any of the plugins returns // anything but Success. If a non-success status is returned, then the scheduling // cycle is aborted. RunPreFilterPlugins(ctx context.Context, state *CycleState, pod *v1.Pod) *Status // RunFilterPlugins runs the set of configured filter plugins for pod on // the given node. Note that for the node being evaluated, the passed nodeInfo // reference could be different from the one in NodeInfoSnapshot map (e.g., pods // considered to be running on the node could be different). For example, during // preemption, we may pass a copy of the original nodeInfo object that has some pods // removed from it to evaluate the possibility of preempting them to // schedule the target pod. RunFilterPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeInfo NodeInfo, skipPlugins ...string) PluginToStatus // RunPreFilterExtensionAddPod calls the AddPod interface for the set of configured // PreFilter plugins. It returns directly if any of the plugins return any // status other than Success. RunPreFilterExtensionAddPod(ctx context.Context, state *CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo NodeInfo) *Status // RunPreFilterExtensionRemovePod calls the RemovePod interface for the set of configured // PreFilter plugins. It returns directly if any of the plugins return any // status other than Success. RunPreFilterExtensionRemovePod(ctx context.Context, state *CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo NodeInfo) *Status // RunPreScorePlugins runs the set of configured pre-score plugins. If any // of these plugins returns any status other than "Success", the given pod is rejected. RunPreScorePlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodes []NodeInfo) *Status // RunScorePlugins runs the set of configured scoring plugins. It returns a map that // stores for each scoring plugin name the corresponding NodeScoreList(s). // It also returns *Status, which is set to non-success if any of the plugins returns // a non-success status. RunScorePlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeNames []string) (PluginToNodeScores, *Status) // HasFilterPlugins returns true if at least one filter plugin is defined. HasFilterPlugins() bool // HasScorePlugins returns true if at least one score plugin is defined. HasScorePlugins() bool // ListPlugins returns a map of extension point name to list of configured Plugins. ListPlugins() map[string]sets.String // InitCycleState returns a new cycle state to be used in scheduling process, storing default common data from pod annotation in CycleState // This function is used to reduce unmarshalling operations in plugins for pod annotations. InitCycleState(pod *v1.Pod) (*CycleState, error) SetPotentialVictims(node string, potentialVictims []string) GetPotentialVictims(node string) []string HasCrossNodesConstraints(ctx context.Context, pod *v1.Pod) bool }
SchedulerFramework manages the set of plugins in use by Scheduler. Configured plugins are called at specified points in a scheduling context.
type SchedulerPreemptionFramework ¶
type SchedulerPreemptionFramework interface { ListPlugins() map[string]sets.String HasVictimSearchingPlugin(string) bool RunClusterPrePreemptingPlugins(preemptor *v1.Pod, state, commonState *CycleState) *Status RunNodePrePreemptingPlugins(preemptor *v1.Pod, nodeInfo NodeInfo, state *CycleState, preemptorState *CycleState) *Status RunVictimSearchingPlugins(preemptor *v1.Pod, podInfo *PodInfo, state, preemptionState *CycleState, victimState *VictimState) (Code, string) RunPostVictimSearchingPlugins(preemptor *v1.Pod, podInfo *PodInfo, state, preemptionState *CycleState, victimState *VictimState) *Status RunNodePostPreemptingPlugins(preemptor *v1.Pod, victims []*v1.Pod, state, commonState *CycleState) *Status RunCandidatesSortingPlugins(candidates []*Candidate, candidate *Candidate) []*Candidate }
type SchedulingStage ¶
type SchedulingStage int
type SchedulingStagesState ¶
type SchedulingStagesState int
func GetPodSchedulingStagesStageInCycleState ¶
func GetPodSchedulingStagesStageInCycleState(cycleState *CycleState) SchedulingStagesState
func SetSchedulingStageState ¶
func SetSchedulingStageState(currentStates SchedulingStagesState, changedStage SchedulingStage, expectedExecute bool) SchedulingStagesState
type ScoreExtensions ¶
type ScoreExtensions interface { // NormalizeScore is called for all node scores produced by the same plugin's "Score" // method. A successful run of NormalizeScore will update the scores list and return // a success status. NormalizeScore(ctx context.Context, state *CycleState, p *v1.Pod, scores NodeScoreList) *Status }
ScoreExtensions is an interface for Score extended functionality.
type ScorePlugin ¶
type ScorePlugin interface { Plugin // Score is called on each filtered node. It must return success and an integer // indicating the rank of the node. All scoring plugins must return success or // the pod will be rejected. Score(ctx context.Context, state *CycleState, p *v1.Pod, nodeName string) (int64, *Status) // ScoreExtensions returns a ScoreExtensions interface if it implements one, or nil if it does not. ScoreExtensions() ScoreExtensions }
ScorePlugin is an interface that must be implemented by "score" plugins to rank nodes that passed the filtering phase.
type SinglePodUnit ¶
type SinglePodUnit struct { Pod *QueuedPodInfo // contains filtered or unexported fields }
func NewSinglePodUnit ¶
func NewSinglePodUnit(podInfo *QueuedPodInfo) *SinglePodUnit
func (*SinglePodUnit) AddPod ¶
func (s *SinglePodUnit) AddPod(pod *QueuedPodInfo) error
func (*SinglePodUnit) AddPods ¶
func (s *SinglePodUnit) AddPods(pods []*QueuedPodInfo) error
func (*SinglePodUnit) AddPodsIfNotPresent ¶
func (s *SinglePodUnit) AddPodsIfNotPresent(pods ...*QueuedPodInfo) error
func (*SinglePodUnit) DeletePod ¶
func (s *SinglePodUnit) DeletePod(pod *QueuedPodInfo) error
func (*SinglePodUnit) GetAffinityNodeSelector ¶
func (s *SinglePodUnit) GetAffinityNodeSelector() (*v1.NodeSelector, error)
func (*SinglePodUnit) GetAnnotations ¶
func (s *SinglePodUnit) GetAnnotations() map[string]string
func (*SinglePodUnit) GetCreationTimestamp ¶
func (s *SinglePodUnit) GetCreationTimestamp() *metav1.Time
func (*SinglePodUnit) GetEnqueuedTimestamp ¶
func (s *SinglePodUnit) GetEnqueuedTimestamp() *metav1.Time
func (*SinglePodUnit) GetKey ¶
func (s *SinglePodUnit) GetKey() string
func (*SinglePodUnit) GetMinMember ¶
func (s *SinglePodUnit) GetMinMember() (int, error)
func (*SinglePodUnit) GetName ¶
func (s *SinglePodUnit) GetName() string
func (*SinglePodUnit) GetNamespace ¶
func (s *SinglePodUnit) GetNamespace() string
func (*SinglePodUnit) GetPod ¶
func (s *SinglePodUnit) GetPod(pod *QueuedPodInfo) *QueuedPodInfo
func (*SinglePodUnit) GetPods ¶
func (s *SinglePodUnit) GetPods() []*QueuedPodInfo
If iterating the map is a performance concern here, we can introduce more complex data structure.
func (*SinglePodUnit) GetPreferredAffinity ¶
func (s *SinglePodUnit) GetPreferredAffinity() ([]UnitAffinityTerm, error)
func (*SinglePodUnit) GetPriority ¶
func (s *SinglePodUnit) GetPriority() int32
func (*SinglePodUnit) GetRequiredAffinity ¶
func (s *SinglePodUnit) GetRequiredAffinity() ([]UnitAffinityTerm, error)
func (*SinglePodUnit) GetSortRulesForAffinity ¶
func (s *SinglePodUnit) GetSortRulesForAffinity() []SortRule
func (*SinglePodUnit) GetTimeoutPeriod ¶
func (s *SinglePodUnit) GetTimeoutPeriod() int32
func (*SinglePodUnit) GetUnitProperty ¶
func (s *SinglePodUnit) GetUnitProperty() UnitProperty
func (*SinglePodUnit) IsDebugModeOn ¶
func (s *SinglePodUnit) IsDebugModeOn() bool
func (*SinglePodUnit) NumPods ¶
func (s *SinglePodUnit) NumPods() int
func (*SinglePodUnit) PodBelongToUnit ¶
func (s *SinglePodUnit) PodBelongToUnit(pod *v1.Pod) bool
func (*SinglePodUnit) ReadyToBePopulated ¶
func (s *SinglePodUnit) ReadyToBePopulated() bool
func (*SinglePodUnit) ResetPods ¶
func (s *SinglePodUnit) ResetPods()
func (*SinglePodUnit) SetEnqueuedTimeStamp ¶
func (s *SinglePodUnit) SetEnqueuedTimeStamp(ts time.Time)
func (*SinglePodUnit) String ¶
func (s *SinglePodUnit) String() string
func (*SinglePodUnit) Type ¶
func (s *SinglePodUnit) Type() ScheduleUnitType
func (*SinglePodUnit) UpdatePod ¶
func (s *SinglePodUnit) UpdatePod(pod *QueuedPodInfo) error
func (*SinglePodUnit) ValidatePodCount ¶
func (s *SinglePodUnit) ValidatePodCount(podCnt int) bool
type SortDimension ¶
type SortDimension string
const ( Capacity SortDimension = "Capacity" Available SortDimension = "Available" )
type SortResource ¶
type SortResource string
SortResource is the resource that items are sorted by.
const ( // GPUResource means items are sorted by GPU resource. GPUResource SortResource = "GPU" // CPUResource means items are sorted by CPU resource. CPUResource SortResource = "CPU" // MemoryResource means items are sorted by Memory Resource. MemoryResource SortResource = "Memory" )
type SortRule ¶
type SortRule struct { // Resource defines the resource name for sorting. Resource SortResource // Dimension may be Capacity or Available for the moment Dimension SortDimension // Order may be either Ascending or Descending Order SortOrder }
SortRule defines the rule for sorting items.
type StateData ¶
type StateData interface { // Clone is an interface to make a copy of StateData. For performance reasons, // clone should make shallow copies for members (e.g., slices or maps) that are not // impacted by PreFilter's optional AddPod/RemovePod methods. Clone() StateData }
StateData is a generic type for arbitrary data stored in CycleState.
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status indicates the result of running a plugin. It consists of a code, a message and (optionally) an error. When the status code is not `Success`, the reasons should explain why. NOTE: A nil Status is also considered as Success.
func (*Status) AppendReason ¶
AppendReason appends given reason to the Status.
func (*Status) AsError ¶
AsError returns nil if the status is a success; otherwise returns an "error" object with a concatenated message on reasons of the Status.
func (*Status) IsSuccess ¶
IsSuccess returns true if and only if "Status" is nil or Code is "Success".
func (*Status) IsUnschedulable ¶
IsUnschedulable returns true if "Status" is Unschedulable (Unschedulable or UnschedulableAndUnresolvable).
type StoredUnit ¶
type StoredUnit interface { GetPods() []*QueuedPodInfo NumPods() int GetKey() string }
type SuggestionForNode ¶
type SuggestionForNode struct {
// contains filtered or unexported fields
}
func NewSuggestionForNode ¶
func NewSuggestionForNode() *SuggestionForNode
func (*SuggestionForNode) AddAssumedPod ¶
func (s *SuggestionForNode) AddAssumedPod(podKey string)
func (*SuggestionForNode) DeleteMovement ¶
func (s *SuggestionForNode) DeleteMovement() bool
func (*SuggestionForNode) GetActualPods ¶
func (s *SuggestionForNode) GetActualPods() []string
func (*SuggestionForNode) GetAssumedPods ¶
func (s *SuggestionForNode) GetAssumedPods() []string
func (*SuggestionForNode) GetGeneration ¶
func (s *SuggestionForNode) GetGeneration() int64
func (*SuggestionForNode) RemoveAssumedPod ¶
func (s *SuggestionForNode) RemoveAssumedPod(podKey string) bool
func (*SuggestionForNode) Replace ¶
func (s *SuggestionForNode) Replace(newSuggestion *SuggestionForNode)
func (*SuggestionForNode) SetActualPods ¶
func (s *SuggestionForNode) SetActualPods(actualPods []string)
func (*SuggestionForNode) SetAssumedPods ¶
func (s *SuggestionForNode) SetAssumedPods(assumedPods []string)
func (*SuggestionForNode) SetDesiredPodCound ¶
func (s *SuggestionForNode) SetDesiredPodCound(desiredPodCound int64)
func (*SuggestionForNode) SetGeneration ¶
func (s *SuggestionForNode) SetGeneration(generation int64)
type SwitchType ¶
type SwitchType int64
func ClusterIndexToBESwitchType ¶
func ClusterIndexToBESwitchType(x int) SwitchType
func ClusterIndexToGTSwitchType ¶
func ClusterIndexToGTSwitchType(x int) SwitchType
func ParseSwitchTypeFromSubCluster ¶
func ParseSwitchTypeFromSubCluster(subCluster string) SwitchType
func (SwitchType) String ¶
func (st SwitchType) String() string
type TransientSchedulerInfo ¶
type TransientSchedulerInfo struct { TransientLock sync.Mutex // NodeTransInfo holds the information related to nodeTransientInformation. NodeName is the key here. TransNodeInfo nodeTransientInfo }
TransientSchedulerInfo is a transient structure which is destructed at the end of each scheduling cycle. It consists of items that are valid for a scheduling cycle and is used for message passing across predicates and priorities. Some examples which could be used as fields are number of volumes being used on node, current utilization on node etc. IMPORTANT NOTE: Make sure that each field in this structure is documented along with usage. Expand this structure only when absolutely needed as this data structure will be created and destroyed during every scheduling cycle.
func NewTransientSchedulerInfo ¶
func NewTransientSchedulerInfo() *TransientSchedulerInfo
NewTransientSchedulerInfo returns a new scheduler transient structure with initialized values.
func (*TransientSchedulerInfo) Equal ¶
func (transientSchedInfo *TransientSchedulerInfo) Equal(o *TransientSchedulerInfo) bool
func (*TransientSchedulerInfo) ResetTransientSchedulerInfo ¶
func (transientSchedInfo *TransientSchedulerInfo) ResetTransientSchedulerInfo()
ResetTransientSchedulerInfo resets the TransientSchedulerInfo.
type UnitAffinityTerm ¶
type UnitAffinityTerm struct {
TopologyKey string
}
type UnitLessFunc ¶
type UnitLessFunc func(unitInfo1, unitInfo2 *QueuedUnitInfo) bool
UnitLessFunc is the function to sort unit info
type UnitProperty ¶
type UnitProperty interface { GetPodProperty() *PodProperty ObserveProperty }
type UnitQueueSortPlugin ¶
type UnitQueueSortPlugin interface { Plugin Less(*QueuedUnitInfo, *QueuedUnitInfo) bool }
UnitQueueSortPlugin is an interface that must be implemented by "QueueSort" plugins. These plugins are used to sort units in the scheduling unit queue. Only one queue sort plugin may be enabled at a time.
type UnitSchedulingRequest ¶
UnitSchedulingRequest contains necessary info used for making better scheduling decisions
type VictimCheckingPlugin ¶
type VictimCheckingPlugin interface { Plugin VictimChecking(*v1.Pod, *v1.Pod, *CycleState, *CycleState) (Code, string) }
type VictimCheckingPluginCollection ¶
type VictimCheckingPluginCollection struct {
// contains filtered or unexported fields
}
func NewVictimCheckingPluginCollection ¶
func NewVictimCheckingPluginCollection(plugins []VictimCheckingPlugin, enableQuickPass, forceQuickPass bool) *VictimCheckingPluginCollection
func (*VictimCheckingPluginCollection) EnableQuickPass ¶
func (ppc *VictimCheckingPluginCollection) EnableQuickPass() bool
func (*VictimCheckingPluginCollection) ForceQuickPass ¶
func (ppc *VictimCheckingPluginCollection) ForceQuickPass() bool
func (*VictimCheckingPluginCollection) GetVictimCheckingPlugins ¶
func (ppc *VictimCheckingPluginCollection) GetVictimCheckingPlugins() []VictimCheckingPlugin
func (*VictimCheckingPluginCollection) RejectNotSure ¶
func (ppc *VictimCheckingPluginCollection) RejectNotSure() bool
type VictimCheckingPluginCollectionSpec ¶
type VictimCheckingPluginCollectionSpec struct { ForceQuickPassVal bool EnableQuickPassVal bool Plugins []*PluginSpec }
func NewVictimCheckingPluginCollectionSpec ¶
func NewVictimCheckingPluginCollectionSpec(preemptions []binderconfig.Plugin, enableQuickPass, forceQuickPass bool) *VictimCheckingPluginCollectionSpec
func (*VictimCheckingPluginCollectionSpec) EnableQuickPass ¶
func (pps *VictimCheckingPluginCollectionSpec) EnableQuickPass() bool
func (*VictimCheckingPluginCollectionSpec) ForceQuickPass ¶
func (pps *VictimCheckingPluginCollectionSpec) ForceQuickPass() bool
func (*VictimCheckingPluginCollectionSpec) GetSearchingPlugins ¶
func (pps *VictimCheckingPluginCollectionSpec) GetSearchingPlugins() []*PluginSpec
type VictimPods ¶
type VictimPods []VictimPod
func (VictimPods) DeepCopy ¶
func (vp VictimPods) DeepCopy() VictimPods
func (VictimPods) Marshall ¶
func (vp VictimPods) Marshall() string
type VictimSearchingPlugin ¶
type VictimSearchingPlugin interface { Plugin VictimSearching(*v1.Pod, *PodInfo, *CycleState, *CycleState, *VictimState) (Code, string) }
type VictimSearchingPluginCollection ¶
type VictimSearchingPluginCollection struct {
// contains filtered or unexported fields
}
func NewVictimSearchingPluginCollection ¶
func NewVictimSearchingPluginCollection(plugins []VictimSearchingPlugin, enableQuickPass, forceQuickPass, rejectNotSure bool) *VictimSearchingPluginCollection
func (*VictimSearchingPluginCollection) EnableQuickPass ¶
func (ppc *VictimSearchingPluginCollection) EnableQuickPass() bool
func (*VictimSearchingPluginCollection) ForceQuickPass ¶
func (ppc *VictimSearchingPluginCollection) ForceQuickPass() bool
func (*VictimSearchingPluginCollection) GetVictimSearchingPlugins ¶
func (ppc *VictimSearchingPluginCollection) GetVictimSearchingPlugins() []VictimSearchingPlugin
func (*VictimSearchingPluginCollection) RejectNotSure ¶
func (ppc *VictimSearchingPluginCollection) RejectNotSure() bool
type VictimSearchingPluginCollectionSpec ¶
type VictimSearchingPluginCollectionSpec struct { ForceQuickPassVal bool EnableQuickPassVal bool RejectNotSureVal bool Plugins []*PluginSpec }
func NewVictimSearchingPluginCollectionSpec ¶
func NewVictimSearchingPluginCollectionSpec(preemptions []config.Plugin, enableQuickPass, forceQuickPass, rejectNotSure bool) *VictimSearchingPluginCollectionSpec
func (*VictimSearchingPluginCollectionSpec) EnableQuickPass ¶
func (pps *VictimSearchingPluginCollectionSpec) EnableQuickPass() bool
func (*VictimSearchingPluginCollectionSpec) ForceQuickPass ¶
func (pps *VictimSearchingPluginCollectionSpec) ForceQuickPass() bool
func (*VictimSearchingPluginCollectionSpec) GetSearchingPlugins ¶
func (pps *VictimSearchingPluginCollectionSpec) GetSearchingPlugins() []*PluginSpec
func (*VictimSearchingPluginCollectionSpec) RejectNotSure ¶
func (pps *VictimSearchingPluginCollectionSpec) RejectNotSure() bool
type VictimState ¶
func NewVictimState ¶
func NewVictimState() *VictimState
type Victims ¶
type Victims struct { Pods []*v1.Pod PreemptionState *CycleState }
Victims represents: Pods: a group of pods expected to be preempted. PreemptionState: save state of all victims in each node
type WeightedAffinityTerm ¶
type WeightedAffinityTerm struct { AffinityTerm Weight int32 }
WeightedAffinityTerm is a "processed" representation of v1.WeightedAffinityTerm.
Source Files ¶
- cache_podinfo.go
- candidate.go
- common_state.go
- cycle_state.go
- error.go
- interface.go
- listers.go
- movement.go
- node_group.go
- nodeinfo.go
- nodeinfo_hashslice.go
- nodeinfo_podinfo.go
- pdb_related.go
- podgroup.go
- reservation.go
- switch.go
- types.go
- unit.go
- unit_property.go
- unit_scheduling_types.go
- unit_sortrule.go