Documentation ¶
Index ¶
- Variables
- func GetPodsAwaitingEvaluation(egs []*equivalence.PodGroup, bestOption string) []*apiv1.Pod
- func GetRemainingPods(egs []*equivalence.PodGroup, skipped map[string]status.Reasons) []status.NoScaleUpInfo
- type AsyncNodeGroupInitializer
- func (s *AsyncNodeGroupInitializer) ChangeTargetSize(nodeGroup string, delta int64)
- func (s *AsyncNodeGroupInitializer) GetTargetSize(nodeGroup string) int64
- func (s *AsyncNodeGroupInitializer) InitializeNodeGroup(result nodegroups.AsyncNodeGroupCreationResult)
- func (s *AsyncNodeGroupInitializer) SetTargetSize(nodeGroup string, size int64)
- type MaxResourceLimitReached
- type RejectedReasons
- type ScaleUpOrchestrator
- func (o *ScaleUpOrchestrator) ComputeExpansionOption(nodeGroup cloudprovider.NodeGroup, ...) expander.Option
- func (o *ScaleUpOrchestrator) ComputeSimilarNodeGroups(nodeGroup cloudprovider.NodeGroup, nodeInfos map[string]*framework.NodeInfo, ...) []cloudprovider.NodeGroup
- func (o *ScaleUpOrchestrator) CreateNodeGroup(initialOption *expander.Option, nodeInfos map[string]*framework.NodeInfo, ...) ([]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]*framework.NodeInfo) (*status.ScaleUpStatus, errors.AutoscalerError)
- func (o *ScaleUpOrchestrator) SchedulablePodGroups(podEquivalenceGroups []*equivalence.PodGroup, ...) []estimator.PodEquivalenceGroup
- func (o *ScaleUpOrchestrator) UpcomingNodes(nodeInfos map[string]*framework.NodeInfo) ([]*framework.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") )
var ( // AllOrNothingReason means the node group was rejected because not all pods would fit it when using all-or-nothing strategy. AllOrNothingReason = NewRejectedReasons("not all pods would fit and scale-up is using all-or-nothing strategy") )
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 AsyncNodeGroupInitializer ¶
type AsyncNodeGroupInitializer struct {
// contains filtered or unexported fields
}
AsyncNodeGroupInitializer is a component of the Orchestrator responsible for initial scale up of asynchronously created node groups.
func (*AsyncNodeGroupInitializer) ChangeTargetSize ¶
func (s *AsyncNodeGroupInitializer) ChangeTargetSize(nodeGroup string, delta int64)
ChangeTargetSize changes by delta a target size of an upcoming node group.
func (*AsyncNodeGroupInitializer) GetTargetSize ¶
func (s *AsyncNodeGroupInitializer) GetTargetSize(nodeGroup string) int64
GetTargetSize returns a target size of an upcoming node group.
func (*AsyncNodeGroupInitializer) InitializeNodeGroup ¶
func (s *AsyncNodeGroupInitializer) InitializeNodeGroup(result nodegroups.AsyncNodeGroupCreationResult)
InitializeNodeGroup performs the initial scale up of the node group and all additionally created node groups.
func (*AsyncNodeGroupInitializer) SetTargetSize ¶
func (s *AsyncNodeGroupInitializer) SetTargetSize(nodeGroup string, size int64)
SetTargetSize sets a target size of an upcoming node group.
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 RejectedReasons ¶
type RejectedReasons struct {
// contains filtered or unexported fields
}
RejectedReasons contains information why given node group was rejected as a scale-up option.
func NewRejectedReasons ¶
func NewRejectedReasons(m string) *RejectedReasons
NewRejectedReasons creates new RejectedReason object.
func (*RejectedReasons) Reasons ¶
func (sr *RejectedReasons) Reasons() []string
Reasons returns a slice of reasons why the node group was not considered for scale up.
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]*framework.NodeInfo, currentNodeCount int, now time.Time, allOrNothing bool, ) 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]*framework.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]*framework.NodeInfo, schedulablePodGroups map[string][]estimator.PodEquivalenceGroup, podEquivalenceGroups []*equivalence.PodGroup, daemonSets []*appsv1.DaemonSet, allOrNothing bool, ) ([]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 *framework.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]*framework.NodeInfo, allOrNothing bool, ) (*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]*framework.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 *framework.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]*framework.NodeInfo) ([]*framework.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.