resource

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

Types

type GracePeriodGetter

type GracePeriodGetter func() int64

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, thresholdGetter ThresholdGetter,
	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

Jump to

Keyboard shortcuts

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