Documentation
¶
Index ¶
- Constants
- func GenericPodZoneRequestResourcesGetter(pod *v1.Pod, zoneID string, podZoneAllocations map[string]ZoneAllocation) v1.ResourceList
- func NewReclaimedNumaResourcesEvictionPlugin(_ *client.GenericClientSet, _ events.EventRecorder, ...) plugin.EvictionPlugin
- func NewReclaimedResourcesEvictionPlugin(_ *client.GenericClientSet, _ events.EventRecorder, ...) plugin.EvictionPlugin
- func PodNUMARequestResourcesGetter(pod *v1.Pod, zoneID string, podZoneAllocations map[string]ZoneAllocation) v1.ResourceList
- type EvictScoreGetter
- type GracePeriodGetter
- type PodRequestResourcesGetter
- type PodZoneRequestResourcesGetter
- type ReclaimedNumaResourcesPlugin
- type ResourcesEvictionPlugin
- func (b *ResourcesEvictionPlugin) GetEvictPods(_ context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
- func (b *ResourcesEvictionPlugin) GetTopEvictionPods(ctx context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
- func (b *ResourcesEvictionPlugin) Name() string
- func (b *ResourcesEvictionPlugin) Start()
- func (b *ResourcesEvictionPlugin) ThresholdMet(ctx context.Context, _ *pluginapi.GetThresholdMetRequest) (*pluginapi.ThresholdMetResponse, error)
- type ResourcesGetter
- type ThresholdGetter
- type ZoneAllocation
- type ZoneResourcesPlugin
- func (p *ZoneResourcesPlugin) GetEvictPods(_ context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
- func (p *ZoneResourcesPlugin) GetTopEvictionPods(ctx context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
- func (p *ZoneResourcesPlugin) Name() string
- func (p *ZoneResourcesPlugin) Start()
- func (p *ZoneResourcesPlugin) ThresholdMet(ctx context.Context, _ *pluginapi.GetThresholdMetRequest) (*pluginapi.ThresholdMetResponse, error)
Constants ¶
const ( MetricsNamePodCount = "pod_count" MetricsNamePodResource = "pod_resource" MetricsNameGetResourceEmpty = "get_resource_empty" )
const ReclaimedNumaResourcesEvictionPluginName = "reclaimed-numa-resource-pressure-eviction-plugin"
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 NewReclaimedResourcesEvictionPlugin ¶
func NewReclaimedResourcesEvictionPlugin(_ *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 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 (b *ResourcesEvictionPlugin) GetEvictPods(_ context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
func (*ResourcesEvictionPlugin) GetTopEvictionPods ¶
func (b *ResourcesEvictionPlugin) GetTopEvictionPods(ctx context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
func (*ResourcesEvictionPlugin) Name ¶
func (b *ResourcesEvictionPlugin) Name() string
func (*ResourcesEvictionPlugin) Start ¶
func (b *ResourcesEvictionPlugin) Start()
func (*ResourcesEvictionPlugin) ThresholdMet ¶
func (b *ResourcesEvictionPlugin) ThresholdMet(ctx context.Context, _ *pluginapi.GetThresholdMetRequest) (*pluginapi.ThresholdMetResponse, error)
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 (p *ZoneResourcesPlugin) GetEvictPods(_ context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
func (*ZoneResourcesPlugin) GetTopEvictionPods ¶ added in v0.5.38
func (p *ZoneResourcesPlugin) GetTopEvictionPods(ctx context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
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
func (p *ZoneResourcesPlugin) ThresholdMet(ctx context.Context, _ *pluginapi.GetThresholdMetRequest) (*pluginapi.ThresholdMetResponse, error)
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).