Documentation ¶
Index ¶
- func ReasonsMessage(noScaleUpInfo NoScaleUpInfo, ...) string
- type AutoscalingStatusProcessor
- type BackoffReasonStatus
- type CombinedScaleUpStatusProcessor
- type EventingScaleUpStatusProcessor
- type MetricsAutoscalingStatusProcessor
- type NoOpAutoscalingStatusProcessor
- type NoOpScaleDownStatusProcessor
- type NoOpScaleUpStatusProcessor
- type NoScaleUpInfo
- type Reasons
- type ScaleDownStatusProcessor
- type ScaleUpResult
- type ScaleUpStatus
- type ScaleUpStatusProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReasonsMessage ¶
func ReasonsMessage(noScaleUpInfo NoScaleUpInfo, consideredNodeGroups map[string]cloudprovider.NodeGroup) string
ReasonsMessage aggregates reasons from NoScaleUpInfos.
Types ¶
type AutoscalingStatusProcessor ¶
type AutoscalingStatusProcessor interface { Process(context *context.AutoscalingContext, csr *clusterstate.ClusterStateRegistry, now time.Time) error CleanUp() }
AutoscalingStatusProcessor processes the status of the cluster after each autoscaling iteration. It's triggered at the end of Autoscaler's RunOnce method.
func NewDefaultAutoscalingStatusProcessor ¶
func NewDefaultAutoscalingStatusProcessor() AutoscalingStatusProcessor
NewDefaultAutoscalingStatusProcessor creates a default instance of AutoscalingStatusProcessor.
type BackoffReasonStatus ¶
BackoffReasonStatus contains information about backoff status and reason
type CombinedScaleUpStatusProcessor ¶
type CombinedScaleUpStatusProcessor struct {
// contains filtered or unexported fields
}
CombinedScaleUpStatusProcessor is a list of ScaleUpStatusProcessor
func NewCombinedScaleUpStatusProcessor ¶
func NewCombinedScaleUpStatusProcessor(processors []ScaleUpStatusProcessor) *CombinedScaleUpStatusProcessor
NewCombinedScaleUpStatusProcessor construct CombinedScaleUpStatusProcessor.
func (*CombinedScaleUpStatusProcessor) AddProcessor ¶
func (p *CombinedScaleUpStatusProcessor) AddProcessor(processor ScaleUpStatusProcessor)
AddProcessor append processor to the list.
func (*CombinedScaleUpStatusProcessor) CleanUp ¶
func (p *CombinedScaleUpStatusProcessor) CleanUp()
CleanUp cleans up the processor's internal structures.
func (*CombinedScaleUpStatusProcessor) Process ¶
func (p *CombinedScaleUpStatusProcessor) Process(ctx *context.AutoscalingContext, status *ScaleUpStatus)
Process runs sub-processors sequentially in the same order of addition
type EventingScaleUpStatusProcessor ¶
type EventingScaleUpStatusProcessor struct{}
EventingScaleUpStatusProcessor processes the state of the cluster after a scale-up by emitting relevant events for pods depending on their post scale-up status.
func (*EventingScaleUpStatusProcessor) CleanUp ¶
func (p *EventingScaleUpStatusProcessor) CleanUp()
CleanUp cleans up the processor's internal structures.
func (*EventingScaleUpStatusProcessor) Process ¶
func (p *EventingScaleUpStatusProcessor) Process(context *context.AutoscalingContext, status *ScaleUpStatus)
Process processes the state of the cluster after a scale-up by emitting relevant events for pods depending on their post scale-up status.
type MetricsAutoscalingStatusProcessor ¶
type MetricsAutoscalingStatusProcessor struct {
// contains filtered or unexported fields
}
MetricsAutoscalingStatusProcessor is used to update metrics after each autoscaling iteration.
func (*MetricsAutoscalingStatusProcessor) CleanUp ¶
func (p *MetricsAutoscalingStatusProcessor) CleanUp()
CleanUp cleans up the processor's internal structures.
func (*MetricsAutoscalingStatusProcessor) Process ¶
func (p *MetricsAutoscalingStatusProcessor) Process(context *context.AutoscalingContext, csr *clusterstate.ClusterStateRegistry, now time.Time) error
Process queries the health status and backoff situation of all node groups and updates metrics after each autoscaling iteration.
type NoOpAutoscalingStatusProcessor ¶
type NoOpAutoscalingStatusProcessor struct{}
NoOpAutoscalingStatusProcessor is an AutoscalingStatusProcessor implementation useful for testing.
func (*NoOpAutoscalingStatusProcessor) CleanUp ¶
func (p *NoOpAutoscalingStatusProcessor) CleanUp()
CleanUp cleans up the processor's internal structures.
func (*NoOpAutoscalingStatusProcessor) Process ¶
func (p *NoOpAutoscalingStatusProcessor) Process(context *context.AutoscalingContext, csr *clusterstate.ClusterStateRegistry, now time.Time) error
Process processes the status of the cluster after an autoscaling iteration.
type NoOpScaleDownStatusProcessor ¶
type NoOpScaleDownStatusProcessor struct{}
NoOpScaleDownStatusProcessor is a ScaleDownStatusProcessor implementations useful for testing.
func (*NoOpScaleDownStatusProcessor) CleanUp ¶
func (p *NoOpScaleDownStatusProcessor) CleanUp()
CleanUp cleans up the processor's internal structures.
func (*NoOpScaleDownStatusProcessor) Process ¶
func (p *NoOpScaleDownStatusProcessor) Process(context *context.AutoscalingContext, status *status.ScaleDownStatus)
Process processes the status of the cluster after a scale-down.
type NoOpScaleUpStatusProcessor ¶
type NoOpScaleUpStatusProcessor struct{}
NoOpScaleUpStatusProcessor is a ScaleUpStatusProcessor implementations useful for testing.
func (*NoOpScaleUpStatusProcessor) CleanUp ¶
func (p *NoOpScaleUpStatusProcessor) CleanUp()
CleanUp cleans up the processor's internal structures.
func (*NoOpScaleUpStatusProcessor) Process ¶
func (p *NoOpScaleUpStatusProcessor) Process(context *context.AutoscalingContext, status *ScaleUpStatus)
Process processes the status of the cluster after a scale-up.
type NoScaleUpInfo ¶
type NoScaleUpInfo struct { Pod *apiv1.Pod RejectedNodeGroups map[string]Reasons SkippedNodeGroups map[string]Reasons }
NoScaleUpInfo contains information about a pod that didn't trigger scale-up.
type Reasons ¶
type Reasons interface {
Reasons() []string
}
Reasons interface provides a list of reasons for why something happened or didn't happen.
type ScaleDownStatusProcessor ¶
type ScaleDownStatusProcessor interface { Process(context *context.AutoscalingContext, status *status.ScaleDownStatus) CleanUp() }
ScaleDownStatusProcessor processes the status of the cluster after a scale-down.
func NewDefaultScaleDownStatusProcessor ¶
func NewDefaultScaleDownStatusProcessor() ScaleDownStatusProcessor
NewDefaultScaleDownStatusProcessor creates a default instance of ScaleUpStatusProcessor.
type ScaleUpResult ¶
type ScaleUpResult int
ScaleUpResult represents the result of a scale up.
const ( // ScaleUpSuccessful - a scale-up successfully occurred. ScaleUpSuccessful ScaleUpResult = iota // ScaleUpError - an unexpected error occurred during the scale-up attempt. ScaleUpError // ScaleUpNoOptionsAvailable - there were no node groups that could be considered for the scale-up. ScaleUpNoOptionsAvailable // ScaleUpNotNeeded - there was no need for a scale-up e.g. because there were no unschedulable pods. ScaleUpNotNeeded // ScaleUpNotTried - the scale up wasn't even attempted, e.g. an autoscaling iteration was skipped, or // an error occurred before the scale up logic. ScaleUpNotTried // ScaleUpInCooldown - the scale up wasn't even attempted, because it's in a cooldown state (it's suspended for a scheduled period of time). ScaleUpInCooldown )
type ScaleUpStatus ¶
type ScaleUpStatus struct { Result ScaleUpResult ScaleUpError *errors.AutoscalerError ScaleUpInfos []nodegroupset.ScaleUpInfo PodsTriggeredScaleUp []*apiv1.Pod PodsRemainUnschedulable []NoScaleUpInfo PodsAwaitEvaluation []*apiv1.Pod CreateNodeGroupResults []nodegroups.CreateNodeGroupResult ConsideredNodeGroups []cloudprovider.NodeGroup FailedCreationNodeGroups []cloudprovider.NodeGroup FailedResizeNodeGroups []cloudprovider.NodeGroup }
ScaleUpStatus is the status of a scale-up attempt. This includes information on if scale-up happened, description of scale-up operation performed and status of pods that took part in the scale-up evaluation.
func UpdateScaleUpError ¶
func UpdateScaleUpError(s *ScaleUpStatus, err errors.AutoscalerError) (*ScaleUpStatus, errors.AutoscalerError)
UpdateScaleUpError updates ScaleUpStatus.
func (*ScaleUpStatus) WasSuccessful ¶
func (s *ScaleUpStatus) WasSuccessful() bool
WasSuccessful returns true if the scale-up was successful.
type ScaleUpStatusProcessor ¶
type ScaleUpStatusProcessor interface { Process(context *context.AutoscalingContext, status *ScaleUpStatus) CleanUp() }
ScaleUpStatusProcessor processes the status of the cluster after a scale-up.
func NewDefaultScaleUpStatusProcessor ¶
func NewDefaultScaleUpStatusProcessor() ScaleUpStatusProcessor
NewDefaultScaleUpStatusProcessor creates a default instance of ScaleUpStatusProcessor.