cache

package
v0.5.14 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCache

func GetCache() *extendedCache

Types

type NodeInfo

type NodeInfo struct {
	// Mutex guards all fields within this NodeInfo struct.
	Mutex sync.RWMutex

	// Total requested qos resources of this node. This includes assumed
	// pods, which scheduler has sent for binding, but may not be scheduled yet.
	QoSResourcesRequested *native.QoSResource
	// Total requested qos resources of 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.
	QoSResourcesNonZeroRequested *native.QoSResource
	// We store qos allocatedResources (which is CNR.Status.BestEffortResourceAllocatable.*) explicitly
	// as int64, to avoid conversions and accessing map.
	QoSResourcesAllocatable *native.QoSResource

	// record PodInfo here since we may have the functionality to
	// change pod resources.
	Pods map[string]*PodInfo

	// node TopologyPolicy and TopologyZones from CNR status.
	// is total CNR data necessary in extendedCache ?
	ResourceTopology *ResourceTopology

	// record assumed pod resource util pod is watched in CNR updated events.
	AssumedPodResources native.PodResource
}

NodeInfo is node level aggregated information.

func NewNodeInfo

func NewNodeInfo() *NodeInfo

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.

func (*NodeInfo) AddAssumedPod added in v0.4.0

func (n *NodeInfo) AddAssumedPod(pod *v1.Pod)

func (*NodeInfo) AddPod

func (n *NodeInfo) AddPod(key string, pod *v1.Pod)

AddPod adds pod information to this NodeInfo.

func (*NodeInfo) DeleteAssumedPod added in v0.4.0

func (n *NodeInfo) DeleteAssumedPod(pod *v1.Pod)

func (*NodeInfo) GetResourceTopologyCopy added in v0.4.0

func (n *NodeInfo) GetResourceTopologyCopy(filterFn podFilter) *ResourceTopology

func (*NodeInfo) RemovePod

func (n *NodeInfo) RemovePod(key string, pod *v1.Pod)

RemovePod subtracts pod information from this NodeInfo.

func (*NodeInfo) UpdateNodeInfo

func (n *NodeInfo) UpdateNodeInfo(cnr *apis.CustomNodeResource)

UpdateNodeInfo updates the NodeInfo.

type PodInfo

type PodInfo struct {
	QoSResourcesRequested        *native.QoSResource
	QoSResourcesNonZeroRequested *native.QoSResource
}

PodInfo is pod level aggregated information.

type ResourceTopology added in v0.4.0

type ResourceTopology struct {
	TopologyZone []*v1alpha1.TopologyZone

	TopologyPolicy v1alpha1.TopologyPolicy
}

func (*ResourceTopology) DeepCopy added in v0.4.0

func (rt *ResourceTopology) DeepCopy() *ResourceTopology

func (*ResourceTopology) Update added in v0.4.0

func (rt *ResourceTopology) Update(cnr *v1alpha1.CustomNodeResource)

func (*ResourceTopology) WithPodReousrce added in v0.4.0

func (rt *ResourceTopology) WithPodReousrce(podResource native.PodResource, filter podFilter) *ResourceTopology

WithPodReousrce add assumedPodResource to ResourceTopology, performing pessimistic overallocation across all the NUMA zones.

Jump to

Keyboard shortcuts

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