nodegroupset

package
v0.0.0-...-6b2d771 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxAllocatableDifferenceRatio describes how Node.Status.Allocatable can differ between
	// groups in the same NodeGroupSet
	MaxAllocatableDifferenceRatio = 0.05
	// MaxFreeDifferenceRatio describes how free resources (allocatable - daemon and system pods)
	// can differ between groups in the same NodeGroupSet
	MaxFreeDifferenceRatio = 0.05
)

Variables

This section is empty.

Functions

func FindSimilarNodeGroups

func FindSimilarNodeGroups(nodeGroup cloudprovider.NodeGroup, cloudProvider cloudprovider.CloudProvider,
	nodeInfosForGroups map[string]*schedulercache.NodeInfo) ([]cloudprovider.NodeGroup, errors.AutoscalerError)

FindSimilarNodeGroups returns a list of NodeGroups similar to the given one. Two groups are similar if the NodeInfos for them compare equal using IsNodeInfoSimilar.

func IsNodeInfoSimilar

func IsNodeInfoSimilar(n1, n2 *schedulercache.NodeInfo) bool

IsNodeInfoSimilar returns true if two NodeInfos are similar enough to consider the NodeGroups they come from part of the same NodeGroupSet. The criteria are somewhat arbitrary, but generally we check if resources provided by both nodes are similar enough to likely be the same type of machine and if the set of labels is the same (except for a pre-defined set of labels like hostname or zone).

Types

type ScaleUpInfo

type ScaleUpInfo struct {
	// Group is the group to be scaled-up
	Group cloudprovider.NodeGroup
	// CurrentSize is the current size of the Group
	CurrentSize int
	// NewSize is the size the Group will be scaled-up to
	NewSize int
	// MaxSize is the maximum allowed size of the Group
	MaxSize int
}

ScaleUpInfo contains information about planned scale-up of a single NodeGroup

func BalanceScaleUpBetweenGroups

func BalanceScaleUpBetweenGroups(groups []cloudprovider.NodeGroup, newNodes int) ([]ScaleUpInfo, errors.AutoscalerError)

BalanceScaleUpBetweenGroups distributes a given number of nodes between given set of NodeGroups. The nodes are added to smallest group first, trying to make the group sizes as evenly balanced as possible.

Returns ScaleUpInfos for groups that need to be resized.

MaxSize of each group will be respected. If newNodes > total free capacity of all NodeGroups it will be capped to total capacity. In particular if all group already have MaxSize, empty list will be returned.

func (ScaleUpInfo) String

func (s ScaleUpInfo) String() string

String is used for printing ScaleUpInfo for logging, etc

Jump to

Keyboard shortcuts

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