Documentation ¶
Index ¶
- Constants
- type Delta
- type Limits
- type LimitsCheckResult
- type Manager
- func (m *Manager) ApplyLimits(ctx *context.AutoscalingContext, newCount int, resourceLeft Limits, ...) (int, errors.AutoscalerError)
- func (m *Manager) DeltaForNode(ctx *context.AutoscalingContext, nodeInfo *framework.NodeInfo, ...) (Delta, errors.AutoscalerError)
- func (m *Manager) ResourcesLeft(ctx *context.AutoscalingContext, nodeInfos map[string]*framework.NodeInfo, ...) (Limits, errors.AutoscalerError)
Constants ¶
const LimitUnknown = math.MaxInt64
LimitUnknown is used as a value in ResourcesLimits if actual limit could not be obtained due to errors talking to cloud provider.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LimitsCheckResult ¶
LimitsCheckResult contains the limit check result and the exceeded resources if any.
func CheckDeltaWithinLimits ¶
func CheckDeltaWithinLimits(left Limits, delta Delta) LimitsCheckResult
CheckDeltaWithinLimits compares the resource limit and resource delta, and returns the limit check result.
func LimitsNotExceeded ¶
func LimitsNotExceeded() LimitsCheckResult
LimitsNotExceeded returns a not exceeded limit check result.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provides resource checks before scaling up the cluster.
func NewManager ¶
func NewManager(crp customresources.CustomResourcesProcessor) *Manager
NewManager creates an instance of scale up resource manager with provided parameters.
func (*Manager) ApplyLimits ¶
func (m *Manager) ApplyLimits(ctx *context.AutoscalingContext, newCount int, resourceLeft Limits, nodeInfo *framework.NodeInfo, nodeGroup cloudprovider.NodeGroup) (int, errors.AutoscalerError)
ApplyLimits calculates the new node count by applying the left resource limits of the cluster.
func (*Manager) DeltaForNode ¶
func (m *Manager) DeltaForNode(ctx *context.AutoscalingContext, nodeInfo *framework.NodeInfo, nodeGroup cloudprovider.NodeGroup) (Delta, errors.AutoscalerError)
DeltaForNode calculates the amount of resources that will be used from the cluster when creating a node.
func (*Manager) ResourcesLeft ¶
func (m *Manager) ResourcesLeft(ctx *context.AutoscalingContext, nodeInfos map[string]*framework.NodeInfo, nodes []*corev1.Node) (Limits, errors.AutoscalerError)
ResourcesLeft calculates the amount of resources left in the cluster.