topologymanager

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const PolicyBestEffort string = "best-effort"

PolicyBestEffort policy name.

View Source
const PolicyNone string = "none"

PolicyNone policy name.

View Source
const PolicyRestricted string = "restricted"

PolicyRestricted policy name.

View Source
const PolicySingleNumaNode string = "single-numa-node"

PolicySingleNumaNode policy name.

Variables

This section is empty.

Functions

func InitStore

func InitStore(cycleState *framework.CycleState)

Types

type Interface

type Interface interface {
	Admit(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeName string, numaNodes []int, policyType apiext.NUMATopologyPolicy, exclusivePolicy apiext.NumaTopologyExclusive, allNUMANodeStatus []apiext.NumaNodeStatus) *framework.Status
}

func New

func New(hintProviderFactory NUMATopologyHintProviderFactory) Interface

type NUMATopologyHint

type NUMATopologyHint struct {
	NUMANodeAffinity bitmask.BitMask
	// Preferred is set to true when the NUMANodeAffinity encodes a preferred
	// allocation for the Pod. It is set to false otherwise.
	Preferred bool
	// Score is the weight of this hint. For the same Affinity,
	// the one with higher weight will be used first.
	Score int64
}

NUMATopologyHint is a struct containing the NUMANodeAffinity for a Container

func (*NUMATopologyHint) IsEqual

func (th *NUMATopologyHint) IsEqual(topologyHint NUMATopologyHint) bool

IsEqual checks if NUMATopologyHint are equal

func (*NUMATopologyHint) LessThan

func (th *NUMATopologyHint) LessThan(other NUMATopologyHint) bool

LessThan checks if NUMATopologyHint `a` is less than NUMATopologyHint `b` this means that either `a` is a preferred hint and `b` is not or `a` NUMANodeAffinity attribute is narrower than `b` NUMANodeAffinity attribute.

type NUMATopologyHintProvider

type NUMATopologyHintProvider interface {
	// GetPodTopologyHints returns a map of resource names to a list of possible
	// concrete resource allocations per Pod in terms of NUMA locality hints.
	GetPodTopologyHints(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeName string) (map[string][]NUMATopologyHint, *framework.Status)
	// Allocate triggers resource allocation to occur on the HintProvider after
	// all hints have been gathered and the aggregated Hint
	Allocate(ctx context.Context, cycleState *framework.CycleState, affinity NUMATopologyHint, pod *corev1.Pod, nodeName string) *framework.Status
}

type NUMATopologyHintProviderFactory

type NUMATopologyHintProviderFactory interface {
	GetNUMATopologyHintProvider() []NUMATopologyHintProvider
}

type Policy

type Policy interface {
	// Name returns Policy Name
	Name() string
	// Merge returns a merged NUMATopologyHint based on input from hint providers
	Merge(providersHints []map[string][]NUMATopologyHint, exclusivePolicy apiext.NumaTopologyExclusive, allNUMANodeStatus []apiext.NumaNodeStatus) (NUMATopologyHint, bool)
}

func NewBestEffortPolicy

func NewBestEffortPolicy(numaNodes []int) Policy

NewBestEffortPolicy returns best-effort policy.

func NewNonePolicy

func NewNonePolicy() Policy

NewNonePolicy returns none policy.

func NewRestrictedPolicy

func NewRestrictedPolicy(numaNodes []int) Policy

NewRestrictedPolicy returns restricted policy.

func NewSingleNumaNodePolicy

func NewSingleNumaNodePolicy(numaNodes []int) Policy

NewSingleNumaNodePolicy returns single-numa-node policy.

type Store

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

func GetStore

func GetStore(cycleState *framework.CycleState) *Store

func (*Store) Clone

func (s *Store) Clone() framework.StateData

func (*Store) GetAffinity

func (s *Store) GetAffinity(nodeName string) NUMATopologyHint

func (*Store) SetAffinity

func (s *Store) SetAffinity(nodeName string, affinity NUMATopologyHint)

Jump to

Keyboard shortcuts

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