cache

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OvercommitPodHandler = "OvercommitPodHandler"
	OvercommitCNRHandler = "OvercommitCNRHandler"
)

Variables

This section is empty.

Functions

func GetCache

func GetCache() *overcommitCache

func RegisterCNRHandler

func RegisterCNRHandler()

RegisterCNRHandler register handler to scheduler event handlers

func RegisterPodHandler

func RegisterPodHandler()

RegisterPodHandler register handler to scheduler event handlers

Types

type NodeCache

type NodeCache struct {
	sync.RWMutex

	PodResources map[string]int

	// kubelet topology hint providers from CNR annotation.
	// provider will be cached only if provider policy is available.
	// only used for node resource overcommitment.
	HintProviders map[string]struct{}

	// total guaranteed cpus on node
	GuaranteedCPUs int
}

func New

func New() *NodeCache

func (*NodeCache) AddPod

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

func (*NodeCache) GetGuaranteedCPUs

func (n *NodeCache) GetGuaranteedCPUs() int

func (*NodeCache) HintProvidersAvailable

func (n *NodeCache) HintProvidersAvailable() (CPUManager, MemoryManager bool)

func (*NodeCache) RemovePod

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

Jump to

Keyboard shortcuts

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