Documentation ¶
Index ¶
- func ReasonsMessage(noScaleUpInfo NoScaleUpInfo) string
- type AutoscalingStatusProcessor
- type EventingScaleUpStatusProcessor
- type NoOpAutoscalingStatusProcessor
- type NoOpScaleDownStatusProcessor
- type NoOpScaleUpStatusProcessor
- type NoScaleUpInfo
- type NodeDeleteResult
- type NodeDeleteResultType
- type PodEvictionResult
- type Reasons
- type ScaleDownNode
- type ScaleDownResult
- type ScaleDownStatus
- 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) 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 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 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 *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 NodeDeleteResult ¶
type NodeDeleteResult struct { // Err contains nil if the delete was successful and an error otherwise. Err error // ResultType contains the type of the result of a node deletion. ResultType NodeDeleteResultType // PodEvictionResults maps pod names to the result of their eviction. PodEvictionResults map[string]PodEvictionResult }
NodeDeleteResult contains information about the result of a node deletion.
type NodeDeleteResultType ¶
type NodeDeleteResultType int
NodeDeleteResultType denotes the type of the result of node deletion. It provides deeper insight into why the node failed to be deleted.
const ( // NodeDeleteOk - the node was deleted successfully. NodeDeleteOk NodeDeleteResultType = iota // NodeDeleteErrorFailedToMarkToBeDeleted - node deletion failed because the node couldn't be marked to be deleted. NodeDeleteErrorFailedToMarkToBeDeleted // NodeDeleteErrorFailedToEvictPods - node deletion failed because some of the pods couldn't be evicted from the node. NodeDeleteErrorFailedToEvictPods // NodeDeleteErrorFailedToDelete - failed to delete the node from the cloud provider. NodeDeleteErrorFailedToDelete )
type PodEvictionResult ¶
PodEvictionResult contains the result of an eviction of a pod.
func (PodEvictionResult) WasEvictionSuccessful ¶
func (per PodEvictionResult) WasEvictionSuccessful() bool
WasEvictionSuccessful tells if the pod was successfully evicted.
type Reasons ¶
type Reasons interface {
Reasons() []string
}
Reasons interface provides a list of reasons for why something happened or didn't happen.
type ScaleDownNode ¶
type ScaleDownNode struct { Node *apiv1.Node NodeGroup cloudprovider.NodeGroup EvictedPods []*apiv1.Pod UtilInfo simulator.UtilizationInfo }
ScaleDownNode represents the state of a node that's being scaled down.
type ScaleDownResult ¶
type ScaleDownResult int
ScaleDownResult represents the result of scale down.
const ( // ScaleDownError - scale down finished with error. ScaleDownError ScaleDownResult = iota // ScaleDownNoUnneeded - no unneeded nodes and no errors. ScaleDownNoUnneeded // ScaleDownNoNodeDeleted - unneeded nodes present but not available for deletion. ScaleDownNoNodeDeleted // ScaleDownNodeDeleted - a node was deleted. ScaleDownNodeDeleted // ScaleDownNodeDeleteStarted - a node deletion process was started. ScaleDownNodeDeleteStarted // ScaleDownNotTried - the scale down wasn't even attempted, e.g. an autoscaling iteration was skipped, or // an error occurred before the scale up logic. ScaleDownNotTried // ScaleDownInCooldown - the scale down wasn't even attempted, because it's in a cooldown state (it's suspended for a scheduled period of time). ScaleDownInCooldown // ScaleDownInProgress - the scale down wasn't attempted, because a previous scale-down was still in progress. ScaleDownInProgress )
type ScaleDownStatus ¶
type ScaleDownStatus struct { Result ScaleDownResult ScaledDownNodes []*ScaleDownNode NodeDeleteResults map[string]NodeDeleteResult }
ScaleDownStatus represents the state of scale down.
type ScaleDownStatusProcessor ¶
type ScaleDownStatusProcessor interface { Process(context *context.AutoscalingContext, 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 ScaleUpInfos []nodegroupset.ScaleUpInfo PodsTriggeredScaleUp []*apiv1.Pod PodsRemainUnschedulable []NoScaleUpInfo PodsAwaitEvaluation []*apiv1.Pod }
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 (*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.