Documentation ¶
Index ¶
- Variables
- func GetPodsAwaitingEvaluation(egs []*equivalence.PodGroup, bestOption string) []*apiv1.Pod
- func GetRemainingPods(egs []*equivalence.PodGroup, skipped map[string]status.Reasons) []status.NoScaleUpInfo
- func New() scaleup.Orchestrator
- type MaxResourceLimitReached
- type ScaleUpOrchestrator
- func (o *ScaleUpOrchestrator) ComputeExpansionOption(nodeGroup cloudprovider.NodeGroup, ...) expander.Option
- func (o *ScaleUpOrchestrator) ComputeSimilarNodeGroups(nodeGroup cloudprovider.NodeGroup, ...) []cloudprovider.NodeGroup
- func (o *ScaleUpOrchestrator) CreateNodeGroup(initialOption *expander.Option, ...) ([]nodegroups.CreateNodeGroupResult, *status.ScaleUpStatus, ...)
- func (o *ScaleUpOrchestrator) GetCappedNewNodeCount(newNodeCount, currentNodeCount int) (int, errors.AutoscalerError)
- func (o *ScaleUpOrchestrator) Initialize(autoscalingContext *context.AutoscalingContext, ...)
- func (o *ScaleUpOrchestrator) IsNodeGroupReadyToScaleUp(nodeGroup cloudprovider.NodeGroup, now time.Time) *SkippedReasons
- func (o *ScaleUpOrchestrator) IsNodeGroupResourceExceeded(resourcesLeft resource.Limits, nodeGroup cloudprovider.NodeGroup, ...) status.Reasons
- func (o *ScaleUpOrchestrator) ScaleUp(unschedulablePods []*apiv1.Pod, nodes []*apiv1.Node, ...) (*status.ScaleUpStatus, errors.AutoscalerError)
- func (o *ScaleUpOrchestrator) ScaleUpToNodeGroupMinSize(nodes []*apiv1.Node, nodeInfos map[string]*schedulerframework.NodeInfo) (*status.ScaleUpStatus, errors.AutoscalerError)
- func (o *ScaleUpOrchestrator) SchedulablePodGroups(podEquivalenceGroups []*equivalence.PodGroup, ...) []estimator.PodEquivalenceGroup
- func (o *ScaleUpOrchestrator) UpcomingNodes(nodeInfos map[string]*schedulerframework.NodeInfo) ([]*schedulerframework.NodeInfo, errors.AutoscalerError)
- type SkippedReasons
Constants ¶
This section is empty.
Variables ¶
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.
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 ¶
func (o *ScaleUpOrchestrator) UpcomingNodes(nodeInfos map[string]*schedulerframework.NodeInfo) ([]*schedulerframework.NodeInfo, errors.AutoscalerError)
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.