orchestrator

package
v0.0.0-...-3fd892a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BackoffReason node group is in backoff.
	BackoffReason = NewSkippedReasons("in backoff after failed scale-up")
	// MaxLimitReachedReason node group reached max size limit.
	MaxLimitReachedReason = NewSkippedReasons("max node group size reached")
	// NotReadyReason node group is not ready.
	NotReadyReason = NewSkippedReasons("not ready for scale-up")
)

Functions

func GetPodsAwaitingEvaluation

func GetPodsAwaitingEvaluation(egs []*equivalence.PodGroup, bestOption string) []*apiv1.Pod

GetPodsAwaitingEvaluation returns list of pods for which CA was unable to help this scale up loop (but should be able to help).

func GetRemainingPods

func GetRemainingPods(egs []*equivalence.PodGroup, skipped map[string]status.Reasons) []status.NoScaleUpInfo

GetRemainingPods returns information about pods which CA is unable to help at this moment.

func New

func New() scaleup.Orchestrator

New returns new instance of scale up Orchestrator.

Types

type MaxResourceLimitReached

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

MaxResourceLimitReached contains information why given node group was skipped.

func NewMaxResourceLimitReached

func NewMaxResourceLimitReached(resources []string) *MaxResourceLimitReached

NewMaxResourceLimitReached returns a reason describing which cluster wide resource limits were reached.

func (*MaxResourceLimitReached) Reasons

func (sr *MaxResourceLimitReached) Reasons() []string

Reasons returns a slice of reasons why the node group was not considered for scale up.

func (*MaxResourceLimitReached) Resources

func (sr *MaxResourceLimitReached) Resources() []string

Resources returns a slice of resources which were missing in the node group.

type ScaleUpOrchestrator

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

ScaleUpOrchestrator implements scaleup.Orchestrator interface.

func (*ScaleUpOrchestrator) ComputeExpansionOption

func (o *ScaleUpOrchestrator) ComputeExpansionOption(
	nodeGroup cloudprovider.NodeGroup,
	schedulablePodGroups map[string][]estimator.PodEquivalenceGroup,
	nodeInfos map[string]*schedulerframework.NodeInfo,
	currentNodeCount int,
	now time.Time,
) expander.Option

ComputeExpansionOption computes expansion option based on pending pods and cluster state.

func (*ScaleUpOrchestrator) ComputeSimilarNodeGroups

func (o *ScaleUpOrchestrator) ComputeSimilarNodeGroups(
	nodeGroup cloudprovider.NodeGroup,
	nodeInfos map[string]*schedulerframework.NodeInfo,
	schedulablePodGroups map[string][]estimator.PodEquivalenceGroup,
	now time.Time,
) []cloudprovider.NodeGroup

ComputeSimilarNodeGroups finds similar node groups which can schedule the same set of pods as the main node group.

func (*ScaleUpOrchestrator) CreateNodeGroup

func (o *ScaleUpOrchestrator) CreateNodeGroup(
	initialOption *expander.Option,
	nodeInfos map[string]*schedulerframework.NodeInfo,
	schedulablePodGroups map[string][]estimator.PodEquivalenceGroup,
	podEquivalenceGroups []*equivalence.PodGroup,
	daemonSets []*appsv1.DaemonSet,
) ([]nodegroups.CreateNodeGroupResult, *status.ScaleUpStatus, errors.AutoscalerError)

CreateNodeGroup will try to create a new node group based on the initialOption.

func (*ScaleUpOrchestrator) GetCappedNewNodeCount

func (o *ScaleUpOrchestrator) GetCappedNewNodeCount(newNodeCount, currentNodeCount int) (int, errors.AutoscalerError)

GetCappedNewNodeCount caps resize according to cluster wide node count limit.

func (*ScaleUpOrchestrator) Initialize

func (o *ScaleUpOrchestrator) Initialize(
	autoscalingContext *context.AutoscalingContext,
	processors *ca_processors.AutoscalingProcessors,
	clusterStateRegistry *clusterstate.ClusterStateRegistry,
	estimatorBuilder estimator.EstimatorBuilder,
	taintConfig taints.TaintConfig,
)

Initialize initializes the orchestrator object with required fields.

func (*ScaleUpOrchestrator) IsNodeGroupReadyToScaleUp

func (o *ScaleUpOrchestrator) IsNodeGroupReadyToScaleUp(nodeGroup cloudprovider.NodeGroup, now time.Time) *SkippedReasons

IsNodeGroupReadyToScaleUp returns nil if node group is ready to be scaled up, otherwise a reason is provided.

func (*ScaleUpOrchestrator) IsNodeGroupResourceExceeded

func (o *ScaleUpOrchestrator) IsNodeGroupResourceExceeded(resourcesLeft resource.Limits, nodeGroup cloudprovider.NodeGroup, nodeInfo *schedulerframework.NodeInfo, numNodes int) status.Reasons

IsNodeGroupResourceExceeded returns nil if node group resource limits are not exceeded, otherwise a reason is provided.

func (*ScaleUpOrchestrator) ScaleUp

func (o *ScaleUpOrchestrator) ScaleUp(
	unschedulablePods []*apiv1.Pod,
	nodes []*apiv1.Node,
	daemonSets []*appsv1.DaemonSet,
	nodeInfos map[string]*schedulerframework.NodeInfo,
) (*status.ScaleUpStatus, errors.AutoscalerError)

ScaleUp tries to scale the cluster up. Returns appropriate status or error if an unexpected error occurred. Assumes that all nodes in the cluster are ready and in sync with instance groups.

func (*ScaleUpOrchestrator) ScaleUpToNodeGroupMinSize

func (o *ScaleUpOrchestrator) ScaleUpToNodeGroupMinSize(
	nodes []*apiv1.Node,
	nodeInfos map[string]*schedulerframework.NodeInfo,
) (*status.ScaleUpStatus, errors.AutoscalerError)

ScaleUpToNodeGroupMinSize tries to scale up node groups that have less nodes than the configured min size. The source of truth for the current node group size is the TargetSize queried directly from cloud providers. Returns appropriate status or error if an unexpected error occurred.

func (*ScaleUpOrchestrator) SchedulablePodGroups

func (o *ScaleUpOrchestrator) SchedulablePodGroups(
	podEquivalenceGroups []*equivalence.PodGroup,
	nodeGroup cloudprovider.NodeGroup,
	nodeInfo *schedulerframework.NodeInfo,
) []estimator.PodEquivalenceGroup

SchedulablePodGroups returns a list of pods that could be scheduled in a given node group after a scale up.

func (*ScaleUpOrchestrator) UpcomingNodes

UpcomingNodes returns a list of nodes that are not ready but should be.

type SkippedReasons

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

SkippedReasons contains information why given node group was skipped.

func NewSkippedReasons

func NewSkippedReasons(m string) *SkippedReasons

NewSkippedReasons creates new SkippedReason object.

func (*SkippedReasons) Reasons

func (sr *SkippedReasons) Reasons() []string

Reasons returns a slice of reasons why the node group was not considered for scale up.

Jump to

Keyboard shortcuts

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