framework

package
v0.0.0-...-883fa4f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DelegatingSchedulerSharedLister

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

DelegatingSchedulerSharedLister implements schedulerframework interfaces by passing the logic to a delegate. Delegate can be updated.

func NewDelegatingSchedulerSharedLister

func NewDelegatingSchedulerSharedLister() *DelegatingSchedulerSharedLister

NewDelegatingSchedulerSharedLister creates new NewDelegatingSchedulerSharedLister

func (*DelegatingSchedulerSharedLister) DeviceClasses

DeviceClasses returns a DeviceClassLister.

func (*DelegatingSchedulerSharedLister) NodeInfos

NodeInfos returns a NodeInfoLister.

func (*DelegatingSchedulerSharedLister) ResetDelegate

func (lister *DelegatingSchedulerSharedLister) ResetDelegate()

ResetDelegate resets delegate to

func (*DelegatingSchedulerSharedLister) ResourceClaims

ResourceClaims returns a ResourceClaimTracker.

func (*DelegatingSchedulerSharedLister) ResourceSlices

ResourceSlices returns a ResourceSliceLister.

func (*DelegatingSchedulerSharedLister) StorageInfos

StorageInfos returns a StorageInfoLister

func (*DelegatingSchedulerSharedLister) UpdateDelegate

func (lister *DelegatingSchedulerSharedLister) UpdateDelegate(delegate SharedLister)

UpdateDelegate updates the delegate

type Handle

type Handle struct {
	Framework        schedulerframework.Framework
	DelegatingLister *DelegatingSchedulerSharedLister
}

Handle is meant for interacting with the scheduler framework.

func NewHandle

func NewHandle(informerFactory informers.SharedInformerFactory, schedConfig *schedulerconfig.KubeSchedulerConfiguration, draEnabled bool) (*Handle, error)

NewHandle builds a framework Handle based on the provided informers and scheduler config.

func NewTestFrameworkHandle

func NewTestFrameworkHandle() (*Handle, error)

NewTestFrameworkHandle creates a Handle that can be used in tests.

func NewTestFrameworkHandleOrDie

func NewTestFrameworkHandleOrDie(t testFailer) *Handle

NewTestFrameworkHandleOrDie creates a Handle that can be used in tests.

type NodeInfo

type NodeInfo struct {

	// LocalResourceSlices contains all node-local ResourceSlices exposed by this Node.
	LocalResourceSlices []*resourceapi.ResourceSlice
	// contains filtered or unexported fields
}

NodeInfo contains all necessary information about a Node that Cluster Autoscaler needs to track. It's essentially a wrapper around schedulerframework.NodeInfo, with extra data on top.

func NewNodeInfo

func NewNodeInfo(node *apiv1.Node, slices []*resourceapi.ResourceSlice, pods ...*PodInfo) *NodeInfo

NewNodeInfo returns a new internal NodeInfo from the provided data.

func NewTestNodeInfo

func NewTestNodeInfo(node *apiv1.Node, pods ...*apiv1.Pod) *NodeInfo

NewTestNodeInfo returns a new NodeInfo without any DRA information - only to be used in test code. Production code should always take DRA objects into account.

func WrapSchedulerNodeInfo

func WrapSchedulerNodeInfo(schedNodeInfo *schedulerframework.NodeInfo, slices []*resourceapi.ResourceSlice, podExtraInfos map[types.UID]PodExtraInfo) *NodeInfo

WrapSchedulerNodeInfo wraps a *schedulerframework.NodeInfo into an internal *NodeInfo.

func (*NodeInfo) AddPod

func (n *NodeInfo) AddPod(pod *PodInfo)

AddPod adds the given Pod and associated data to the NodeInfo.

func (*NodeInfo) DeepCopy

func (n *NodeInfo) DeepCopy() *NodeInfo

DeepCopy clones the NodeInfo.

func (*NodeInfo) Node

func (n *NodeInfo) Node() *apiv1.Node

Node returns the Node set in this NodeInfo.

func (*NodeInfo) Pods

func (n *NodeInfo) Pods() []*PodInfo

Pods returns the Pods scheduled on this NodeInfo, along with all their associated data.

func (*NodeInfo) RemovePod

func (n *NodeInfo) RemovePod(pod *apiv1.Pod) error

RemovePod removes the given pod and its associated data from the NodeInfo.

func (*NodeInfo) ResourceClaims

func (n *NodeInfo) ResourceClaims() []*resourceapi.ResourceClaim

ResourceClaims returns all ResourceClaims contained in the PodInfos in this NodeInfo. Shared claims are taken into account, each claim should only be returned once.

func (*NodeInfo) SetNode

func (n *NodeInfo) SetNode(node *apiv1.Node)

SetNode sets the Node in this NodeInfo

func (*NodeInfo) ToScheduler

func (n *NodeInfo) ToScheduler() *schedulerframework.NodeInfo

ToScheduler returns the embedded *schedulerframework.NodeInfo portion of the tracked data.

type PodExtraInfo

type PodExtraInfo struct {
	// NeededResourceClaims contains ResourceClaim objects needed by the Pod.
	NeededResourceClaims []*resourceapi.ResourceClaim
}

PodExtraInfo contains all necessary information about a Pod that Cluster Autoscaler needs to track, apart from the Pod itself. This is extracted from PodInfo so that it can be stored separately from the Pod.

type PodInfo

type PodInfo struct {
	// This type embeds *apiv1.Pod to make the accesses easier - most of the code just needs to access the Pod.
	*apiv1.Pod
	// PodExtraInfo is an embedded struct containing all additional information that CA needs to track about a Pod.
	PodExtraInfo
}

PodInfo contains all necessary information about a Pod that Cluster Autoscaler needs to track.

func NewPodInfo

func NewPodInfo(pod *apiv1.Pod, claims []*resourceapi.ResourceClaim) *PodInfo

NewPodInfo is a convenience function for creating new PodInfos without typing out the "PodExtraInfo" part.

type SharedLister

SharedLister groups all interfaces that Cluster Autoscaler needs to implement for integrating with kube-scheduler.

Jump to

Keyboard shortcuts

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