framework

package
v0.0.0-...-93f74c0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) *NodeInfo

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

func WrapSchedulerNodeInfos

func WrapSchedulerNodeInfos(schedNodeInfos []*schedulerframework.NodeInfo) []*NodeInfo

WrapSchedulerNodeInfos wraps a list of *schedulerframework.NodeInfos into internal *NodeInfos.

func (*NodeInfo) AddPod

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

AddPod adds the given Pod and associated data to 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) 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 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

	// NeededResourceClaims contains ResourceClaim objects needed by the Pod.
	NeededResourceClaims []*resourceapi.ResourceClaim
}

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

Jump to

Keyboard shortcuts

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