status

package
v0.0.0-...-70c0ce9 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 8

Documentation

Index

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

type BackoffReasonStatus map[string]bool

BackoffReasonStatus contains information about backoff status and reason

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

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

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

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

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

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

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.

Jump to

Keyboard shortcuts

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