resource

package
v0.0.0-...-60a35bb Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delta

type Delta map[string]int64

Delta represents the amount of resources that can be removed from the cluster by deleting a single node.

type Limits

type Limits map[string]int64

Limits represents the total amount of resources that can be deleted from the cluster.

func NoLimits

func NoLimits() Limits

NoLimits returns empty Limits

func (*Limits) CheckDeltaWithinLimits

func (l *Limits) CheckDeltaWithinLimits(delta Delta) LimitsCheckResult

CheckDeltaWithinLimits checks if the resource delta is within limits.

func (Limits) DeepCopy

func (l Limits) DeepCopy() Limits

DeepCopy returns a copy of the original limits.

func (*Limits) TryDecrementBy

func (l *Limits) TryDecrementBy(delta Delta) LimitsCheckResult

TryDecrementBy makes an attempt to decrement resource limits by the provided delta. If the limits would be exceeded, they are not modified.

type LimitsCheckResult

type LimitsCheckResult struct {
	ExceededResources []string
}

LimitsCheckResult contains information about resources exceeded during a check.

func (LimitsCheckResult) Exceeded

func (l LimitsCheckResult) Exceeded() bool

Exceeded returns true iff at least one resource limit was exceeded during the check.

type LimitsFinder

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

LimitsFinder decides what node removals would violate cluster resource limits.

func NewLimitsFinder

NewLimitsFinder returns a new LimitsFinder

func (*LimitsFinder) DeltaForNode

func (lf *LimitsFinder) DeltaForNode(context *context.AutoscalingContext, node *apiv1.Node, nodeGroup cloudprovider.NodeGroup, resourcesWithLimits []string) (Delta, errors.AutoscalerError)

DeltaForNode calculates the amount of resources that will disappear from the cluster if a given node is deleted.

func (*LimitsFinder) LimitsLeft

func (lf *LimitsFinder) LimitsLeft(context *context.AutoscalingContext, nodes []*apiv1.Node, resourceLimiter *cloudprovider.ResourceLimiter, timestamp time.Time) Limits

LimitsLeft returns the amount of each resource that can be deleted from the cluster without violating any constraints.

Jump to

Keyboard shortcuts

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