Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Delta ¶
Delta represents the amount of resources that can be removed from the cluster by deleting a single node.
type Limits ¶
Limits represents the total amount of resources that can be deleted from the cluster.
func (*Limits) CheckDeltaWithinLimits ¶
func (l *Limits) CheckDeltaWithinLimits(delta Delta) LimitsCheckResult
CheckDeltaWithinLimits checks if the resource delta is within 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 ¶
func NewLimitsFinder(crp customresources.CustomResourcesProcessor) *LimitsFinder
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.