resource

package
v0.5.40 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsNamePodCount         = "pod_count"
	MetricsNamePodResource      = "pod_resource"
	MetricsNameGetResourceEmpty = "get_resource_empty"
)
View Source
const ReclaimedNumaResourcesEvictionPluginName = "reclaimed-numa-resource-pressure-eviction-plugin"
View Source
const ReclaimedResourcesEvictionPluginName = "reclaimed-resource-pressure-eviction-plugin"

Variables

This section is empty.

Functions

func GenericPodZoneRequestResourcesGetter added in v0.5.38

func GenericPodZoneRequestResourcesGetter(
	pod *v1.Pod, zoneID string, podZoneAllocations map[string]ZoneAllocation,
) v1.ResourceList

func NewReclaimedNumaResourcesEvictionPlugin added in v0.5.32

func NewReclaimedNumaResourcesEvictionPlugin(_ *client.GenericClientSet, _ events.EventRecorder,
	metaServer *metaserver.MetaServer, emitter metrics.MetricEmitter, conf *config.Configuration,
) plugin.EvictionPlugin

func PodNUMARequestResourcesGetter added in v0.5.38

func PodNUMARequestResourcesGetter(pod *v1.Pod, zoneID string, podZoneAllocations map[string]ZoneAllocation) v1.ResourceList

Types

type EvictScoreGetter added in v0.5.39

type EvictScoreGetter func(pod *v1.Pod) *float64

type GracePeriodGetter

type GracePeriodGetter func() int64

type PodRequestResourcesGetter added in v0.5.32

type PodRequestResourcesGetter func(pod *v1.Pod) v1.ResourceList

type PodZoneRequestResourcesGetter added in v0.5.38

type PodZoneRequestResourcesGetter func(pod *v1.Pod, zoneID string, podZoneAllocations map[string]ZoneAllocation) v1.ResourceList

type ReclaimedNumaResourcesPlugin added in v0.5.32

type ReclaimedNumaResourcesPlugin struct {
	*process.StopControl
	*ZoneResourcesPlugin
}

type ResourcesEvictionPlugin

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

ResourcesEvictionPlugin implements EvictPlugin interface it trigger pod eviction logic based on the tolerance of resources.

func NewResourcesEvictionPlugin

func NewResourcesEvictionPlugin(pluginName string, metaServer *metaserver.MetaServer,
	emitter metrics.MetricEmitter, resourcesGetter ResourcesGetter, podRequestResourcesGetter PodRequestResourcesGetter, thresholdGetter ThresholdGetter,
	softThresholdGetter ThresholdGetter, evictScoreGetter EvictScoreGetter,
	deletionGracePeriodGetter GracePeriodGetter, thresholdMetToleranceDurationGetter GracePeriodGetter,
	skipZeroQuantityResourceNames sets.String,
	podFilter func(pod *v1.Pod) (bool, error),
) *ResourcesEvictionPlugin

func (*ResourcesEvictionPlugin) GetEvictPods

func (*ResourcesEvictionPlugin) GetTopEvictionPods

func (*ResourcesEvictionPlugin) Name

func (b *ResourcesEvictionPlugin) Name() string

func (*ResourcesEvictionPlugin) Start

func (b *ResourcesEvictionPlugin) Start()

func (*ResourcesEvictionPlugin) ThresholdMet

ThresholdMet evict pods when the beset effort resources usage is greater than the supply (after considering toleration).

type ResourcesGetter

type ResourcesGetter func(ctx context.Context) (v1.ResourceList, error)

type ThresholdGetter

type ThresholdGetter func(resourceName v1.ResourceName) *float64

type ZoneAllocation added in v0.5.38

type ZoneAllocation map[string]v1.ResourceList

ZoneAllocation is the resource status of a pod, where the key is zoneID

type ZoneResourcesPlugin added in v0.5.38

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

func NewZoneResourcesPlugin added in v0.5.38

func NewZoneResourcesPlugin(
	pluginName string,
	zoneType v1alpha1.TopologyType,
	metaServer *metaserver.MetaServer,
	emitter metrics.MetricEmitter,
	podZoneRequestResourcesGetter PodZoneRequestResourcesGetter,
	thresholdGetter ThresholdGetter,
	softThresholdGetter ThresholdGetter,
	evictScoreGetter EvictScoreGetter,
	deletionGracePeriodGetter GracePeriodGetter,
	thresholdMetToleranceDurationGetter GracePeriodGetter,
	skipZeroQuantityResourceNames sets.String,
	podFilter func(pod *v1.Pod) (bool, error),
) *ZoneResourcesPlugin

func (*ZoneResourcesPlugin) GetEvictPods added in v0.5.38

func (*ZoneResourcesPlugin) GetTopEvictionPods added in v0.5.38

GetTopEvictionPods selects the top-N candidate pods for eviction within a zone scope. The scope format is "zone<zoneID>|<resourceName>". Candidates are filtered by having non-zero requests for the target resource in the zone, then sorted by descending resource request value with stable tie handling.

func (*ZoneResourcesPlugin) Name added in v0.5.38

func (p *ZoneResourcesPlugin) Name() string

func (*ZoneResourcesPlugin) Start added in v0.5.38

func (p *ZoneResourcesPlugin) Start()

func (*ZoneResourcesPlugin) ThresholdMet added in v0.5.38

ThresholdMet evaluates per-zone resource pressure against configured thresholds. It aggregates per-pod zone requests (used) vs zone allocatable (total), applies a resource-specific threshold rate, and short-circuits on first exceed. Notes: - Uses requests as usage to avoid limit-induced overestimation. - Skips resources with zero total when configured in skip list. - Returns HARD_MET with GREATER_THAN semantics when used > threshold(total).

Jump to

Keyboard shortcuts

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